diff options
author | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-03 15:53:07 +0000 |
---|---|---|
committer | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-03 15:53:07 +0000 |
commit | 4a1aaf52ae4189e660ad57ba69253f54603a2beb (patch) | |
tree | 27a80e26cf8f6ea1728ab5b2b8cc7573fd9f7cdc /main/dsp.c | |
parent | 1bd1494da59a95dce73628aafc4ba892036b82b2 (diff) |
bug #8076 check option_debug before printing to debug channel.
patch provided in bugnote, with minor changes.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@44253 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/dsp.c')
-rw-r--r-- | main/dsp.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/main/dsp.c b/main/dsp.c index 2992031b4..12ffaaf42 100644 --- a/main/dsp.c +++ b/main/dsp.c @@ -59,6 +59,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/ulaw.h" #include "asterisk/alaw.h" #include "asterisk/utils.h" +#include "asterisk/options.h" /*! Number of goertzels for progress detect */ enum gsamp_size { @@ -1335,8 +1336,10 @@ int ast_dsp_busydetect(struct ast_dsp *dsp) } #endif #if 1 - if (res) - ast_log(LOG_DEBUG, "ast_dsp_busydetect detected busy, avgtone: %d, avgsilence %d\n", avgtone, avgsilence); + if (res) { + if (option_debug) + ast_log(LOG_DEBUG, "ast_dsp_busydetect detected busy, avgtone: %d, avgsilence %d\n", avgtone, avgsilence); + } #endif return res; } @@ -1470,7 +1473,8 @@ struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, memset(&dsp->f, 0, sizeof(dsp->f)); dsp->f.frametype = AST_FRAME_CONTROL; dsp->f.subclass = AST_CONTROL_BUSY; - ast_log(LOG_DEBUG, "Requesting Hangup because the busy tone was detected on channel %s\n", chan->name); + if (option_debug) + ast_log(LOG_DEBUG, "Requesting Hangup because the busy tone was detected on channel %s\n", chan->name); return &dsp->f; } if ((dsp->features & DSP_FEATURE_DTMF_DETECT)) { @@ -1655,7 +1659,8 @@ void ast_dsp_set_busy_pattern(struct ast_dsp *dsp, int tonelength, int quietleng { dsp->busy_tonelength = tonelength; dsp->busy_quietlength = quietlength; - ast_log(LOG_DEBUG, "dsp busy pattern set to %d,%d\n", tonelength, quietlength); + if (option_debug) + ast_log(LOG_DEBUG, "dsp busy pattern set to %d,%d\n", tonelength, quietlength); } void ast_dsp_digitreset(struct ast_dsp *dsp) |