[asterisk-commits] qwell: trunk r110161 - in /trunk: channels/ include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 19 17:25:35 CDT 2008


Author: qwell
Date: Wed Mar 19 17:25:34 2008
New Revision: 110161

URL: http://svn.digium.com/view/asterisk?view=rev&rev=110161
Log:
Rename DSP_FEATURE_DTMF_DETECT, because we are *NOT* only detecting DTMF digits.
This was very misleading.

Early cleanup for issue #11968

Modified:
    trunk/channels/chan_h323.c
    trunk/channels/chan_mgcp.c
    trunk/channels/chan_misdn.c
    trunk/channels/chan_sip.c
    trunk/channels/chan_zap.c
    trunk/include/asterisk/dsp.h
    trunk/main/dsp.c

Modified: trunk/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_h323.c?view=diff&rev=110161&r1=110160&r2=110161
==============================================================================
--- trunk/channels/chan_h323.c (original)
+++ trunk/channels/chan_h323.c Wed Mar 19 17:25:34 2008
@@ -1053,7 +1053,7 @@
 		/* Allocate dsp for in-band DTMF support */
 		if (pvt->options.dtmfmode & H323_DTMF_INBAND) {
 			pvt->vad = ast_dsp_new();
-			ast_dsp_set_features(pvt->vad, DSP_FEATURE_DTMF_DETECT);
+			ast_dsp_set_features(pvt->vad, DSP_FEATURE_DIGIT_DETECT);
 		}
 		/* Register channel functions. */
 		ch->tech_pvt = pvt;

Modified: trunk/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=110161&r1=110160&r2=110161
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Wed Mar 19 17:25:34 2008
@@ -1511,7 +1511,7 @@
 			ast_channel_set_fd(tmp, 0, ast_rtp_fd(sub->rtp));
 		if (i->dtmfmode & (MGCP_DTMF_INBAND | MGCP_DTMF_HYBRID)) {
 			i->dsp = ast_dsp_new();
-			ast_dsp_set_features(i->dsp,DSP_FEATURE_DTMF_DETECT);
+			ast_dsp_set_features(i->dsp, DSP_FEATURE_DIGIT_DETECT);
 			/* this is to prevent clipping of dtmf tones during dsp processing */
 			ast_dsp_set_digitmode(i->dsp, DSP_DIGITMODE_NOQUELCH);
 		} else {

Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?view=diff&rev=110161&r1=110160&r2=110161
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Wed Mar 19 17:25:34 2008
@@ -2154,9 +2154,9 @@
 			ch->dsp = ast_dsp_new();
 		if (ch->dsp) {
 			if (ch->faxdetect) 
-				ast_dsp_set_features(ch->dsp, DSP_FEATURE_DTMF_DETECT | DSP_FEATURE_FAX_DETECT);
+				ast_dsp_set_features(ch->dsp, DSP_FEATURE_DIGIT_DETECT | DSP_FEATURE_FAX_DETECT);
 			else 
-				ast_dsp_set_features(ch->dsp, DSP_FEATURE_DTMF_DETECT );
+				ast_dsp_set_features(ch->dsp, DSP_FEATURE_DIGIT_DETECT );
 		}
 		if (!ch->trans)
 			ch->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, AST_FORMAT_ALAW);
@@ -5492,7 +5492,7 @@
 		if (!ch->dsp)
 			ch->dsp = ast_dsp_new();
 		if (ch->dsp)
-			ast_dsp_set_features(ch->dsp, DSP_FEATURE_DTMF_DETECT | DSP_FEATURE_FAX_DETECT);
+			ast_dsp_set_features(ch->dsp, DSP_FEATURE_DIGIT_DETECT | DSP_FEATURE_FAX_DETECT);
 		if (!ch->trans)
 			ch->trans = ast_translator_build_path(AST_FORMAT_SLINEAR, AST_FORMAT_ALAW);
 	}

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=110161&r1=110160&r2=110161
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Mar 19 17:25:34 2008
@@ -5317,7 +5317,7 @@
 
 	if (ast_test_flag(&i->flags[0], SIP_DTMF) ==  SIP_DTMF_INBAND) {
 		i->vad = ast_dsp_new();
-		ast_dsp_set_features(i->vad, DSP_FEATURE_DTMF_DETECT);
+		ast_dsp_set_features(i->vad, DSP_FEATURE_DIGIT_DETECT);
 		if (global_relaxdtmf)
 			ast_dsp_set_digitmode(i->vad, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF);
 	}
@@ -21187,7 +21187,7 @@
 	if (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) {
 		if (!p->vad) {
 			p->vad = ast_dsp_new();
-			ast_dsp_set_features(p->vad, DSP_FEATURE_DTMF_DETECT);
+			ast_dsp_set_features(p->vad, DSP_FEATURE_DIGIT_DETECT);
 		}
 	} else {
 		if (p->vad) {

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=110161&r1=110160&r2=110161
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Wed Mar 19 17:25:34 2008
@@ -3703,7 +3703,7 @@
 	ioctl(p->subs[SUB_REAL].zfd, ZT_TONEDETECT, &val);
 #endif		
 	if (!p->hardwaredtmf && p->dsp) {
-		p->dsp_features &= ~DSP_FEATURE_DTMF_DETECT;
+		p->dsp_features &= ~DSP_FEATURE_DIGIT_DETECT;
 		ast_dsp_set_features(p->dsp, p->dsp_features);
 	}
 }
@@ -3724,7 +3724,7 @@
 	ioctl(p->subs[SUB_REAL].zfd, ZT_TONEDETECT, &val);
 #endif		
 	if (!p->hardwaredtmf && p->dsp) {
-		p->dsp_features |= DSP_FEATURE_DTMF_DETECT;
+		p->dsp_features |= DSP_FEATURE_DIGIT_DETECT;
 		ast_dsp_set_features(p->dsp, p->dsp_features);
 	}
 }
@@ -5903,11 +5903,11 @@
 		if (ioctl(i->subs[index].zfd, ZT_TONEDETECT, &x)) {
 #endif		
 			i->hardwaredtmf = 0;
-			features |= DSP_FEATURE_DTMF_DETECT;
+			features |= DSP_FEATURE_DIGIT_DETECT;
 #ifdef ZT_TONEDETECT
 		} else if (NEED_MFDETECT(i)) {
 			i->hardwaredtmf = 1;
-			features |= DSP_FEATURE_DTMF_DETECT;
+			features |= DSP_FEATURE_DIGIT_DETECT;
 		}
 #endif
 	}

Modified: trunk/include/asterisk/dsp.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/dsp.h?view=diff&rev=110161&r1=110160&r2=110161
==============================================================================
--- trunk/include/asterisk/dsp.h (original)
+++ trunk/include/asterisk/dsp.h Wed Mar 19 17:25:34 2008
@@ -25,7 +25,7 @@
 
 #define DSP_FEATURE_SILENCE_SUPPRESS	(1 << 0)
 #define DSP_FEATURE_BUSY_DETECT		(1 << 1)
-#define DSP_FEATURE_DTMF_DETECT		(1 << 3)
+#define DSP_FEATURE_DIGIT_DETECT	(1 << 3)
 #define DSP_FEATURE_FAX_DETECT		(1 << 4)
 
 #define	DSP_DIGITMODE_DTMF			0				/*!< Detect DTMF digits */

Modified: trunk/main/dsp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/dsp.c?view=diff&rev=110161&r1=110160&r2=110161
==============================================================================
--- trunk/main/dsp.c (original)
+++ trunk/main/dsp.c Wed Mar 19 17:25:34 2008
@@ -814,9 +814,9 @@
 {
 	int res = 0;
 	
-	if ((dsp->features & DSP_FEATURE_DTMF_DETECT) && (dsp->digitmode & DSP_DIGITMODE_MF))
+	if ((dsp->features & DSP_FEATURE_DIGIT_DETECT) && (dsp->digitmode & DSP_DIGITMODE_MF))
 		res = mf_detect(&dsp->digit_state, s, len, dsp->digitmode & DSP_DIGITMODE_RELAXDTMF, writeback);
-	else if (dsp->features & DSP_FEATURE_DTMF_DETECT)
+	else if (dsp->features & DSP_FEATURE_DIGIT_DETECT)
 		res = dtmf_detect(&dsp->digit_state, s, len, dsp->digitmode & DSP_DIGITMODE_RELAXDTMF, writeback);
 
 	if ((dsp->features & DSP_FEATURE_FAX_DETECT) && (dsp->faxmode & DSP_FAXMODE_DETECT_CNG)) {
@@ -1278,7 +1278,7 @@
 		ast_debug(1, "Requesting Hangup because the busy tone was detected on channel %s\n", chan->name);
 		return &dsp->f;
 	}
-	if (((dsp->features & DSP_FEATURE_DTMF_DETECT) || (dsp->features & DSP_FEATURE_FAX_DETECT))) {
+	if (((dsp->features & DSP_FEATURE_DIGIT_DETECT) || (dsp->features & DSP_FEATURE_FAX_DETECT))) {
 		digit = __ast_dsp_digitdetect(dsp, shortdata, len, &writeback);
 #if 0
 		if (digit)




More information about the asterisk-commits mailing list