diff options
author | Joshua Colp <jcolp@digium.com> | 2016-08-18 11:46:25 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-08-18 11:46:25 -0500 |
commit | 1ae280ed6cc573037156dd8ad84208d2c8e42e60 (patch) | |
tree | 723c91deb0aef0797d134ab7ac6cc4341398db4a /contrib | |
parent | 02f2937f48be49e3fecb8b2e37ceaf0f9922e133 (diff) | |
parent | 6500f5e138d21589cde9bf0c76ccecefa2b7a71d (diff) |
Merge "sip_to_pjsip: Add compactheaders, timerb, timert1, and useragent." into 13
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/scripts/sip_to_pjsip/sip_to_pjsip.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py b/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py index f4cda9a75..214a73351 100755 --- a/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py +++ b/contrib/scripts/sip_to_pjsip/sip_to_pjsip.py @@ -1083,6 +1083,35 @@ def find_non_mapped(sections, nmapped): 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 @@ -1095,6 +1124,7 @@ def convert(sip, filename, non_mappings, include): 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) |