[asterisk-commits] sip to pjsip: Add compactheaders, timerb, timert1, and usera... (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 18 11:46:39 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: sip_to_pjsip: Add compactheaders, timerb, timert1, and useragent.
......................................................................


sip_to_pjsip: Add compactheaders, timerb, timert1, and useragent.

When using the migration script sip_to_pjsip.py, no section of type=system or
type=general were created. Therefore the keys compactheaders, timerb, timert1,
and useragent were not migrated to pjsip.conf.

ASTERISK-22374

Change-Id: I318a453843227ea36bf130d392d4abd7bd26b5a1
---
M contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
1 file changed, 30 insertions(+), 0 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py b/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
index 8909216..9f6919a 100755
--- a/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
+++ b/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py
@@ -1080,6 +1080,35 @@
             pass
 
 
+def map_system(sip, pjsip, nmapped):
+    section = 'system' # Just a label; you as user can change that
+    type = 'system' # Not a label, therefore not the same as section
+
+    try:
+        user_agent = sip.get('general', 'useragent')[0]
+        set_value('user_agent', user_agent, 'global', pjsip, nmapped, 'global')
+    except LookupError:
+        pass
+
+    try:
+        timer_t1 = sip.get('general', 'timert1')[0]
+        set_value('timer_t1', timer_t1, section, pjsip, nmapped, type)
+    except LookupError:
+        pass
+
+    try:
+        timer_b = sip.get('general', 'timerb')[0]
+        set_value('timer_b', timer_b, section, pjsip, nmapped, type)
+    except LookupError:
+        pass
+
+    try:
+        compact_headers = sip.get('general', 'compactheaders')[0]
+        set_value('compact_headers', compact_headers, section, pjsip, nmapped, type)
+    except LookupError:
+        pass
+
+
 def convert(sip, filename, non_mappings, include):
     """
     Entry point for configuration file conversion. This
@@ -1092,6 +1121,7 @@
     nmapped = non_mapped(non_mappings[filename])
     if not include:
         # Don't duplicate transport and registration configs
+        map_system(sip, pjsip, nmapped)
         map_transports(sip, pjsip, nmapped)
         map_registrations(sip, pjsip, nmapped)
     map_auth(sip, pjsip, nmapped)

-- 
To view, visit https://gerrit.asterisk.org/3611
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I318a453843227ea36bf130d392d4abd7bd26b5a1
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-commits mailing list