mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 15:08:53 +00:00
use pbx_checkcondition() instead of ast_true() to evaluate the condition
for MacroIf and WhileIf (issue #7086) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@24837 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -337,7 +337,7 @@ static int macroif_exec(struct ast_channel *chan, void *data)
|
|||||||
*label_b = '\0';
|
*label_b = '\0';
|
||||||
label_b++;
|
label_b++;
|
||||||
}
|
}
|
||||||
if (ast_true(expr))
|
if (pbx_checkcondition(expr))
|
||||||
macro_exec(chan, label_a);
|
macro_exec(chan, label_a);
|
||||||
else if (label_b)
|
else if (label_b)
|
||||||
macro_exec(chan, label_b);
|
macro_exec(chan, label_b);
|
||||||
|
@@ -103,7 +103,7 @@ static int execif_exec(struct ast_channel *chan, void *data) {
|
|||||||
} else
|
} else
|
||||||
mydata = "";
|
mydata = "";
|
||||||
|
|
||||||
if (ast_true(expr)) {
|
if (pbx_checkcondition(expr)) {
|
||||||
if ((app = pbx_findapp(myapp))) {
|
if ((app = pbx_findapp(myapp))) {
|
||||||
res = pbx_exec(chan, app, mydata, 1);
|
res = pbx_exec(chan, app, mydata, 1);
|
||||||
} else {
|
} else {
|
||||||
@@ -269,7 +269,7 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!end && !ast_true(condition)) {
|
if (!end && !pbx_check_condition(condition)) {
|
||||||
/* Condition Met (clean up helper vars) */
|
/* Condition Met (clean up helper vars) */
|
||||||
pbx_builtin_setvar_helper(chan, varname, NULL);
|
pbx_builtin_setvar_helper(chan, varname, NULL);
|
||||||
pbx_builtin_setvar_helper(chan, my_name, NULL);
|
pbx_builtin_setvar_helper(chan, my_name, NULL);
|
||||||
|
Reference in New Issue
Block a user