From: Kevin P. Fleming Date: Wed, 7 Sep 2005 20:54:19 +0000 (+0000) Subject: ensure debug messages are only output if debug is enabled (issue #5142) X-Git-Tag: 1.2.0-beta2~373 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04a954ae16f02031bca091934b063ffb29b710a0;p=thirdparty%2Fasterisk.git ensure debug messages are only output if debug is enabled (issue #5142) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6539 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f14ea507d5..9527ebc934 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2142,7 +2142,9 @@ static int update_call_counter(struct sip_pvt *fup, int event) } else { *inuse = 0; } - ast_log(LOG_ERROR, "Call %s %s '%s' removed from call limit %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *call_limit); + if (option_debug > 1 || sipdebug) { + ast_log(LOG_DEBUG, "Call %s %s '%s' removed from call limit %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *call_limit); + } break; case INC_CALL_LIMIT: if (*call_limit > 0 ) { @@ -2160,7 +2162,9 @@ static int update_call_counter(struct sip_pvt *fup, int event) } } (*inuse)++; - ast_log(LOG_DEBUG, "Call %s %s '%s' is %d out of %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *inuse, *call_limit); + if (option_debug > 1 || sipdebug) { + ast_log(LOG_DEBUG, "Call %s %s '%s' is %d out of %d\n", outgoing ? "to" : "from", u ? "user":"peer", name, *inuse, *call_limit); + } break; default: ast_log(LOG_ERROR, "update_call_counter(%s, %d) called with no event!\n", name, event);