Commit 4c8f473f authored by Jirka Hlavacek's avatar Jirka Hlavacek

Merge branch '2396-remove-all-mediaserver-entry'

parents 7afcd8eb 85b8f81b
......@@ -3,6 +3,7 @@ xivo-dao (2019.04.00) xivo-callisto; urgency=medium
* 2371 Fix agent api by porting the following fixes
* 2375 Add a CtiProfile to user when it's not set and a login is set
* 2352 Add api to create func key destination for agent
* 2396 Remove all_mds entry from mediaserver table
* 2400 Add route tables for outcall application
* 2415 Fix incompatibility with security patch of SQLAlechemy
......
......@@ -359,8 +359,7 @@ def is_sip_trunk_on_current_mds(session, trunk_name, current_mds_name):
match = (session.query(TrunkFeatures)
.join(UserSIP, UserSIP.id == TrunkFeatures.protocolid)
.join(MediaServer, and_(MediaServer.id == TrunkFeatures.mediaserverid,
or_(MediaServer.name == current_mds_name,
MediaServer.name == 'all_mds')))
MediaServer.name == current_mds_name))
.filter(UserSIP.name == trunk_name)
.first())
......@@ -420,7 +419,6 @@ def find_sip_general_settings(session, current_mds_name):
StaticSIP.commented == 0,
or_(
MediaServer.name == None,
MediaServer.name == 'all_mds',
MediaServer.name == current_mds_name
)
)
......
......@@ -677,15 +677,6 @@ class TestAsteriskConfDAO(DAOTestCase, PickupHelperMixin):
result = asterisk_conf_dao.is_sip_trunk_on_current_mds('trunk1', 'mds1')
assert_that(result, equal_to(False))
def test_is_sip_trunk_on_every_mds(self):
self.add_netiface(networktype='voip', address='1.1.1.1')
self.add_usersip(id='5', category='trunk', name='trunk1')
self.add_mediaserver(id='8', name='all_mds', display_name='All MDS', voip_ip='10.10.0.1')
self.add_sip_trunk(protocol='sip', protocolid='5', mediaserverid='8')
result = asterisk_conf_dao.is_sip_trunk_on_current_mds('trunk1', 'mds1')
assert_that(result, equal_to(True))
def test_is_sip_trunk_on_main_mds(self):
self.add_netiface(networktype='voip', address='1.1.1.1')
self.add_usersip(id='5', category='trunk', name='trunk1')
......@@ -790,7 +781,6 @@ class TestAsteriskConfDAO(DAOTestCase, PickupHelperMixin):
self.add_netiface(networktype='voip', address='1.1.1.1')
local_mds = self.add_mediaserver(name='mds1', display_name='MDS1', voip_ip='10.10.0.1')
remote_mds = self.add_mediaserver(name='mds2', display_name='MDS2', voip_ip='10.10.0.2')
global_mds = self.add_mediaserver(name='all_mds', display_name='All MDS', voip_ip='10.10.0.3')
local_trunk = self.add_usersip(category='trunk', name='trunk1')
local_register = self.add_sip_general_settings(var_name='register', var_val='udp://mds1-register:passwd:mds1@192.168.56.201')
......@@ -800,9 +790,6 @@ class TestAsteriskConfDAO(DAOTestCase, PickupHelperMixin):
remote_register = self.add_sip_general_settings(var_name='register', var_val='udp://mds2-register:passwd:mds2@192.168.56.202')
self.add_sip_trunk(protocol='sip', protocolid=remote_trunk.id, mediaserverid=remote_mds.id, registerid=remote_register.id)
global_trunk = self.add_usersip(category='trunk', name='trunk3')
global_register = self.add_sip_general_settings(var_name='register', var_val='udp://mds3-register:passwd:mds3@192.168.56.203')
self.add_sip_trunk(protocol='sip', protocolid=global_trunk.id, mediaserverid=global_mds.id, registerid=global_register.id)
sip1 = self.add_sip_general_settings()
self.add_sip_general_settings(commented=1)
......@@ -810,8 +797,6 @@ class TestAsteriskConfDAO(DAOTestCase, PickupHelperMixin):
expected_result = [
{'var_name': local_register.var_name,
'var_val': local_register.var_val},
{'var_name': global_register.var_name,
'var_val': global_register.var_val},
{'var_name': sip1.var_name,
'var_val': sip1.var_val},
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment