sip_to_pjsip: Map externhost/ip to Transports.
authorAlexander Traud <pabstraud@compuserve.com>
Thu, 18 Aug 2016 13:11:02 +0000 (15:11 +0200)
committerAlexander Traud <pabstraud@compuserve.com>
Thu, 18 Aug 2016 13:11:02 +0000 (15:11 +0200)
When using the migration script sip_to_pjsip.py, the externhost or externip of
sip.conf were erroneously written to Endpoints instead to Transports.

ASTERISK-22374

Change-Id: I2c5873386cfc388899fa9cf2368639dd12f1b8e4

contrib/scripts/sip_to_pjsip/sip_to_pjsip.py

index 8909216..bf45530 100755 (executable)
@@ -383,8 +383,6 @@ peer_map = [
     ['session-timers',     set_timers],          # timers
     ['session-minse',      set_value('timers_min_se')],
     ['session-expires',    set_value('timers_sess_expires')],
-    ['externip',           set_value('external_media_address')],
-    ['externhost',         set_value('external_media_address')],
     # identify_by ?
     ['directmedia',        set_direct_media],    # direct_media
                                                  # direct_media_method
@@ -598,6 +596,8 @@ def create_udp(sip, pjsip, nmapped):
         extern_addr = sip.multi_get('general', ['externaddr', 'externip',
                                     'externhost'])[0]
         host, port = split_hostport(extern_addr)
+        set_value('external_media_address', host, 'transport-udp', pjsip,
+                  nmapped, 'transport')
         set_value('external_signaling_address', host, 'transport-udp', pjsip,
                   nmapped, 'transport')
         if port:
@@ -645,6 +645,8 @@ def create_tcp(sip, pjsip, nmapped):
             tcpport = sip.get('general', 'externtcpport')[0]
         except:
             tcpport = port
+        set_value('external_media_address', host, 'transport-tcp', pjsip,
+                  nmapped, 'transport')
         set_value('external_signaling_address', host, 'transport-tcp', pjsip,
                   nmapped, 'transport')
         if tcpport:
@@ -789,6 +791,8 @@ def create_tls(sip, pjsip, nmapped):
             tlsport = sip.get('general', 'externtlsport')[0]
         except:
             tlsport = port
+        set_value('external_media_address', host, 'transport-tls', pjsip,
+                  nmapped, 'transport')
         set_value('external_signaling_address', host, 'transport-tls', pjsip,
                   nmapped, 'transport')
         if tlsport: