[asterisk-dev] 'sip unregister devicename' device unavaiable 25/3600 seconds

Alec Davis sivad.a at paradise.net.nz
Wed May 20 23:14:48 CDT 2009


Another idea, to prevent this cycling effect, due to a stale event in the
schedule list.
 
Is to sanity check the event ID within expire-register against the expected
peer->expire event ID, if they don't match then it's stale and ignore, post
a console warning that they don't match, so the buggy code can be rectified.
 
Anyone have other thoughts on this?
 
Alec Davis
 
  _____  

From: asterisk-dev-bounces at lists.digium.com
[mailto:asterisk-dev-bounces at lists.digium.com] On Behalf Of Alec Davis
Sent: Tuesday, 19 May 2009 10:29 p.m.
To: 'Asterisk Developers Mailing List'
Subject: [asterisk-dev] 'sip unregister devicename' device unavaiable
25/3600 seconds


The 3600 in the subject assumes a sip registration period of 60 minutes.
 
refer https://issues.asterisk.org/view.php?id=15118
 
The testing and reporting of the bug was done with a Grandstream BT100, but
it is no way a reflection on Grandstream.
 
The reported 25 seconds of available time is a combination of the 10 seconds
chan_sip adds to the requested expiry period, and the 15 seconds that
Grandstream re-Registers before the expire time.
 
For testing, I used a register expire period of 60 seconds. Configured
either in sip.conf as maxexpiry=60 in the [general] section or set the
phone's parameter.
 
The fault is that a stale expire_register schedule is left in the scheduler,
and expires 25 seconds after the device adds a new fresh expire schedule,
due to expire in 70 seconds...
 
If a device has a re-register time of 3600 seconds, the phone is unavailable
for 3575 seconds in every 3600.!!!
 
There are 2 patches:
1st targets the sip_unregister problem directly, its removes the current
active expire_register callback scheduled event.
 
The 2nd is more general and may be over kill, it removes if present the
event that called expire_register, most of the time it's already gone.
 
A last thought, sure the cause was buggy sip_unregister, but what about the
concept of instead of using ast_sched_add when the phone registers, use
ast_sched_replace, where it would replace an existing expire_register id, or
if not found, would add a new event.
 
Alec Davis.
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20090521/d262fee1/attachment.htm 


More information about the asterisk-dev mailing list