[svn-commits] mmichelson: branch mmichelson/conversion_script r398815 - /team/mmichelson/co...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 11 11:00:05 CDT 2013


Author: mmichelson
Date: Wed Sep 11 11:00:03 2013
New Revision: 398815

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398815
Log:
Create identify section based on type of sip.conf peer.

type=peer and type=friend can be looked up by IP address.


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=398815&r1=398814&r2=398815
==============================================================================
--- 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 Wed Sep 11 11:00:03 2013
@@ -283,6 +283,24 @@
 
     set_value('auth', section, section, pjsip, nmapped)
     set_value('outbound_auth', realm_str, section, pjsip, nmapped)
+
+def setup_ident(key, val, section, pjsip, nmapped):
+    if val != 'peer' and val != 'friend':
+        return
+
+    try:
+        ip = sip.get(section, 'host')
+    except LookupError:
+        return
+
+    if ip == 'dynamic':
+        try:
+            ip = sip.get(section, 'defaultip')
+        except LookupError:
+            return
+
+    set_value('endpoint', section, section, pjsip, nmapped, 'identify')
+    set_value('match', ip, section, pjsip, nmapped, 'identify')
 
 ###############################################################################
 
@@ -333,6 +351,7 @@
     ['busylevel',          set_value('devicestate_busy_at')],
     ['secret',             setup_auth],
     ['md5secret',          setup_auth],
+    ['type',               setup_ident],
 
 ############################ maps to an aor ###################################
 




More information about the svn-commits mailing list