diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-25 19:01:26 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-25 19:01:26 +0000 |
commit | d54f8741c7e8a2ac35f33bead2b73dbc0b92fa2f (patch) | |
tree | 818595d2299f3d4d37de23606413f177b36b6d3f /res | |
parent | 04a4a825d5e8df3e1e49df6a989a798da16e9064 (diff) |
allow setting a channel variable to disable sending SIGHUP to the AGI process
(issue #6491, original patch by juggie, channel variable patch by corydon,
committed patch modified to change variable name and update documentation)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30337 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index 7c7e5cee5..d4588fa05 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -90,6 +90,9 @@ static char *descrip = " This channel will stop dialplan execution on hangup inside of this\n" "application, except when using DeadAGI. Otherwise, dialplan execution\n" "will continue normally.\n" +" A locally executed AGI script will receive SIGHUP on hangup from the channel\n" +"except when using DeadAGI. This can be disabled by setting the AGISIGHUP channel\n" +"variable to \"no\" before executing the AGI application.\n" " Using 'EAGI' provides enhanced AGI, with incoming audio available out of band\n" "on file descriptor 3\n\n" " Use the CLI command 'show agi' to list available agi commands\n" @@ -1858,8 +1861,11 @@ static enum agi_result run_agi(struct ast_channel *chan, char *request, AGI *agi } /* Notify process */ if (pid > -1) { - if (kill(pid, SIGHUP)) - ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno)); + const char *sighup = pbx_builtin_getvar_helper(chan, "AGISIGHUP"); + if (ast_strlen_zero(sighup) || !ast_false(sighup)) { + if (kill(pid, SIGHUP)) + ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno)); + } } fclose(readf); return returnstatus; |