[asterisk-commits] kharwell: trunk r403083 - in /trunk: ./ contrib/ast-db-manage/config/versions...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 22 16:37:32 CST 2013


Author: kharwell
Date: Fri Nov 22 16:37:30 2013
New Revision: 403083

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=403083
Log:
res_pjsip: convert configuration settings names to snake case some more

Updated the alembic script for pjsip.  Also, the dtls config parsing stuff was
expecting strings with no underscores, so removed the underscores from the
option name before passing it to the parser.
........

Merged revisions 403082 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
    trunk/res/res_pjsip/pjsip_configuration.c

Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Fri Nov 22 16:37:30 2013
@@ -1,1 +1,1 @@
-/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-402993,403016,403022,403069
+/branches/12:1-398558,398560-398577,398579-399305,399307-401390,401392-402993,403016,403022,403069,403082

Modified: trunk/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py
URL: http://svnview.digium.com/svn/asterisk/trunk/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py?view=diff&rev=403083&r1=403082&r2=403083
==============================================================================
--- trunk/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py (original)
+++ trunk/contrib/ast-db-manage/config/versions/43956d550a44_add_tables_for_pjsip.py Fri Nov 22 16:37:30 2013
@@ -52,13 +52,13 @@
         sa.Column('direct_media_glare_mitigation',
                   sa.Enum(*PJSIP_DIRECT_MEDIA_GLARE_MITIGATION_VALUES, name='pjsip_direct_media_glare_mitigation_values')),
         sa.Column('disable_direct_media_on_nat', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('dtmfmode', sa.Enum(*PJSIP_DTMF_MODE_VALUES, name='pjsip_dtmf_mode_values')),
+        sa.Column('dtmf_mode', sa.Enum(*PJSIP_DTMF_MODE_VALUES, name='pjsip_dtmf_mode_values')),
         sa.Column('external_media_address', sa.String(40)),
         sa.Column('force_rport', sa.Enum(*YESNO_VALUES, name='yesno_values')),
         sa.Column('ice_support', sa.Enum(*YESNO_VALUES, name='yesno_values')),
         sa.Column('identify_by', sa.Enum(*PJSIP_IDENTIFY_BY_VALUES, name='pjsip_identify_by_values')),
         sa.Column('mailboxes', sa.String(40)),
-        sa.Column('mohsuggest', sa.String(40)),
+        sa.Column('moh_suggest', sa.String(40)),
         sa.Column('outbound_auth', sa.String(40)),
         sa.Column('outbound_proxy', sa.String(40)),
         sa.Column('rewrite_contact', sa.Enum(*YESNO_VALUES, name='yesno_values')),
@@ -81,43 +81,43 @@
         sa.Column('use_avpf', sa.Enum(*YESNO_VALUES, name='yesno_values')),
         sa.Column('media_encryption', sa.Enum(*PJSIP_MEDIA_ENCRYPTION_VALUES, name='pjsip_media_encryption_values')),
         sa.Column('inband_progress', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('callgroup', sa.String(40)),
-        sa.Column('pickupgroup', sa.String(40)),
-        sa.Column('namedcallgroup', sa.String(40)),
-        sa.Column('namedpickupgroup', sa.String(40)),
-        sa.Column('devicestate_busy_at', sa.Integer),
-        sa.Column('faxdetect', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('t38udptl', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('t38udptl_ec', sa.Enum(*PJSIP_T38UDPTL_EC_VALUES, name='pjsip_t38udptl_ec_values')),
-        sa.Column('t38udptl_maxdatagram', sa.Integer),
-        sa.Column('t38udptl_nat', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('t38udptl_ipv6', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('tonezone', sa.String(40)),
+        sa.Column('call_group', sa.String(40)),
+        sa.Column('pickup_group', sa.String(40)),
+        sa.Column('named_call_group', sa.String(40)),
+        sa.Column('named_pickup_group', sa.String(40)),
+        sa.Column('device_state_busy_at', sa.Integer),
+        sa.Column('fax_detect', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+        sa.Column('t38_udptl', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+        sa.Column('t38_udptl_ec', sa.Enum(*PJSIP_T38UDPTL_EC_VALUES, name='pjsip_t38udptl_ec_values')),
+        sa.Column('t38_udptl_maxdatagram', sa.Integer),
+        sa.Column('t38_udptl_nat', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+        sa.Column('t38_udptl_ipv6', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+        sa.Column('tone_zone', sa.String(40)),
         sa.Column('language', sa.String(40)),
         sa.Column('one_touch_recording', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('recordonfeature', sa.String(40)),
-        sa.Column('recordofffeature', sa.String(40)),
-        sa.Column('rtpengine', sa.String(40)),
-        sa.Column('allowtransfer', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('allowsubscribe', sa.Enum(*YESNO_VALUES, name='yesno_values')),
-        sa.Column('sdpowner', sa.String(40)),
-        sa.Column('sdpsession', sa.String(40)),
+        sa.Column('record_on_feature', sa.String(40)),
+        sa.Column('record_off_feature', sa.String(40)),
+        sa.Column('rtp_engine', sa.String(40)),
+        sa.Column('allow_transfer', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+        sa.Column('allow_subscribe', sa.Enum(*YESNO_VALUES, name='yesno_values')),
+        sa.Column('sdp_owner', sa.String(40)),
+        sa.Column('sdp_session', sa.String(40)),
         sa.Column('tos_audio', sa.Integer),
         sa.Column('tos_video', sa.Integer),
         sa.Column('cos_audio', sa.Integer),
         sa.Column('cos_video', sa.Integer),
-        sa.Column('subminexpiry', sa.Integer),
-        sa.Column('fromdomain', sa.String(40)),
-        sa.Column('fromuser', sa.String(40)),
-        sa.Column('mwifromuser', sa.String(40)),
-        sa.Column('dtlsverify', sa.String(40)),
-        sa.Column('dtlsrekey', sa.String(40)),
-        sa.Column('dtlscertfile', sa.String(200)),
-        sa.Column('dtlsprivatekey', sa.String(200)),
-        sa.Column('dtlscipher', sa.String(200)),
-        sa.Column('dtlscafile', sa.String(200)),
-        sa.Column('dtlscapath', sa.String(200)),
-        sa.Column('dtlssetup', sa.Enum(*PJSIP_DTLS_SETUP_VALUES, name='pjsip_dtls_setup_values')),
+        sa.Column('sub_min_expiry', sa.Integer),
+        sa.Column('from_domain', sa.String(40)),
+        sa.Column('from_user', sa.String(40)),
+        sa.Column('mwi_fromuser', sa.String(40)),
+        sa.Column('dtls_verify', sa.String(40)),
+        sa.Column('dtls_rekey', sa.String(40)),
+        sa.Column('dtls_cert_file', sa.String(200)),
+        sa.Column('dtls_private_key', sa.String(200)),
+        sa.Column('dtls_cipher', sa.String(200)),
+        sa.Column('dtls_ca_file', sa.String(200)),
+        sa.Column('dtls_ca_path', sa.String(200)),
+        sa.Column('dtls_setup', sa.Enum(*PJSIP_DTLS_SETUP_VALUES, name='pjsip_dtls_setup_values')),
         sa.Column('srtp_tag_32', sa.Enum(*YESNO_VALUES, name='yesno_values')),
     )
 

Modified: trunk/res/res_pjsip/pjsip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pjsip/pjsip_configuration.c?view=diff&rev=403083&r1=403082&r2=403083
==============================================================================
--- trunk/res/res_pjsip/pjsip_configuration.c (original)
+++ trunk/res/res_pjsip/pjsip_configuration.c Fri Nov 22 16:37:30 2013
@@ -520,8 +520,19 @@
 			 struct ast_variable *var, void *obj)
 {
 	struct ast_sip_endpoint *endpoint = obj;
-
-	return ast_rtp_dtls_cfg_parse(&endpoint->media.rtp.dtls_cfg, var->name, var->value);
+	char *name = ast_strdupa(var->name);
+	char *front, *buf = name;
+
+	/* strip out underscores in the name */
+	front = strtok(buf, "_");
+	while (front) {
+		int size = strlen(front);
+		ast_copy_string(buf, front, size + 1);
+		buf += size;
+		front = strtok(NULL, "_");
+	}
+
+	return ast_rtp_dtls_cfg_parse(&endpoint->media.rtp.dtls_cfg, name, var->value);
 }
 
 static int t38udptl_ec_handler(const struct aco_option *opt,




More information about the asterisk-commits mailing list