[Asterisk-cvs] asterisk/channels chan_sip.c,1.348,1.349

markster at lists.digium.com markster at lists.digium.com
Thu Apr 29 18:20:46 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv18639/channels

Modified Files:
	chan_sip.c 
Log Message:
Add relaxdtmf option to sip


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.348
retrieving revision 1.349
diff -u -d -r1.348 -r1.349
--- chan_sip.c	29 Apr 2004 05:01:32 -0000	1.348
+++ chan_sip.c	29 Apr 2004 22:27:40 -0000	1.349
@@ -122,6 +122,8 @@
 
 static int autocreatepeer = 0;
 
+static int relaxdtmf = 0;
+
 static int usecnt =0;
 static ast_mutex_t usecnt_lock = AST_MUTEX_INITIALIZER;
 
@@ -1550,6 +1552,8 @@
                 if (i->dtmfmode & SIP_DTMF_INBAND) {
                     i->vad = ast_dsp_new();
                     ast_dsp_set_features(i->vad, DSP_FEATURE_DTMF_DETECT);
+		    if (relaxdtmf)
+			ast_dsp_digitmode(i->vad, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF);
                 }
 		tmp->fds[0] = ast_rtp_fd(i->rtp);
 		tmp->fds[1] = ast_rtcp_fd(i->rtp);
@@ -1734,6 +1738,8 @@
 			}
             if ((p->dtmfmode & SIP_DTMF_INBAND) && p->vad) {
                    f = ast_dsp_process(p->owner,p->vad,f);
+		   if (f && (f->frametype == AST_FRAME_DTMF)) 
+			ast_log(LOG_DEBUG, "Detected DTMF '%c'\n", f->subclass);
             }
 		}
 	}
@@ -6588,12 +6594,15 @@
 	strcpy(fromdomain, "");
 	globalcanreinvite = REINVITE_INVITE;
 	videosupport = 0;
+	relaxdtmf = 0;
 	pedanticsipchecking=0;
 	v = ast_variable_browse(cfg, "general");
 	while(v) {
 		/* Create the interface list */
 		if (!strcasecmp(v->name, "context")) {
 			strncpy(context, v->value, sizeof(context)-1);
+		} else if (!strcasecmp(v->name, "relaxdtmf")) {
+			relaxdtmf = ast_true(v->value);
 		} else if (!strcasecmp(v->name, "dtmfmode")) {
 			if (!strcasecmp(v->value, "inband"))
 				globaldtmfmode=SIP_DTMF_INBAND;




More information about the svn-commits mailing list