From f3aed9e155e5c47fe431374214f1b9093eaa3b37 Mon Sep 17 00:00:00 2001 From: mnick Date: Fri, 4 Dec 2009 15:46:46 +0000 Subject: Merged revisions 233046 via svnmerge from https://origsvn.digium.com/svn/asterisk/trunk ................ r233046 | mnick | 2009-12-04 09:38:33 -0600 (Fri, 04 Dec 2009) | 17 lines Merged revisions 233014 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r233014 | mnick | 2009-12-04 09:17:03 -0600 (Fri, 04 Dec 2009) | 11 lines Warning message gets displayed only once Added additional field 'int display_inband_dtmf_warning', which when set to '1' displays the warning ('Inband DTMF is not supported on codec %s. Use RFC2833'), and when set to '0' doesn't display the warning. Otherwise you would get hundreds of warnings every second. (closes issue #15769) Reported by: falves11 Patches: patch_15769_14.txt uploaded by mnick (license 874) Tested by: mnick, falves11 ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@233047 f38db490-d61c-443f-a65b-d21fe96a405b --- main/dsp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/dsp.c b/main/dsp.c index 5cdfc6161..7d7755140 100644 --- a/main/dsp.c +++ b/main/dsp.c @@ -342,6 +342,7 @@ struct ast_dsp { int digitmode; int faxmode; int thinkdigit; + int display_inband_dtmf_warning; float genergy; digit_detect_state_t digit_state; tone_detect_state_t cng_tone_state; @@ -1233,7 +1234,10 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, shortdata[x] = AST_ALAW(odata[x]); break; default: - ast_log(LOG_WARNING, "Inband DTMF is not supported on codec %s. Use RFC2833\n", ast_getformatname(af->subclass)); + /*Display warning only once. Otherwise you would get hundreds of warnings every second */ + if (dsp->display_inband_dtmf_warning) + ast_log(LOG_WARNING, "Inband DTMF is not supported on codec %s. Use RFC2833\n", ast_getformatname(af->subclass)); + dsp->display_inband_dtmf_warning = 0; return af; } silence = __ast_dsp_silence(dsp, shortdata, len, NULL); @@ -1388,6 +1392,7 @@ struct ast_dsp *ast_dsp_new(void) dsp->faxmode = DSP_FAXMODE_DETECT_CNG; /* Initialize digit detector */ ast_digit_detect_init(&dsp->digit_state, dsp->digitmode & DSP_DIGITMODE_MF); + dsp->display_inband_dtmf_warning = 1; /* Initialize initial DSP progress detect parameters */ ast_dsp_prog_reset(dsp); /* Initialize fax detector */ -- cgit v1.2.3