[asterisk-bugs] [Asterisk 0010946]: chan_sip can generate several outstanding requests, but ignores responses

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Oct 18 09:00:42 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10946 
====================================================================== 
Reported By:                flefoll
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10946
Category:                   Channels/chan_sip/General
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:            1.4.11  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             10-11-2007 02:25 CDT
Last Modified:              10-18-2007 09:00 CDT
====================================================================== 
Summary:                    chan_sip can generate several outstanding requests,
but ignores responses
Description: 
chan_sip can generate several outstanding requests within a dialog. The
problem then, is that chan_sip will ignore all responses where CSeq is
lower than last outgoing CSeq, which will provoke retransmission of all
requests, except last one.

This is especially the case when chan_sip handles a REFER request and
generates NOTIFY messages towards the REFER requester : one NOTIFY is
transmitted per event during the REFER operations, without waiting for
response to previous NOTIFY's. As far as I understand, this is "BAD" but
not forbidden (see additional information).

The problem is higly related to the speed of answer of SIP devices implied
in the REFER operation.

This behaviour comes from a code section in handle_request()
[handle_incoming() in SVN trunk, but the problem seems to be the same]
after "if (req->method == SIP_RESPONSE)" :

[...] if (p->ocseq && (p->ocseq != seqno)) {
	/* ignore means "don't do anything with it" but still have to 
			   respond appropriately  */
	ignore = TRUE;
	ast_set_flag(req, SIP_PKT_IGNORE);
	ast_set_flag(req, SIP_PKT_IGNORE_RESP);
	append_history(p, "Ignore", "Ignoring this retransmit\n");
} [...]

My first idea is to remove this code, in order let handle_response() do
its work (just below). I tried and it seems to work, but I'm not 100% sure
of side-effects. Any opinions ?

====================================================================== 

---------------------------------------------------------------------- 
 flefoll - 10-18-07 09:00  
---------------------------------------------------------------------- 
I propose a patch for SVN trunk : simply delete code in handle_incoming()
that reject SIP RESPONSES with a CSeq lower that last outgoing CSeq !

Indeed, I think that if chan_sip CAN generate several outstanding
REQUESTS, if MUST accept RESPONSES with CSeq lower than last outgoing
CSeq.

We currently have a 1.4.11 patched that way, and we haven't seen any side
effect yet. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-18-07 09:00  flefoll        Note Added: 0072231                          
======================================================================




More information about the asterisk-bugs mailing list