[asterisk-commits] alecdavis: branch 1.6.2 r235775 - /branches/1.6.2/main/dsp.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sun Dec 20 02:58:25 CST 2009
Author: alecdavis
Date: Sun Dec 20 02:58:22 2009
New Revision: 235775
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235775
Log:
restarts busydetector (if enabled) when DTMF is received after call is bridged.
(closes issue #16389)
Reported by: alecdavis
Tested by: alecdavis
Patch
dtmf_busydetector.diff2.txt uploaded by alecdavis (license 585)
Modified:
branches/1.6.2/main/dsp.c
Modified: branches/1.6.2/main/dsp.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/dsp.c?view=diff&rev=235775&r1=235774&r2=235775
==============================================================================
--- branches/1.6.2/main/dsp.c (original)
+++ branches/1.6.2/main/dsp.c Sun Dec 20 02:58:22 2009
@@ -1385,8 +1385,8 @@
}
}
- if ((dsp->features & DSP_FEATURE_DIGIT_DETECT)) {
- if ((dsp->digitmode & DSP_DIGITMODE_MF))
+ if (dsp->features & (DSP_FEATURE_DIGIT_DETECT | DSP_FEATURE_BUSY_DETECT)) {
+ if (dsp->digitmode & DSP_DIGITMODE_MF)
digit = mf_detect(dsp, &dsp->digit_state, shortdata, len, (dsp->digitmode & DSP_DIGITMODE_NOQUELCH) == 0, (dsp->digitmode & DSP_DIGITMODE_RELAXDTMF));
else
digit = dtmf_detect(dsp, &dsp->digit_state, shortdata, len, (dsp->digitmode & DSP_DIGITMODE_NOQUELCH) == 0, (dsp->digitmode & DSP_DIGITMODE_RELAXDTMF));
@@ -1398,15 +1398,18 @@
if (!dsp->dtmf_began) {
/* We have not reported DTMF_BEGIN for anything yet */
- event = AST_FRAME_DTMF_BEGIN;
- event_digit = dsp->digit_state.digits[0];
+ if (dsp->features & DSP_FEATURE_DIGIT_DETECT) {
+ event = AST_FRAME_DTMF_BEGIN;
+ event_digit = dsp->digit_state.digits[0];
+ }
dsp->dtmf_began = 1;
} else if (dsp->digit_state.current_digits > 1 || digit != dsp->digit_state.digits[0]) {
/* Digit changed. This means digit we have reported with DTMF_BEGIN ended */
-
- event = AST_FRAME_DTMF_END;
- event_digit = dsp->digit_state.digits[0];
+ if (dsp->features & DSP_FEATURE_DIGIT_DETECT) {
+ event = AST_FRAME_DTMF_END;
+ event_digit = dsp->digit_state.digits[0];
+ }
memmove(dsp->digit_state.digits, dsp->digit_state.digits + 1, dsp->digit_state.current_digits);
dsp->digit_state.current_digits--;
dsp->dtmf_began = 0;
@@ -1415,6 +1418,7 @@
/* Reset Busy Detector as we have some confirmed activity */
memset(dsp->historicsilence, 0, sizeof(dsp->historicsilence));
memset(dsp->historicnoise, 0, sizeof(dsp->historicnoise));
+ ast_debug(1, "DTMF Detected - Reset busydetector\n");
}
}
More information about the asterisk-commits
mailing list