[asterisk-bugs] [Asterisk 0019164]: Hangup function not sending correct SIP cause code

Asterisk Bug Tracker noreply at bugs.digium.com
Tue May 10 17:54:35 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=19164 
====================================================================== 
Reported By:                vhatz
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   19164
Category:                   Channels/chan_sip/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.40 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2011-04-21 10:12 CDT
Last Modified:              2011-05-10 17:54 CDT
====================================================================== 
Summary:                    Hangup function not sending correct SIP cause code
Description: 

Test scenario is this:

SIP Client --INVITE-> Asterisk --INVITE-> SIP Peer01

Dialplan is:


[test1]
exten => _X.,1,Dial(SIP/12345 at sippeer01,,,)
 
exten => i,1,Hangup()
exten => t,1,Hangup()
exten => h,1,Hangup()

or


[test2]
exten => _X.,1,Dial(SIP/12345 at sippeer01,,,)
 
exten => i,1,Hangup()
exten => t,1,Hangup()
exten => h,1,Hangup(17) (or any cause number as an argument to the hangup
function).

or

[test3]
exten => _X.,1,Dial(SIP/12345 at sippeer01,,,)
 
exten => i,1,Hangup(${HANGUPCAUSE})
exten => t,1,Hangup(${HANGUPCAUSE})
exten => h,1,Hangup(${HANGUPCAUSE})


If the call is not accepted by sippeer01 for any reason (for example, SIP
cause 404, or 486, etc), this message is returned to Asterisk, which in
turn changes the SIP cause to 503 for all cases, even when we try to
override the cause by setting an argument manually in Hangup() in [test2]
and [test3].

SIP Client <-503-- Asterisk <-404-- SIP Peer01

It seems that the Hangup() function does not work as expected and has no
impact on the SIP cause code that is sent to the calling SIP Client,
although the packet which contains the 503 reply, also contains the
headers:

X-Asterisk-HangupCause: Unallocated (unassigned) number
X-Asterisk-HangupCauseCode: 1

which show the correct response from the remote end (404).

I believe this is a bug, as Hangup() would function as expected in
previous Asterisk versions.
====================================================================== 

---------------------------------------------------------------------- 
 (0134764) vhatz (reporter) - 2011-05-10 17:54
 https://issues.asterisk.org/view.php?id=19164#c134764 
---------------------------------------------------------------------- 
Sorry for not getting back with more feedback, there was heavy workload
during the past weeks.

To clarify, I can verify that with current Asterisk versions, the function
Hangup(<cause>) sends the appropriate <cause> if it is outside the h
extension. If the Hangup(<cause>) is in the h extension then does not send
the <cause> to the calling party but instead sends only 503 irrespective of
the reason why the remote end hang up. 

Unfortunately, it has been a very long time since I last saw 

h,1,Hangup(<cause>) 

behave as expected, so I can't remember which version was working
properly. 

I am currently testing various 1.2 versions (and some early 1.4) as time
permits to pinpoint the version which showed the desired behavior.
Hopefully I will have something soon. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-05-10 17:54 vhatz          Note Added: 0134764                          
======================================================================




More information about the asterisk-bugs mailing list