[asterisk-bugs] [Asterisk 0014198]: [patch] Not possible to register to a registrar via a host with different port number

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Jan 13 14:45:54 CST 2009


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=14198 
====================================================================== 
Reported By:                Nick_Lewis
Assigned To:                putnopvut
====================================================================== 
Project:                    Asterisk
Issue ID:                   14198
Category:                   Channels/chan_sip/Registration
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           1.6.0 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2009-01-08 08:51 CST
Last Modified:              2009-01-13 14:45 CST
====================================================================== 
Summary:                    [patch] Not possible to register to a registrar via
a host with different port number
Description: 
It is currently possible to register to a registrar indirectly via a host
using an extended format of the registration string
[transport://]user[:secret[:authuser]]@host[:port][/contact][~expiry]

In this extended format the "user" portion is expanded to
"username at domain". In this case the registration packet is sent to the
address of the "host" but the request line uri indicates that the registrar
is at the address of the "domain". This works fine as long as default port
numbers are used

However if the host includes a "port" other than 5060 then the request
line uri also contains this port even though the registrar may be on a
different port number or on the standard port

There needs to be a way in the registration string to specify the port of
the registar too e.g. "user" expand to "username at domain:domainport"
====================================================================== 

---------------------------------------------------------------------- 
 (0097644) putnopvut (administrator) - 2009-01-13 14:45
 http://bugs.digium.com/view.php?id=14198#c97644 
---------------------------------------------------------------------- 
I've been going over the notes here and trying to think of a way to allow
the port to be present in the user portion without having to have "blank"
secret and authuser sections. Aside from adding a new separator to be
placed in between the port and the secret, I can't think of anything. I
don't really like the idea of having to add a new separator though since I
think the syntax would be unwieldy, so I suppose that Nick's solution is
the best choice at this point. I think one thing that will be nice is that
no one will be forced to update the formatting of their register lines when
upgrading to a version which has this support (unless of course they decide
to add a port to the "user" section). I'll place a nice big note in the
sample configuration file that makes it clear that if you place a port in
the user section and you don't specify a secret or authuser, then you will
need to make sure to "blank" them so there is no trouble parsing the line.

As far as the actual patch goes, the code looks correct, but it looks like
there are some minor indention changes that need to be made to the code
surrounding your changes, esp. in transmit_register. Since they are minor,
I have no problem taking care of this myself. 

Thanks very much for the submission! As far as I'm concerned this is ready
for merge, but I'll probably get another set of eyes to take a look just to
be on the safe side. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-01-13 14:45 putnopvut      Note Added: 0097644                          
======================================================================




More information about the asterisk-bugs mailing list