[asterisk-bugs] [Asterisk 0014185]: [patch] Setting registration expiry in registration string does not work

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Jan 21 03:28:51 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14185 
====================================================================== 
Reported By:                Nick_Lewis
Assigned To:                otherwiseguy
====================================================================== 
Project:                    Asterisk
Issue ID:                   14185
Category:                   Channels/chan_sip/Registration
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     ready for testing
Target Version:             1.6.2
Asterisk Version:           1.6.0 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-01-07 05:09 CST
Last Modified:              2009-01-21 03:28 CST
====================================================================== 
Summary:                    [patch] Setting registration expiry in registration
string does not work
Description: 
In some applications it is necessary for an asterisk pbx to have very short
registrations with a voip trunk provider if for example the asterisk pbx is
behind a nat firewall and the provider does not provide other udp binding
keep alive mechanisms.

According to sip.conf the format for the registration string is
[transport://]user[:secret[:authuser]]@host[:port][/contact][~expiry]
so that it should be possible to set a shorter registration by appending a
~ and an expiry value e.g. http://bugs.digium.com/view.php?id=22#c60 for a one
minute registration

However the chan_sip.c code does not seem to make use of the [~expiry]
portion so the default expiry value is always used for all registration
strings.


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

---------------------------------------------------------------------- 
 (0098304) Nick_Lewis (reporter) - 2009-01-21 03:28
 http://bugs.digium.com/view.php?id=14185#c98304 
---------------------------------------------------------------------- 
I did not check whether the ~expiry option was in the documentation for
1.6.0 but it was in the log message giving the correct format of the
registration string if a parsing error is encountered.

The patch was originally against 1.6.0 but I redid it to work on HEAD as
of the 2009-01-12.

I have now looked at the original implementation of ~expiry in 1.6.1 and
have some concerns with it. The main one is that it does not comply with
rfc3261 as it lets the UAS determine the value of the Expire header in the
REGISTER message after the first registration. The UAC should always be in
control of this. That is why in my patch there is reg->expiryrequest
separate from reg->expiry that always contains the configured value. Only
reg->expiry is negotiated between UAC and UAS.

Thanks for the clarification of the if braces and enhancements to the
patch 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-21 03:28 Nick_Lewis     Note Added: 0098304                          
======================================================================




More information about the asterisk-bugs mailing list