aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_while.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-29 06:18:58 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-03-29 06:18:58 +0000
commit19cfa5ca6c9d693aae8f51480f9b8c3978527924 (patch)
treeb6a1af8e30fe8bfffee01103e5a217c99e8b4b5d /apps/app_while.c
parent25212ca9e85b31af9bdb57c97a8da7868ee3b4dd (diff)
Make sure ExecIf stuff returns properly (bug #3864)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5297 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_while.c')
-rwxr-xr-xapps/app_while.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/apps/app_while.c b/apps/app_while.c
index e33bae52f..5822c2ff5 100755
--- a/apps/app_while.c
+++ b/apps/app_while.c
@@ -29,7 +29,9 @@
static char *exec_app = "ExecIf";
static char *exec_desc = " ExecIF (<expr>|<app>|<data>)\n"
-"If <expr> is true, execute and return the result of <app>(<data>)\n\n";
+"If <expr> is true, execute and return the result of <app>(<data>).\n"
+"If <expr> is true, but <app> is not found, then the application\n"
+"will return a non-zero value.";
static char *exec_synopsis = "ExecIF (<expr>|<app>|<data>)";
static char *start_app = "While";
@@ -73,8 +75,13 @@ static int execif_exec(struct ast_channel *chan, void *data) {
} else
mydata = "";
- if(ast_true(expr) && (app = pbx_findapp(myapp))) {
- res = pbx_exec(chan, app, mydata, 1);
+ if (ast_true(expr)) {
+ if ((app = pbx_findapp(myapp))) {
+ res = pbx_exec(chan, app, mydata, 1);
+ } else {
+ ast_log(LOG_WARNING, "Count not find application! (%s)\n", myapp);
+ res = -1;
+ }
}
} else {
ast_log(LOG_ERROR,"Invalid Syntax.\n");