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: https://origsvn.digium.com/svn/asterisk/trunk@30337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Russell Bryant 20 years ago
parent 238cdb249f
commit 26271fbd3a

@ -90,6 +90,9 @@ static char *descrip =
" This channel will stop dialplan execution on hangup inside of this\n" " This channel will stop dialplan execution on hangup inside of this\n"
"application, except when using DeadAGI. Otherwise, dialplan execution\n" "application, except when using DeadAGI. Otherwise, dialplan execution\n"
"will continue normally.\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" " Using 'EAGI' provides enhanced AGI, with incoming audio available out of band\n"
"on file descriptor 3\n\n" "on file descriptor 3\n\n"
" Use the CLI command 'show agi' to list available agi commands\n" " Use the CLI command 'show agi' to list available agi commands\n"
@ -1858,9 +1861,12 @@ static enum agi_result run_agi(struct ast_channel *chan, char *request, AGI *agi
} }
/* Notify process */ /* Notify process */
if (pid > -1) { if (pid > -1) {
const char *sighup = pbx_builtin_getvar_helper(chan, "AGISIGHUP");
if (ast_strlen_zero(sighup) || !ast_false(sighup)) {
if (kill(pid, SIGHUP)) if (kill(pid, SIGHUP))
ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno)); ast_log(LOG_WARNING, "unable to send SIGHUP to AGI process %d: %s\n", pid, strerror(errno));
} }
}
fclose(readf); fclose(readf);
return returnstatus; return returnstatus;
} }

Loading…
Cancel
Save