[asterisk-commits] mmichelson: branch mmichelson/conversion_script r399909 - /team/mmichelson/co...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 26 15:53:17 CDT 2013


Author: mmichelson
Date: Thu Sep 26 15:53:15 2013
New Revision: 399909

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399909
Log:
Address Kinsey's reviewboard comment.

This also fixes a few places where I was attempting to set a
string equal to the return of sip.get(). sip.get() returns a
list, though.


Modified:
    team/mmichelson/conversion_script/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py

Modified: team/mmichelson/conversion_script/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/conversion_script/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py?view=diff&rev=399909&r1=399908&r2=399909
==============================================================================
--- team/mmichelson/conversion_script/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py (original)
+++ team/mmichelson/conversion_script/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py Thu Sep 26 15:53:15 2013
@@ -155,6 +155,14 @@
 
 def set_media_encryption(key, val, section, pjsip, nmapped):
     """Sets the media_encryption value in pjsip.conf"""
+    try:
+        dtls = sip.get(section, 'dtlsenable')[0]
+        if dtls == 'yes':
+            # If DTLS is enabled, then that overrides SDES encryption.
+            return
+    except LookupError:
+        pass
+
     if val == 'yes':
         set_value('media_encryption', 'sdes', section, pjsip, nmapped)
 
@@ -246,7 +254,7 @@
     """
 
     try:
-        subscribemwi = sip.get(section, 'subscribemwi')
+        subscribemwi = sip.get(section, 'subscribemwi')[0]
     except LookupError:
         # No subscribemwi option means default it to 'no'
         subscribemwi = 'no'
@@ -298,13 +306,13 @@
         return
 
     try:
-        ip = sip.get(section, 'host')
+        ip = sip.get(section, 'host')[0]
     except LookupError:
         return
 
     if ip == 'dynamic':
         try:
-            ip = sip.get(section, 'defaultip')
+            ip = sip.get(section, 'defaultip')[0]
         except LookupError:
             return
 
@@ -595,7 +603,7 @@
                                     'externhost'])[0]
         host, port = split_hostport(extern_addr)
         try:
-            tcpport = sip.get('general', 'externtcpport')
+            tcpport = sip.get('general', 'externtcpport')[0]
         except:
             tcpport = port
         set_value('external_signaling_address', host, 'transport-tcp', pjsip,
@@ -739,7 +747,7 @@
                                     'externhost'])[0]
         host, port = split_hostport(extern_addr)
         try:
-            tlsport = sip.get('general', 'externtlsport')
+            tlsport = sip.get('general', 'externtlsport')[0]
         except:
             tlsport = port
         set_value('external_signaling_address', host, 'transport-tls', pjsip,




More information about the asterisk-commits mailing list