Index: apps/app_exec.c =================================================================== --- apps/app_exec.c (revision 17446) +++ apps/app_exec.c (working copy) @@ -71,7 +71,8 @@ /* Check and parse arguments */ if (data) { - if ((s = ast_strdupa(data))) { + s = ast_strdupa((char *)data); + if (s) { appname = strsep(&s, "("); if (s) { endargs = strrchr(s, ')'); @@ -82,18 +83,24 @@ if (appname) { app = pbx_findapp(appname); if (app) { - res = pbx_exec(chan, app, args); + res = pbx_exec(chan, app, args, 1); + pbx_builtin_setvar_helper(chan, "RESULT", res?"FAILED":"SUCCESS"); } else { ast_log(LOG_WARNING, "Could not find application (%s)\n", appname); - res = -1; + pbx_builtin_setvar_helper(chan, "RESULT", "NOAPP"); } + } else { + ast_log(LOG_WARNING, "No application specified!\n"); + pbx_builtin_setvar_helper(chan, "RESULT", "NOAPP"); } - } else - res = -1; + } else { + ast_log(LOG_ERROR, "Out of memory\n"); + pbx_builtin_setvar_helper(chan, "RESULT", "NOMEMORY"); + } } LOCAL_USER_REMOVE(u); - return res; + return 0; } int unload_module(void)