[asterisk-bugs] [Asterisk 0010052]: NOTIFY race condition when state changes happen very fast

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Oct 25 12:36:10 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10052 
====================================================================== 
Reported By:                raarts
Assigned To:                file
====================================================================== 
Project:                    Asterisk
Issue ID:                   10052
Category:                   Channels/chan_sip/Registration
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:            1.2.19  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             06-25-2007 08:47 CDT
Last Modified:              10-25-2007 12:36 CDT
====================================================================== 
Summary:                    NOTIFY race condition when state changes happen very
fast
Description: 
This particular problem was encountered with SNOM360 phones, but it is not
specific to it.

What happens:
- SNOM has subscribed a LED to another phone
- SNOM user dials this other phone. 
- dialplan adds an answer-after=0 SIP header.
- asterisk send INVITE to the other phone
- other phone send back RINGING, this is sent back to the SNOM as well
- asterisk send NOTIFY 'early' to the SNOM
- meanwhile, the other phone answers very quickly
- asterisk sends OK to INVITE to SNOM to indicate the other phone 
  has answered the line, and immediately after that, a NOTIFY 'confirmed'.

  At this point in time the OK to the previous NOTIFY 'early' has not 
  been sent yet by the SNOM.

Now the system is confused, because the SNOM finally sends the OK
to the NOTIFY 'early', but asterisk is only expecting an OK to the
last sent NOTIFY, and starts retrying. See attached trace.

I think asterisk should not sent a new NOTIFY. I think ideally NOTIFY's
should be queued on a per-channel basis. Or should asterisk remember
earlier



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

---------------------------------------------------------------------- 
 one47 - 10-25-07 12:36  
---------------------------------------------------------------------- 
I managed to reproduce this on a 1.4.x test box that used BLF and Page()
heavily. The box no-longer exists, so I created the fix on a 1.2.24 box,
but the code is the same in 1.2.x and 1.4.x, so the same fix should apply
to both.

Basically, if a "200 OK" takes long enough to arrive that a new notify has
already been sent, the "ignore" flag is set on the packet with the old
CSeq. Sadly, it was ignoring it a little bit too much, and did not process
the packet at-all!

Patches will be uploaded for 1.2.24 and 1.4.12. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
10-25-07 12:36  one47          Note Added: 0072514                          
======================================================================




More information about the asterisk-bugs mailing list