From 4a1aaf52ae4189e660ad57ba69253f54603a2beb Mon Sep 17 00:00:00 2001 From: mogorman Date: Tue, 3 Oct 2006 15:53:07 +0000 Subject: 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 --- channels/chan_skinny.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'channels/chan_skinny.c') diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 232bfd1ca..57fb071e8 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -2297,7 +2297,8 @@ static void *skinny_ss(void *data) timeout = matchdigittimeout; } } else if (res == 0) { - ast_log(LOG_DEBUG, "Not enough digits (and no ambiguous match)...\n"); + if (option_debug) + ast_log(LOG_DEBUG, "Not enough digits (and no ambiguous match)...\n"); transmit_tone(s, SKINNY_REORDER); ast_hangup(c); return NULL; @@ -2384,7 +2385,8 @@ static int skinny_hangup(struct ast_channel *ast) struct skinnysession *s; if (!sub) { - ast_log(LOG_DEBUG, "Asked to hangup channel not connected\n"); + if (option_debug) + ast_log(LOG_DEBUG, "Asked to hangup channel not connected\n"); return 0; } l = sub->parent; @@ -2487,7 +2489,8 @@ static struct ast_frame *skinny_rtp_read(struct skinny_subchannel *sub) /* We already hold the channel lock */ if (f->frametype == AST_FRAME_VOICE) { if (f->subclass != ast->nativeformats) { - ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass); + if (option_debug) + ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass); ast->nativeformats = f->subclass; ast_set_read_format(ast, ast->readformat); ast_set_write_format(ast, ast->writeformat); @@ -3161,7 +3164,8 @@ static int handle_stimulus_message(struct skinny_req *req, struct skinnysession ast_setstate(sub->owner, AST_STATE_UP); } else { if (sub && sub->owner) { - ast_log(LOG_DEBUG, "Current subchannel [%s] already has owner\n", sub->owner->name); + if (option_debug) + ast_log(LOG_DEBUG, "Current subchannel [%s] already has owner\n", sub->owner->name); } else { c = skinny_new(l, AST_STATE_DOWN); if(c) { @@ -3237,7 +3241,8 @@ static int handle_offhook_message(struct skinny_req *req, struct skinnysession * ast_setstate(sub->owner, AST_STATE_UP); } else { if (sub && sub->owner) { - ast_log(LOG_DEBUG, "Current sub [%s] already has owner\n", sub->owner->name); + if (option_debug) + ast_log(LOG_DEBUG, "Current sub [%s] already has owner\n", sub->owner->name); } else { c = skinny_new(l, AST_STATE_DOWN); if(c) { -- cgit v1.2.3