[asterisk-bugs] [Asterisk 0013711]: AGI-program receives SIGHUP on hangup although AGISIGHUP is set to "no"

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Dec 22 17:27:33 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13711 
====================================================================== 
Reported By:                fmueller
Assigned To:                svnbot
====================================================================== 
Project:                    Asterisk
Issue ID:                   13711
Category:                   Resources/res_agi
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Asterisk Version:           1.6.0 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
Resolution:                 fixed
Fixed in Version:           
====================================================================== 
Date Submitted:             2008-10-15 17:23 CDT
Last Modified:              2008-12-22 17:27 CST
====================================================================== 
Summary:                    AGI-program receives SIGHUP on hangup although
AGISIGHUP is set to "no"
Description: 
I added a LOG_WARNING message to res_agi.c:

if (needhup) {
	needhup = 0;
	dead = 1;
	if (pid > -1) {
                ast_log(LOG_WARNING, "this is executed\n");
		kill(pid, SIGHUP);
	} else if (agi->fast) {
		send(agi->ctrl, "HANGUP\n", 7, MSG_OOB);
	}
}

I have this AGI-program:

#include <stdio.h>
int main(int argc, char *argv[])
{
        int i;
        for (i=0; i<50; i++) {
                fprintf(stderr, "message %d\n", i);
                sleep(1);
        }
        return 0;
}

I call it and hangup while it is writing the messages to the CLI. This is
written to the CLI:

*CLI>   == Using SIP RTP CoS mark 5
    -- Executing [69 at default:1] Answer("SIP/222-0822f9c0", "") in new
stack
    -- Executing [69 at default:2] Set("SIP/222-0822f9c0", "AGISIGHUP="no"")
in new stack
    -- Executing [69 at default:3] AGI("SIP/222-0822f9c0", "test") in new
stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/test
message 0
message 1
[Oct 16 00:18:09] WARNING[7980]: res_agi.c:2639 run_agi: this is executed
    -- <SIP/222-0822f9c0>AGI Script test completed, returning -1

*CLI> 

Obviously the AGI-program receives SIGHUP when I hangup. But because
AGISIGHUP is set to "no" the AGI-program should not reveice that signal
according to the documentation (core show application agi).

Tested version is Asterisk 1.6.0.1.
====================================================================== 

---------------------------------------------------------------------- 
 (0096866) svnbot (reporter) - 2008-12-22 17:27
 http://bugs.digium.com/view.php?id=13711#c96866 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 166472

_U  branches/1.6.1/
U   branches/1.6.1/res/res_agi.c

------------------------------------------------------------------------
r166472 | mmichelson | 2008-12-22 17:27:32 -0600 (Mon, 22 Dec 2008) | 19
lines

Merged revisions 166470 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r166470 | mmichelson | 2008-12-22 17:25:34 -0600 (Mon, 22 Dec 2008) | 11
lines

Always use the value of the AGISIGHUP when running an AGI.

Prior to this patch, the value of AGISIGUP was not always
honored when set on a channel.

(closes issue http://bugs.digium.com/view.php?id=13711)
Reported by: fmueller
Patches:
      13711.patch uploaded by putnopvut (license 60)


........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=166472 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-12-22 17:27 svnbot         Checkin                                      
2008-12-22 17:27 svnbot         Note Added: 0096866                          
======================================================================




More information about the asterisk-bugs mailing list