diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-26 22:14:21 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-26 22:14:21 +0000 |
commit | a9a2a75c3d42f16c5c978bc59da04a21ac4ae30c (patch) | |
tree | 9756b40ee606e5a234a90d17361e0ff85be326b4 /apps/app_exec.c | |
parent | 8a2e9c134d6517e7f1c1e078b88fda99ac17c482 (diff) |
Make 'else' argument to ExecIf optional. Clean up the description and usage text a bit.
Closes issue #11564, patch by pnlarsson (with some extra cleanup by me).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94814 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_exec.c')
-rw-r--r-- | apps/app_exec.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/app_exec.c b/apps/app_exec.c index 83755a8f9..441e81458 100644 --- a/apps/app_exec.c +++ b/apps/app_exec.c @@ -77,9 +77,9 @@ static char *tryexec_descrip = static char *app_execif = "ExecIf"; static char *execif_synopsis = "Executes dialplan application, conditionally"; static char *execif_descrip = -" ExecIF (<expr>?<app>(<data>):<app2>(<data2>))\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" +" ExecIF (<expr>?<appiftrue>(<args>)[:<appiffalse>(<args>)])\n" +"If <expr> is true, execute and return the result of <appiftrue>(<args>).\n" +"If <expr> is true, but <appiftrue> is not found, then the application\n" "will return a non-zero value.\n"; static int exec_exec(struct ast_channel *chan, void *data) @@ -162,7 +162,7 @@ static int execif_exec(struct ast_channel *chan, void *data) AST_NONSTANDARD_APP_ARGS(expr, parse, '?'); if (ast_strlen_zero(expr.remainder)) { - ast_log(LOG_ERROR, "Usage: ExecIf(<cond>?<appiftrue>(<args>):<appiffalse>(<args))\n"); + ast_log(LOG_ERROR, "Usage: ExecIf(<expr>?<appiftrue>(<args>)[:<appiffalse>(<args)])\n"); return -1; } @@ -187,8 +187,8 @@ static int execif_exec(struct ast_channel *chan, void *data) ast_log(LOG_WARNING, "Could not find application! (%s)\n", apps.t); res = -1; } - } else { - if (!ast_strlen_zero(apps.f) && (app = pbx_findapp(apps.f))) { + } else if (!ast_strlen_zero(apps.f)) { + if ((app = pbx_findapp(apps.f))) { res = pbx_exec(chan, app, S_OR(falsedata, "")); } else { ast_log(LOG_WARNING, "Could not find application! (%s)\n", apps.f); |