aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/res_agi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index caa015a7e..4370654d0 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -693,6 +693,8 @@ static enum agi_result launch_script(struct ast_channel *chan, char *script, cha
execv(script, argv);
/* Can't use ast_log since FD's are closed */
ast_child_verbose(1, "Failed to execute '%s': %s", script, strerror(errno));
+ /* Special case to set status of AGI to failure */
+ fprintf(stdout, "failure\n");
fflush(stdout);
_exit(1);
}
@@ -2646,6 +2648,12 @@ static enum agi_result run_agi(struct ast_channel *chan, char *request, AGI *agi
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;