diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-17 12:59:04 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-17 12:59:04 +0000 |
commit | 9809a31bb57ccb7efa42dd6eec6b806595dad03c (patch) | |
tree | 1102594dfc177de303f4ea727b223c8e729353f3 /res | |
parent | 3b775e41aec0a1742f5c76c6aa95ebd5b37996c4 (diff) |
Merged revisions 114195 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r114195 | tilghman | 2008-04-17 07:56:38 -0500 (Thu, 17 Apr 2008) | 8 lines
Add special case for when the agi cannot be executed, to comply with the documentation that
we return failure in that case.
(closes issue #12462)
Reported by: fmueller
Patches:
20080416__bug12462.diff.txt uploaded by Corydon76 (license 14)
Tested by: fmueller
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 8 |
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; |