[Asterisk-cvs] asterisk/channels chan_sip.c,1.324,1.325

markster at lists.digium.com markster at lists.digium.com
Fri Apr 2 09:41:08 CST 2004


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

Modified Files:
	chan_sip.c 
Log Message:
When going to in-band, be sure to allocate DSP (bug #1336)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.324
retrieving revision 1.325
diff -u -d -r1.324 -r1.325
--- chan_sip.c	2 Apr 2004 07:24:33 -0000	1.324
+++ chan_sip.c	2 Apr 2004 14:40:21 -0000	1.325
@@ -1679,7 +1679,7 @@
 				ast_set_read_format(p->owner, p->owner->readformat, 0);
 				ast_set_write_format(p->owner, p->owner->writeformat, 0);
 			}
-            if (p->dtmfmode & SIP_DTMF_INBAND) {
+            if ((p->dtmfmode & SIP_DTMF_INBAND) && p->vad) {
                    f = ast_dsp_process(p->owner,p->vad,f,0);
             }
 		}
@@ -6729,6 +6729,17 @@
 			p->dtmfmode = SIP_DTMF_INBAND;
 		else
 			ast_log(LOG_WARNING, "I don't know about this dtmf mode: %s\n",mode);
+        if (p->dtmfmode & SIP_DTMF_INBAND) {
+				if (!p->vad) {
+	               p->vad = ast_dsp_new();
+	               ast_dsp_set_features(p->vad, DSP_FEATURE_DTMF_DETECT);
+				}
+        } else {
+			if (p->vad) {
+				ast_dsp_free(p->vad);
+				p->vad = NULL;
+			}
+		}
 		ast_mutex_unlock(&p->lock);
 	}
 	ast_mutex_unlock(&chan->lock);




More information about the svn-commits mailing list