aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_skinny.c
diff options
context:
space:
mode:
authormogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-03 15:53:07 +0000
committermogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-03 15:53:07 +0000
commit4a1aaf52ae4189e660ad57ba69253f54603a2beb (patch)
tree27a80e26cf8f6ea1728ab5b2b8cc7573fd9f7cdc /channels/chan_skinny.c
parent1bd1494da59a95dce73628aafc4ba892036b82b2 (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 'channels/chan_skinny.c')
-rw-r--r--channels/chan_skinny.c15
1 files changed, 10 insertions, 5 deletions
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) {