Skip to content
Snippets Groups Projects
Commit 71ca1b54 authored by Matthias Nick's avatar Matthias Nick
Browse files

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: https://origsvn.digium.com/svn/asterisk/trunk@233046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 7768e2c6
Branches
Tags
No related merge requests found
...@@ -385,6 +385,7 @@ struct ast_dsp { ...@@ -385,6 +385,7 @@ struct ast_dsp {
int digitmode; int digitmode;
int faxmode; int faxmode;
int dtmf_began; int dtmf_began;
int display_inband_dtmf_warning;
float genergy; float genergy;
int mute_fragments; int mute_fragments;
fragment_t mute_data[5]; fragment_t mute_data[5];
...@@ -1334,7 +1335,10 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, ...@@ -1334,7 +1335,10 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp,
} }
break; break;
default: default:
ast_log(LOG_WARNING, "Inband DTMF is not supported on codec %s. Use RFC2833\n", ast_getformatname(af->subclass.codec)); /*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.codec));
dsp->display_inband_dtmf_warning = 0;
return af; return af;
} }
...@@ -1504,6 +1508,7 @@ struct ast_dsp *ast_dsp_new(void) ...@@ -1504,6 +1508,7 @@ struct ast_dsp *ast_dsp_new(void)
dsp->faxmode = DSP_FAXMODE_DETECT_CNG; dsp->faxmode = DSP_FAXMODE_DETECT_CNG;
/* Initialize digit detector */ /* Initialize digit detector */
ast_digit_detect_init(&dsp->digit_state, dsp->digitmode & DSP_DIGITMODE_MF); ast_digit_detect_init(&dsp->digit_state, dsp->digitmode & DSP_DIGITMODE_MF);
dsp->display_inband_dtmf_warning = 1;
/* Initialize initial DSP progress detect parameters */ /* Initialize initial DSP progress detect parameters */
ast_dsp_prog_reset(dsp); ast_dsp_prog_reset(dsp);
/* Initialize fax detector */ /* Initialize fax detector */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment