Rename DSP_FEATURE_DTMF_DETECT, because we are *NOT* only detecting DTMF digits.
authorJason Parker <jparker@digium.com>
Wed, 19 Mar 2008 22:25:34 +0000 (22:25 +0000)
committerJason Parker <jparker@digium.com>
Wed, 19 Mar 2008 22:25:34 +0000 (22:25 +0000)
This was very misleading.

Early cleanup for issue #11968

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@110161 65c4cc65-6c06-0410-ace0-fbb531ad65f3

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

index 2b1ef51..10ef7e1 100644 (file)
@@ -1053,7 +1053,7 @@ static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const c
                /* 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;
index 70cf0c4..f18dac3 100644 (file)
@@ -1511,7 +1511,7 @@ static struct ast_channel *mgcp_new(struct mgcp_subchannel *sub, int state)
                        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 {
index 1a5d671..b09c11e 100644 (file)
@@ -2154,9 +2154,9 @@ static int read_config(struct chan_list *ch, int orig)
                        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 @@ static int misdn_set_opt_exec(struct ast_channel *chan, void *data)
                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);
        }
index 55e3362..dbdc20f 100644 (file)
@@ -5317,7 +5317,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
 
        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 @@ static int sip_dtmfmode(struct ast_channel *chan, void *data)
        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) {
index 8898341..effd5cc 100644 (file)
@@ -3703,7 +3703,7 @@ static void disable_dtmf_detect(struct zt_pvt *p)
        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 @@ static void enable_dtmf_detect(struct zt_pvt *p)
        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 @@ static struct ast_channel *zt_new(struct zt_pvt *i, int state, int startpbx, int
                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
        }
index c1a3670..b8e21b4 100644 (file)
@@ -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 */
index 92d9a57..8e16567 100644 (file)
@@ -814,9 +814,9 @@ static int __ast_dsp_digitdetect(struct ast_dsp *dsp, short *s, int len, int *wr
 {
        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 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
                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)