aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-17 12:59:59 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-04-17 12:59:59 +0000
commit7dc54efa24a8996076e1c6615d1b92b58251daed (patch)
tree03064cb6596bd7a6236c0fddbb789acc8f08b7c3 /res/res_agi.c
parent644dc9b6797325fd41a63e3ad14f24f108c16807 (diff)
Merged revisions 114196 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r114196 | tilghman | 2008-04-17 07:59:04 -0500 (Thu, 17 Apr 2008) | 16 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.0@114197 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-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 93d6684d7..cd3bc2a2e 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -714,6 +714,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 */
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);
}
@@ -2668,6 +2670,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;