[Home]

Summary:ASTERISK-14045: [patch] Introduce better parsing for the register line
Reporter:Tilghman Lesher (tilghman)Labels:
Date Opened:2009-04-30 17:12:44Date Closed:2010-05-06 19:57:34
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20090501__better_register_parsing.diff.txt
( 1) 20090807__issue15008.diff.txt
( 2) 20090818__issue15008.diff.txt
( 3) backtrace_15008.txt
Description:People have asked for the ability to use characters that are otherwise used as delimiters in the register line, such as '/', '@', and ':'.  In the past, we've had to say no, because the register line is very simply parsed.

This patch allows any part of the register line to be quoted, and the section within the quote may contain any of these special characters.  Literal quotes and literal backslashes may be added to these fields by prefixing them with a backslash.  Also, if no quotes are used around a particular field, the delimiter character may be preceded with a backslash, to encode that literal character within the field.

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

Note that if any character is special to SIP, it will be further encoded as two hexadecimal digits preceded by a percent sign.  However, this method is merely to ensure that the register line can contain those characters.
Comments:By: Leif Madsen (lmadsen) 2009-08-17 08:36:01

Attached is the backtrace found while testing the latest patch.

By: Leif Madsen (lmadsen) 2009-08-17 08:36:32

Here is the line I tested with:

register => asterisk_laptop:abc!5j5?!9!@192.168.128.3/123

By: Tilghman Lesher (tilghman) 2009-08-18 11:43:40

And, back to you, with an updated patch. :-)

By: Leif Madsen (lmadsen) 2009-08-18 15:13:14

Works for me!(tm)

By: Digium Subversion (svnbot) 2009-08-19 16:05:49

Repository: asterisk
Revision: 213098

U   trunk/channels/chan_sip.c
U   trunk/configs/sip.conf.sample

------------------------------------------------------------------------
r213098 | tilghman | 2009-08-19 16:05:48 -0500 (Wed, 19 Aug 2009) | 9 lines

Better parsing for the "register" line
Allows characters that are otherwise used as delimiters to be used within
certain fields (like the secret).
(closes issue ASTERISK-14045, closes issue ASTERISK-14612)
Reported by: tilghman
Patches:
      20090818__issue15008.diff.txt uploaded by tilghman (license 14)
Tested by: lmadsen, tilghman

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

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

By: Digium Subversion (svnbot) 2009-08-19 16:22:36

Repository: asterisk
Revision: 213117

_U  branches/1.6.2/
U   branches/1.6.2/channels/chan_sip.c
U   branches/1.6.2/configs/sip.conf.sample

------------------------------------------------------------------------
r213117 | tilghman | 2009-08-19 16:22:36 -0500 (Wed, 19 Aug 2009) | 16 lines

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

........
 r213098 | tilghman | 2009-08-19 16:05:17 -0500 (Wed, 19 Aug 2009) | 9 lines
 
 Better parsing for the "register" line
 Allows characters that are otherwise used as delimiters to be used within
 certain fields (like the secret).
 (closes issue ASTERISK-14045, closes issue ASTERISK-14612)
  Reported by: tilghman
  Patches:
        20090818__issue15008.diff.txt uploaded by tilghman (license 14)
  Tested by: lmadsen, tilghman
........

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

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

By: Digium Subversion (svnbot) 2009-08-21 16:03:23

Repository: asterisk
Revision: 213635

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r213635 | dvossel | 2009-08-21 16:03:23 -0500 (Fri, 21 Aug 2009) | 5 lines

fixes sip register parsing when user@domain is used

(issue ASTERISK-14045)
(issue ASTERISK-14612)

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

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

By: Digium Subversion (svnbot) 2009-08-21 16:12:47

Repository: asterisk
Revision: 213636

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

------------------------------------------------------------------------
r213636 | dvossel | 2009-08-21 16:12:47 -0500 (Fri, 21 Aug 2009) | 12 lines

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

........
 r213635 | dvossel | 2009-08-21 16:02:50 -0500 (Fri, 21 Aug 2009) | 5 lines
 
 fixes sip register parsing when user@domain is used
 
 (issue ASTERISK-14045)
 (issue ASTERISK-14612)
........

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

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

By: Digium Subversion (svnbot) 2010-01-22 18:42:14.000-0600

Repository: asterisk
Revision: 242514

_U  branches/1.6.0/
U   branches/1.6.0/channels/chan_sip.c
U   branches/1.6.0/configs/sip.conf.sample

------------------------------------------------------------------------
r242514 | tilghman | 2010-01-22 18:42:09 -0600 (Fri, 22 Jan 2010) | 55 lines

Backporting register line parsing from trunk to fix a bad parsing error in 1.6.0.

(closes issue ASTERISK-15182)
Reported by: jamicque
Patches:
      20100114__issue16491.diff.txt uploaded by tilghman (license 14)
Tested by: jamicque

........
 r213098 | tilghman | 2009-08-19 16:05:17 -0500 (Wed, 19 Aug 2009) | 9 lines
 
 Better parsing for the "register" line
 Allows characters that are otherwise used as delimiters to be used within
 certain fields (like the secret).
 (closes issue ASTERISK-14045, closes issue ASTERISK-14612)
  Reported by: tilghman
  Patches:
        20090818__issue15008.diff.txt uploaded by tilghman (license 14)
  Tested by: lmadsen, tilghman
........
 r213635 | dvossel | 2009-08-21 16:02:50 -0500 (Fri, 21 Aug 2009) | 5 lines
 
 fixes sip register parsing when user@domain is used
 
 (issue ASTERISK-14045)
 (issue ASTERISK-14612)
........
 r215222 | tilghman | 2009-09-01 16:19:40 -0500 (Tue, 01 Sep 2009) | 3 lines
 
 Fix register such that lines with a transport string, but without an authuser, parse correctly.
 (AST-228)
........
 r215801 | tilghman | 2009-09-02 22:43:51 -0500 (Wed, 02 Sep 2009) | 5 lines
 
 Default the callback extension to "s".  This is a regression.
 (closes issue ASTERISK-14697)
  Reported by: elguero
  Change-type: bugfix
........
 r235132 | dvossel | 2009-12-15 12:43:06 -0600 (Tue, 15 Dec 2009) | 14 lines
 
 reverse minor sip registration regression
 
 A registration regression caused by a code tweak in (issue ASTERISK-13448)
 and a bug fix in (issue ASTERISK-14501) caused some sip registration
 config entries to be constructed incorrectly.  Origially
 issue ASTERISK-13448 contained the code tweak as well as a bug fix, but since
 the issue was reported as a tweak the bug fix portion was moved into
 issue ASTERISK-14501.  Both the tweak and the bug fix contained minor incorrect
 logic that resulted in some SIP registrations to fail.
 
 (issue ASTERISK-13448)
 (issue ASTERISK-14501)
........

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

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