From: Alexander Traud Date: Thu, 18 Aug 2016 13:15:38 +0000 (+0200) Subject: sip_to_pjsip: Write username even without authname. X-Git-Tag: 13.12.0-rc1~113^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9a97398f7d9953e4ba404580b5043a102f1a739;p=thirdparty%2Fasterisk.git sip_to_pjsip: Write username even without authname. When using the migration script sip_to_pjsip.py, now the (mandatory) username is written to pjsip.conf, even if there was no (optional) authname in the register string in sip.conf. ASTERISK-22374 Change-Id: Ie53e1997104cd2674821688b8a8247249f5e156f --- diff --git a/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py b/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py index 890921673b..64bb492287 100755 --- a/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py +++ b/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py @@ -981,9 +981,8 @@ class Registration: if hasattr(self, 'secret') and self.secret: set_value('password', self.secret, auth_section, pjsip, nmapped, 'auth') - if hasattr(self, 'authuser'): - set_value('username', self.authuser or self.user, auth_section, - pjsip, nmapped, 'auth') + set_value('username', self.authuser if hasattr(self, 'authuser') + else self.user, auth_section, pjsip, nmapped, 'auth') set_value('outbound_auth', auth_section, section, pjsip, nmapped, 'registration')