aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_monitor.c
diff options
context:
space:
mode:
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);
}