mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +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:
@@ -41,6 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/utils.h"
|
||||
#include "asterisk/app.h"
|
||||
#include "asterisk/localtime.h"
|
||||
#include "asterisk/options.h"
|
||||
|
||||
static int function_fieldqty(struct ast_channel *chan, char *cmd,
|
||||
char *parse, char *buf, size_t len)
|
||||
@@ -126,7 +127,8 @@ static int regex(struct ast_channel *chan, char *cmd, char *parse, char *buf,
|
||||
if ((*args.str == ' ') || (*args.str == '\t'))
|
||||
args.str++;
|
||||
|
||||
ast_log(LOG_DEBUG, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str);
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str);
|
||||
|
||||
if ((errcode = regcomp(®exbuf, args.reg, REG_EXTENDED | REG_NOSUB))) {
|
||||
regerror(errcode, ®exbuf, buf, len);
|
||||
@@ -175,7 +177,8 @@ static int array(struct ast_channel *chan, char *cmd, char *var,
|
||||
* want them to be surprised by the result. Hence, we prefer commas as the
|
||||
* delimiter, but we'll fall back to vertical bars if commas aren't found.
|
||||
*/
|
||||
ast_log(LOG_DEBUG, "array (%s=%s)\n", var, value2);
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "array (%s=%s)\n", var, value2);
|
||||
if (strchr(var, ','))
|
||||
AST_NONSTANDARD_APP_ARGS(arg1, var, ',');
|
||||
else
|
||||
@@ -187,8 +190,9 @@ static int array(struct ast_channel *chan, char *cmd, char *var,
|
||||
AST_STANDARD_APP_ARGS(arg2, value2);
|
||||
|
||||
for (i = 0; i < arg1.argc; i++) {
|
||||
ast_log(LOG_DEBUG, "array set value (%s=%s)\n", arg1.var[i],
|
||||
arg2.val[i]);
|
||||
if (option_debug)
|
||||
ast_log(LOG_DEBUG, "array set value (%s=%s)\n", arg1.var[i],
|
||||
arg2.val[i]);
|
||||
if (i < arg2.argc) {
|
||||
pbx_builtin_setvar_helper(chan, arg1.var[i], arg2.val[i]);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user