[asterisk-bugs] [Asterisk 0018935]: [patch] HANGUP is not sent to AGI in time

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Apr 7 08:57:42 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18935 
====================================================================== 
Reported By:                nvitaly
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18935
Category:                   Resources/res_agi
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.6.2.17 
JIRA:                       SWP-3216 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-03-07 12:08 CST
Last Modified:              2011-04-07 08:57 CDT
====================================================================== 
Summary:                    [patch] HANGUP is not sent to AGI in time
Description: 
I have IVR application that request PIN from customer. If customer hangup
during prompt request, asterisk sends empty response to AGI, then according
to dialplan it re-ask PIN few times, always getting empty response since
channel is down, Playbacks end up with:
[Mar  7 12:49:57] WARNING[23939]: app_playback.c:471 playback_exec:
ast_streamfile failed on SIP/ivrin-00000001 for ss-pininvalid

And only after some time (from few second to the minute) asterisk sends
HANGUP to AGI client.

It used to be instant in Asterisk 1.6.2.11

Attaching SIP/AGI debug info.
Let me know if you need more tests.

======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0017954 Peer does not hang up when caller hangu...
====================================================================== 

---------------------------------------------------------------------- 
 (0133503) astmiv (reporter) - 2011-04-07 08:57
 https://issues.asterisk.org/view.php?id=18935#c133503 
---------------------------------------------------------------------- 
With the attached php script (agi_does_not_detect_hangup_test1.php) this
problem can be reproduced on a SIP channel. I do not have other channels
currently available to test on.

dialplan example:
[default]
exten 100,1,AGI(agi_does_not_detect_hangup_test1.php)

Open a CLI (verbose 50) and from a sip client dial 100 and hangup. Watch
CLI it will continue looping.
This is visible in 1.8.3.2 and trunk.

As far as I could find the problem is in asterisk/res/res_agi.c in
function agi_result run_agi on the line "c = ast_waitfor_nandfds(&chan,
dead ? 0 : 1, &agi->ctrl, 1, NULL, &outfd, &ms);" The call to this function
never returns. It does not detect that the SIP channel is gone because the
poll/select used by the function only listens to events POLLIN | POLLPRI
and has a very long timeout (ms=-1). When an UDP connection is hungup these
events are never triggerd. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-07 08:57 astmiv         Note Added: 0133503                          
======================================================================




More information about the asterisk-bugs mailing list