[asterisk-bugs] [Asterisk 0015942]: Asterisk does not use the “expires=” from the SIP contact header during registration

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Apr 25 21:21:46 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15942 
====================================================================== 
Reported By:                tpsast
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15942
Category:                   Channels/chan_sip/Registration
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.6.1.7-rc1 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-09-22 20:36 CDT
Last Modified:              2010-04-25 21:21 CDT
====================================================================== 
Summary:                    Asterisk does not use the “expires=” from the
SIP contact header during registration
Description: 
When registering against a SIP provider, the reply from the registrar (SIP
200 OK message) includes an “expires =” in the SIP contact header, but
Asterisk always use the “defaultexpiry” value instead.

Example:
------------
Asterisk sends “Expires: 3600” when register, but if the registrar
replies with “expires=3170” in the contact header, then Asterisk always
scheduling for a reregistration in 3585 s. anyway, and therefore the
registration expires before Asterisk sends a reregister.

I have tested with Asterisk versions: 1.6.0.5, 1.6.0.3-rc1, 1.6.0.9,
1.6.1-beta4, 1.6.1.0, 1.6.1.1, 1.6.0.13, 1.6.1.4, 1.6.1.5, 1.6.1.6,
1.6.1.7-rc1 and SVN revision: 219891 (Asterisk SVN-branch-1.6.1-r219820).
The problem seems to exist in all above versions.

With Asterisk 1.6.2.0-beta3, beta4, rc1 and rc2 the registration doesn’t
work at all.
SIP/2.0 403 Forbidden 
(WARNING[3584]: chan_sip.c:17273 handle_response_register: Forbidden -
wrong password on authentication for REGISTER …)
;I will attach the debug output for the 1.6.2.0 registration problem in a
new issue!

Asterisk sip settings:
---------------------------
Global Signalling Settings:
----------------------------------
Reg. min duration: 60 secs
Reg. max duration: 4000 secs
Reg. default duration: 3600 secs

Register in sip.conf:
-------------------------
[sip-trunk]
type=peer
callbackextension=extension
defaultuser=xxxxxxxxxx
fromuser= xxxxxxxxxx
secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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

---------------------------------------------------------------------- 
 (0120879) crjw (reporter) - 2010-04-25 21:21
 https://issues.asterisk.org/view.php?id=15942#c120879 
---------------------------------------------------------------------- 
I have the same "expiry" problem with 1.6.0.1 and the latest trunk.

I can pass a recommended expiration time to my SIP provider when
registering.
This can be done by setting "defaultexpiry" or appending an expiry to the
end of a registration declaration.
e.g.
defaultexpiry=90
OR
register => xxxxxxxxxxx:xxxxxxxx:xxxx at xxxx.xxxxxx.com/xxxxxxxxxxxx~90

Using either method, if I specify a value of 90 seconds or over, my SIP
provider insists on using an expiry of 89 seconds.  That's OK.
If I specify a value of less than 90, my SIP provider insists on using an
expiry of 1 second less than what I have requested.  That's OK too.

This would be fine, except that my SIP provider specifies the expiry in
the "Contact" and "Contact Binding" fields which Asterisk appears to
ignore.
Asterisk always wants to register exactly 15 seconds prior to the value of
"defaultexpiry"

"defaultexpiry" has a default of 120.
Thus if I append a value of 90 to the registration string but do not
explicitly define defaultexpiry, the following happens.
1. Asterisk sends a register request with a requested expiry time of 90
seconds.
2. SIP provider sends back a value of 89 in the "Contact" and "Contact
Binding" fields.
3. Calls placed within 89 seconds will succeed.
3. Calls placed after 89 seconds will fail.
4. At 105 seconds after the initial registration (120-15), Asterisk will
re-register.
5. Cycle repeats. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-04-25 21:21 crjw           Note Added: 0120879                          
======================================================================




More information about the asterisk-bugs mailing list