aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_smdi.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 /res/res_smdi.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 'res/res_smdi.c')
-rw-r--r--res/res_smdi.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/res/res_smdi.c b/res/res_smdi.c
index c0c7f8927..87540e48f 100644
--- a/res/res_smdi.c
+++ b/res/res_smdi.c
@@ -112,7 +112,8 @@ int ast_smdi_mwi_set(struct ast_smdi_interface *iface, const char *mailbox)
fclose(file);
ASTOBJ_UNLOCK(iface);
- ast_log(LOG_DEBUG, "Sent MWI set message for %s on %s\n", mailbox, iface->name);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Sent MWI set message for %s on %s\n", mailbox, iface->name);
return 0;
}
@@ -143,7 +144,8 @@ int ast_smdi_mwi_unset(struct ast_smdi_interface *iface, const char *mailbox)
fclose(file);
ASTOBJ_UNLOCK(iface);
- ast_log(LOG_DEBUG, "Sent MWI unset message for %s on %s\n", mailbox, iface->name);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Sent MWI unset message for %s on %s\n", mailbox, iface->name);
return 0;
}
@@ -412,7 +414,8 @@ static void *smdi_read(void *iface_p)
/* add the message to the message queue */
md_msg->timestamp = ast_tvnow();
ast_smdi_md_message_push(iface, md_msg);
- ast_log(LOG_DEBUG, "Recieved SMDI MD message on %s\n", iface->name);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Recieved SMDI MD message on %s\n", iface->name);
ASTOBJ_UNREF(md_msg, ast_smdi_md_message_destroy);
@@ -455,7 +458,8 @@ static void *smdi_read(void *iface_p)
/* add the message to the message queue */
mwi_msg->timestamp = ast_tvnow();
ast_smdi_mwi_message_push(iface, mwi_msg);
- ast_log(LOG_DEBUG, "Recieved SMDI MWI message on %s\n", iface->name);
+ if (option_debug)
+ ast_log(LOG_DEBUG, "Recieved SMDI MWI message on %s\n", iface->name);
ASTOBJ_UNREF(mwi_msg, ast_smdi_mwi_message_destroy);
} else {