--- contrib/scripts/sip_to_pjsip/sip_to_pjsip.py (Asterisk 13.10.0) +++ contrib/scripts/sip_to_pjsip/sip_to_pjsip.py (working copy) @@ -57 +58,2 @@ - nmapped=None, type='endpoint', section_to=None): + nmapped=None, type='endpoint', section_to=None, + key_to=None): @@ -60 +62 @@ - merge_value(key if key else k, v, s, r, n, type, section_to) + merge_value(key if key else k, v, s, r, n, type, section_to, key_to) @@ -74 +76,2 @@ - set_value(key, i, section_to if section_to else section, + set_value(key_to if key_to else key, i, + section_to if section_to else section, @@ -457,3 +463,3 @@ - ['contactpermit', merge_value('contact_permit', type='acl', section_to='acl')], - ['contactdeny', merge_value('contact_deny', type='acl', section_to='acl')], - ['contactacl', merge_value('contact_acl', type='acl', section_to='acl')], + ['contactpermit', merge_value(type='acl', section_to='acl', key_to='contact_permit')], + ['contactdeny', merge_value(type='acl', section_to='acl', key_to='contact_deny')], + ['contactacl', merge_value(type='acl', section_to='acl', key_to='contact_acl')], @@ -502,15 +507,0 @@ -def add_localnet(section, pjsip, nmapped): - """ - Adds localnet values from sip.conf's general section to a transport in - pjsip.conf. Ideally, we would have just created a template with the - localnet sections, but because this is a script, it's not hard to add - the same thing on to every transport. - """ - try: - merge_value('local_net', sip.get('general', 'localnet')[0], 'general', - pjsip, nmapped, 'transport', section) - except LookupError: - # No localnet options configured. No biggie! - pass - - @@ -530,2 +520,2 @@ - merge_value('local_net', sip.get('general', 'localnet')[0], 'general', - pjsip, nmapped, 'transport', section) + merge_value('localnet', sip.get('general', 'localnet')[0], 'general', + pjsip, nmapped, 'transport', section, "local_net")