[asterisk-commits] pcadach: trunk r43575 - in /trunk: channels/chan_h323.c configs/h323.conf.sample

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Sep 24 11:59:39 MST 2006


Author: pcadach
Date: Sun Sep 24 13:59:38 2006
New Revision: 43575

URL: http://svn.digium.com/view/asterisk?rev=43575&view=rev
Log:
Specify RFC2833 payload on dtmfmode option rather than dtmfcodec option (deprecated)

Modified:
    trunk/channels/chan_h323.c
    trunk/configs/h323.conf.sample

Modified: trunk/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_h323.c?rev=43575&r1=43574&r2=43575&view=diff
==============================================================================
--- trunk/channels/chan_h323.c (original)
+++ trunk/channels/chan_h323.c Sun Sep 24 13:59:38 2006
@@ -1247,21 +1247,37 @@
 static int update_common_options(struct ast_variable *v, struct call_options *options)
 {
 	int tmp;
+	char *val, *opt;
 
 	if (!strcasecmp(v->name, "allow")) {
 		ast_parse_allow_disallow(&options->prefs, &options->capability, v->value, 1);
 	} else if (!strcasecmp(v->name, "disallow")) {
 		ast_parse_allow_disallow(&options->prefs, &options->capability, v->value, 0);
 	} else if (!strcasecmp(v->name, "dtmfmode")) {
+		val = strdupa(v->value);
+		if ((opt = strchr(val, ':')) != (char *)NULL) {
+			*opt++ = '\0';
+			tmp = atoi(opt);
+		}
 		if (!strcasecmp(v->value, "inband")) {
 			options->dtmfmode |= H323_DTMF_INBAND;
-		} else if (!strcasecmp(v->value, "rfc2833")) {
+		} else if (!strcasecmp(val, "rfc2833")) {
 			options->dtmfmode |= H323_DTMF_RFC2833;
+			if (!opt)
+				options->dtmfcodec = H323_DTMF_RFC2833_PT;
+			else if ((tmp >= 96) && (tmp < 128))
+				options->dtmfcodec = tmp;
+			else {
+				options->dtmfcodec = H323_DTMF_RFC2833_PT;
+				ast_log(LOG_WARNING, "Unknown rfc2833 payload %s specified at line %d, using default %d\n", opt, v->lineno, options->dtmfcodec);
+			}
 		} else {
 			ast_log(LOG_WARNING, "Unknown dtmf mode '%s', using rfc2833\n", v->value);
 			options->dtmfmode |= H323_DTMF_RFC2833;
+			options->dtmfcodec = H323_DTMF_RFC2833_PT;
 		}
 	} else if (!strcasecmp(v->name, "dtmfcodec")) {
+		ast_log(LOG_NOTICE, "Option %s at line %d is deprecated. Use dtmfmode=rfc2833[:<payload>] instead.\n", v->name, v->lineno);
 		tmp = atoi(v->value);
 		if (tmp < 96)
 			ast_log(LOG_WARNING, "Invalid %s value %s at line %d\n", v->name, v->value, v->lineno);

Modified: trunk/configs/h323.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/h323.conf.sample?rev=43575&r1=43574&r2=43575&view=diff
==============================================================================
--- trunk/configs/h323.conf.sample (original)
+++ trunk/configs/h323.conf.sample Sun Sep 24 13:59:38 2006
@@ -35,9 +35,9 @@
 ; Default RTP Payload to send RFC2833 DTMF on.  This is used to
 ; interoperate with broken gateways which cannot successfully
 ; negotiate a RFC2833 payload type in the TerminalCapabilitySet.
-;
-; You may also specify on either a per-peer or per-user basis below.
-;dtmfcodec=101
+; To specify required payload type, put it after colon in dtmfmode
+; option like
+;dtmfmode=rfc2833:101
 ;
 ; Set the gatekeeper 
 ; DISCOVER			- Find the Gk address using multicast



More information about the asterisk-commits mailing list