summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-05-05 14:47:22 +0000
committerRussell Bryant <russell@russellbryant.com>2006-05-05 14:47:22 +0000
commit110a0aa803fa2bc9f61a1df91be77e8bd4cfecb6 (patch)
treec8221f15025d5f7a3bbdfabd1d79eacc8edf55e6
parentf4f7b746550e80a7fd5bcb63b4e5d0fe8a3716b8 (diff)
Merged revisions 24837 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r24837 | russell | 2006-05-05 10:44:50 -0400 (Fri, 05 May 2006) | 3 lines 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/trunk@24838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--apps/app_macro.c2
-rw-r--r--apps/app_while.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c
index fb3290fc1..b09df9528 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -326,7 +326,7 @@ static int macroif_exec(struct ast_channel *chan, void *data)
*label_b = '\0';
label_b++;
}
- if (ast_true(expr))
+ if (pbx_checkcondition(expr))
macro_exec(chan, label_a);
else if (label_b)
macro_exec(chan, label_b);
diff --git a/apps/app_while.c b/apps/app_while.c
index 5cdb87db3..7af5f31c0 100644
--- a/apps/app_while.c
+++ b/apps/app_while.c
@@ -111,7 +111,7 @@ static int execif_exec(struct ast_channel *chan, void *data) {
} else
mydata = "";
- if (ast_true(expr)) {
+ if (pbx_checkcondition(expr)) {
if ((app = pbx_findapp(myapp))) {
res = pbx_exec(chan, app, mydata);
} else {
@@ -277,12 +277,12 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
}
- if ((!end && !ast_true(condition)) || (end == 2)) {
+ if ((!end && !pbx_check_condition(condition)) || (end == 2)) {
/* Condition Met (clean up helper vars) */
const char *goto_str;
pbx_builtin_setvar_helper(chan, varname, NULL);
pbx_builtin_setvar_helper(chan, my_name, NULL);
- snprintf(end_varname,VAR_SIZE,"END_%s",varname);
+ snprintf(end_varname,VAR_SIZE,"END_%s",varname);
if ((goto_str=pbx_builtin_getvar_helper(chan, end_varname))) {
pbx_builtin_setvar_helper(chan, end_varname, NULL);
ast_parseable_goto(chan, goto_str);