aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_monitor.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_monitor.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_monitor.c')
-rw-r--r--res/res_monitor.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c
index b1739f977..793921b42 100644
--- a/res/res_monitor.c
+++ b/res/res_monitor.c
@@ -47,6 +47,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/app.h"
#include "asterisk/utils.h"
#include "asterisk/config.h"
+#include "asterisk/options.h"
AST_MUTEX_DEFINE_STATIC(monitorlock);
@@ -221,8 +222,9 @@ int ast_monitor_start( struct ast_channel *chan, const char *format_spec,
/* so we know this call has been monitored in case we need to bill for it or something */
pbx_builtin_setvar_helper(chan, "__MONITORED","true");
} else {
- ast_log(LOG_DEBUG,"Cannot start monitoring %s, already monitored\n",
- chan->name);
+ if (option_debug)
+ ast_log(LOG_DEBUG,"Cannot start monitoring %s, already monitored\n",
+ chan->name);
res = -1;
}
@@ -295,7 +297,8 @@ int ast_monitor_stop(struct ast_channel *chan, int need_lock)
snprintf(tmp2,sizeof(tmp2), "( %s& rm -f \"%s/%s-\"* ) &",tmp, dir ,name); /* remove legs when done mixing */
ast_copy_string(tmp, tmp2, sizeof(tmp));
}
- ast_log(LOG_DEBUG,"monitor executing %s\n",tmp);
+ if (option_debug)
+ ast_log(LOG_DEBUG,"monitor executing %s\n",tmp);
if (ast_safe_system(tmp) == -1)
ast_log(LOG_WARNING, "Execute of %s failed.\n",tmp);
}