[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:25:44 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13711 
====================================================================== 
Reported By:                fmueller
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13711
Category:                   Resources/res_agi
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
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:              
====================================================================== 
Date Submitted:             2008-10-15 17:23 CDT
Last Modified:              2008-12-22 17:25 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0096864) svnbot (reporter) - 2008-12-22 17:25
 http://bugs.digium.com/view.php?id=13711#c96864 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 166470

U   trunk/res/res_agi.c

------------------------------------------------------------------------
r166470 | mmichelson | 2008-12-22 17:25:43 -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=166470 

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




More information about the asterisk-bugs mailing list