Index: res/res_agi.c =================================================================== --- res/res_agi.c (revision 114177) +++ res/res_agi.c (working copy) @@ -346,6 +346,8 @@ execv(script, argv); /* Can't use ast_log since FD's are closed */ fprintf(stdout, "verbose \"Failed to execute '%s': %s\" 2\n", script, strerror(errno)); + /* Special case to set status of AGI to failure */ + fprintf(stdout, "failure\n"); fflush(stdout); _exit(1); } @@ -1904,6 +1906,12 @@ break; } + /* Special case for inability to execute child process */ + if (*buf && strncasecmp(buf, "failure", 7) == 0) { + returnstatus = AGI_RESULT_FAILURE; + break; + } + /* get rid of trailing newline, if any */ if (*buf && buf[strlen(buf) - 1] == '\n') buf[strlen(buf) - 1] = 0;