[asterisk-bugs] [Asterisk 0012215]: [patch] Asterisk returns 482 Loop Detected upon receiving re-invite

Asterisk Bug Tracker noreply at bugs.digium.com
Thu May 14 17:18:04 CDT 2009


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=12215 
====================================================================== 
Reported By:                jpyle
Assigned To:                mmichelson
====================================================================== 
Project:                    Asterisk
Issue ID:                   12215
Category:                   Channels/chan_sip/General
Reproducibility:            random
Severity:                   minor
Priority:                   normal
Status:                     ready for review
Asterisk Version:           1.4.18 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2008-03-14 11:45 CDT
Last Modified:              2009-05-14 17:18 CDT
====================================================================== 
Summary:                    [patch] Asterisk returns 482 Loop Detected upon
receiving re-invite
Description: 
Asterisk sends a 482 Loop Detected upon receiving a presumably valid
re-INVITE.  Pedantic is enabled globally in sip.conf.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
duplicate of        0007403 [patch] allow SIP Spiral to work instea...
====================================================================== 

---------------------------------------------------------------------- 
 (0104788) svnbot (reporter) - 2009-05-14 17:18
 https://issues.asterisk.org/view.php?id=12215#c104788 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 194484

U   branches/1.4/channels/chan_sip.c

------------------------------------------------------------------------
r194484 | mmichelson | 2009-05-14 17:18:02 -0500 (Thu, 14 May 2009) | 24
lines

Fix a race condition where a reinvite could trigger a 482 response.

The loop detection/spiral detection code in chan_sip used the owner
channel's state as a criterion for determining if the incoming INVITE
is a looped request. The problem with this is that the INVITE-handling
code happens in a different thread than the thread that marks the owner
channel as being up. As a result, if a reinvite were to come in very
quickly,
say from another Asterisk on the same LAN, it was possible for the
reinvite
to arrive before the owner channel had been set to the up state.

This patch corrects the problem by using the invitestate of the sip_pvt
instead, since that can be guaranteed to be set correctly by the time
the reinvite arrives. Since there is a switch statement further in the
INVITE-handling code, the AST_STATE_RINGING state also checks the
invitestate
of the sip_pvt in case we should actually be treating the channel as if it
were
up already.

(closes issue https://issues.asterisk.org/view.php?id=12215)
Reported by: jpyle
Patches:
      12215_confirmed.patch uploaded by mmichelson (license 60)
Tested by: lmadsen


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=194484 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-05-14 17:18 svnbot         Note Added: 0104788                          
======================================================================




More information about the asterisk-bugs mailing list