[svn-commits] trunk r30337 - /trunk/res/res_agi.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu May 25 12:01:27 MST 2006


Author: russell
Date: Thu May 25 14:01:26 2006
New Revision: 30337

URL: http://svn.digium.com/view/asterisk?rev=30337&view=rev
Log:
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)

Modified:
    trunk/res/res_agi.c

Modified: trunk/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_agi.c?rev=30337&r1=30336&r2=30337&view=diff
==============================================================================
--- trunk/res/res_agi.c (original)
+++ trunk/res/res_agi.c Thu May 25 14:01:26 2006
@@ -90,6 +90,9 @@
 "  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 @@
 	}
 	/* 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;



More information about the svn-commits mailing list