[Home]

Summary:ASTERISK-14131: [patch] parsing of sip register lines is broken
Reporter:ffs (ffs)Labels:
Date Opened:2009-05-14 11:03:24Date Closed:2010-01-05 09:31:55.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_sip.c_register-parser.patch
Description:A register line within sip.conf has the following format:

[transport://]user[:secret[:authuser]]@domain[:port][/extension][~expiry]

To extract the extension the parser is searching for '/' in the whole line (from right to left).
As [/extension] is optional this causes trouble if there is no extension defined and [transport://] is set.

Suggested solution: parse extension and expiry after the last '@' character.

A backport to affected older versions would be appreciated.

****** ADDITIONAL INFORMATION ******

suggested solution would also close bug# 14668
Comments:By: ffs (ffs) 2009-05-14 11:05:24

attached you find a patch for version 1.6.2.0-beta2

By: Leif Madsen (lmadsen) 2009-06-16 13:54:43

As 14668 is now closed, I am going to close this issue. If 14668 did not resolve this issue, please open a new bug report, and mention why 14668 did not resolve this issue. Thanks!

By: Sean Bright (seanbright) 2009-06-17 10:26:35

Re-opened after reporter incorrectly created a duplicate issue.

By: Digium Subversion (svnbot) 2009-06-18 10:16:06

Repository: asterisk
Revision: 201570

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r201570 | dvossel | 2009-06-18 10:16:05 -0500 (Thu, 18 Jun 2009) | 11 lines

parsing extension correctly from sip register lines

If a transport type was specified, but no extension, parsing of the extension would return whatever was after the transport rather than defaulting to 's'.

(closes issue ASTERISK-14131)
Reported by: ffs
Patches:
     chan_sip.c_register-parser.patch uploaded by ffs (license 730)
Tested by: ffs, dvossel


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=201570

By: Digium Subversion (svnbot) 2009-06-18 10:23:04

Repository: asterisk
Revision: 201595

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_sip.c

------------------------------------------------------------------------
r201595 | dvossel | 2009-06-18 10:23:03 -0500 (Thu, 18 Jun 2009) | 17 lines

Merged revisions 201570 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r201570 | dvossel | 2009-06-18 10:16:05 -0500 (Thu, 18 Jun 2009) | 11 lines
 
 parsing extension correctly from sip register lines
 
 If a transport type was specified, but no extension, parsing of the extension would return whatever was after the transport rather than defaulting to 's'.
 
 (closes issue ASTERISK-14131)
 Reported by: ffs
 Patches:
       chan_sip.c_register-parser.patch uploaded by ffs (license 730)
 Tested by: ffs, dvossel
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=201595

By: Digium Subversion (svnbot) 2009-06-18 10:24:41

Repository: asterisk
Revision: 201601

_U  branches/1.6.1/
U   branches/1.6.1/channels/chan_sip.c

------------------------------------------------------------------------
r201601 | dvossel | 2009-06-18 10:24:41 -0500 (Thu, 18 Jun 2009) | 17 lines

Merged revisions 201570 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

........
 r201570 | dvossel | 2009-06-18 10:16:05 -0500 (Thu, 18 Jun 2009) | 11 lines
 
 parsing extension correctly from sip register lines
 
 If a transport type was specified, but no extension, parsing of the extension would return whatever was after the transport rather than defaulting to 's'.
 
 (closes issue ASTERISK-14131)
 Reported by: ffs
 Patches:
       chan_sip.c_register-parser.patch uploaded by ffs (license 730)
 Tested by: ffs, dvossel
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=201601

By: Digium Subversion (svnbot) 2009-06-18 10:29:36

Repository: asterisk
Revision: 201611

_U  branches/1.6.0/

------------------------------------------------------------------------
r201611 | dvossel | 2009-06-18 10:29:36 -0500 (Thu, 18 Jun 2009) | 16 lines

Blocked revisions 201570 via svnmerge

........
 r201570 | dvossel | 2009-06-18 10:16:05 -0500 (Thu, 18 Jun 2009) | 11 lines
 
 parsing extension correctly from sip register lines
 
 If a transport type was specified, but no extension, parsing of the extension would return whatever was after the transport rather than defaulting to 's'.
 
 (closes issue ASTERISK-14131)
 Reported by: ffs
 Patches:
       chan_sip.c_register-parser.patch uploaded by ffs (license 730)
 Tested by: ffs, dvossel
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=201611

By: Tzafrir Cohen (tzafrir) 2010-01-05 09:31:55.000-0600

Just to make this explicit, and hopefully avoid future duplicates (I was about to reopen this one before figuring out) - if you need a slash in the username, the transport has to be specified explicitly.

register => foo/bar:password@domain ; fails. Will probably be identified as some strange transport 'fo'
register => foo\/bar:password@doman ; you get an explicit '\/' in the username
register => udp://foo/bar:password@domain ; works