mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-18 15:49:56 +00:00
bug #8076 check option_debug before printing to debug channel.
patch provided in bugnote, with minor changes. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user