Commit b7e40e41 authored by Tomas Taraba's avatar Tomas Taraba

Merge branch '2524-each-mds-only-have-its-own-sip-peers' into 'master'

2524 add configregistrar to the find_sip_user_settings query

See merge request !61
parents 1cfa9bb8 5f553213
xivo-dao (2020.07.00) xivo-electra; urgency=medium
[ Tomas Taraba ]
* 3162 As a user with UA I should have only one presence state displayed for other users
[ esevellec ]
* 2524 add configregistrar to the sip user retrieving query
-- Tomas Taraba <[email protected]> Thu, 02 Apr 2020 14:57:19 +0200
xivo-dao (2019.12.07) xivo-deneb; urgency=medium
......
......@@ -538,6 +538,7 @@ def find_sip_user_settings(session):
UserFeatures.id.label('user_id'),
UserFeatures.uuid.label('uuid'),
(Voicemail.mailbox + '@' + Voicemail.context).label('mailbox'),
LineFeatures.configregistrar
).join(
LineFeatures, and_(LineFeatures.protocolid == UserSIP.id,
LineFeatures.protocol == 'sip')
......@@ -574,9 +575,10 @@ def find_sip_user_settings(session):
row.mailbox,
namedpickupgroup,
namedcallgroup,
row.configregistrar
],
labels=['UserSIP', 'protocol', 'context', 'number', 'mohsuggest', 'user_id',
'uuid', 'mailbox', 'namedpickupgroup', 'namedcallgroup']
'uuid', 'mailbox', 'namedpickupgroup', 'namedcallgroup', 'configregistrar']
)
yield updatedrow
......
......@@ -1495,7 +1495,7 @@ class TestFindSipUserSettings(DAOTestCase, PickupHelperMixin):
voicemail = self.add_voicemail(mailbox='1000', context='default')
user = self.add_user(firstname="John", lastname="Smith", voicemailid=voicemail.id, musiconhold='musiconhold')
sip = self.add_usersip(category='user')
line = self.add_line(protocol='sip', protocolid=sip.id, context="default")
line = self.add_line(protocol='sip', protocolid=sip.id, context="default", configregistrar="mds1")
self.add_user_line(user_id=user.id, line_id=line.id, extension_id=extension.id)
mailbox = '{}@{}'.format(voicemail.mailbox, voicemail.context)
......@@ -1506,7 +1506,8 @@ class TestFindSipUserSettings(DAOTestCase, PickupHelperMixin):
'mailbox': mailbox,
'mohsuggest': user.musiconhold,
'user_id': user.id,
'uuid': user.uuid}
'uuid': user.uuid,
'configregistrar': 'mds1'}
results = asterisk_conf_dao.find_sip_user_settings()
......
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