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

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Oct 15 17:23:38 CDT 2008


The following issue has been SUBMITTED. 
====================================================================== 
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-10-15 17:23 CDT
====================================================================== 
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.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-10-15 17:23 fmueller       Asterisk Version          => 1.6.0           
2008-10-15 17:23 fmueller       SVN Branch (only for SVN checkouts, not tarball
releases) => N/A             
======================================================================




More information about the asterisk-bugs mailing list