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

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Dec 18 14:02:07 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-18 14:02 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0096654) putnopvut (administrator) - 2008-12-18 14:02
 http://bugs.digium.com/view.php?id=13711#c96654 
---------------------------------------------------------------------- 
This change was done intentionally, the idea being that if AGISIGHUP is
set, then we should never send the SIGHUP signal under any circumstance.

Sorry for not getting back to you sooner on this. I must not have noticed
that you had asked a question of me earlier :( 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-12-18 14:02 putnopvut      Note Added: 0096654                          
======================================================================




More information about the asterisk-bugs mailing list