[Home]

Summary:ASTERISK-14612: ? in register= string breaks registration
Reporter:test011 (test011)Labels:
Date Opened:2009-08-07 00:42:05Date Closed:2010-01-22 18:42:16.000-0600
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) backtrace.txt
Description:If you put '?' (w/o quotation) in register= string in sip.conf, asterisk does not parse it properly.

One of my register= string has '?' in its password section, and asterisk can't parse it properly. This does not affect other lines in sip.conf

The string I used is as bellow,

register =>xxx@xxx.com:abc!5j5?!9!:xxx@hostip/123

Does '?' have been used as some token? Maybe I did not get that. I am pretty sure I haven't seen it in change.log or sip.conf.sample.

The registration strings have worked fine with version 1.4.2, 1.6.0, and 1.6.1.0.
Comments:By: test011 (test011) 2009-08-07 00:51:13

WARNING[1081]: chan_sip.c:10986 transmit_register: Could not find peer xxx@xxx.com:abc!5j5 in transmit_register.

Notice the password is chopped at '?' of abc!5j5?!9!



By: Tilghman Lesher (tilghman) 2009-08-07 12:54:27

The patch on ASTERISK-14045 will fix this for you, although by changing the format slightly.  That patch will allow you to quote nearly any field (exception of transport and portnum, which don't allow arbitrary characters, anyway) to prevent characters within from being interpreted as delimiters.



By: Leif Madsen (lmadsen) 2009-08-07 15:09:00

I seem to be getting a segfault on the latest patch.

By: Leif Madsen (lmadsen) 2009-08-07 15:09:26

Oops! Wrong issue -- this is the backtrace I get when testing 15008. Sorry :(

By: test011 (test011) 2009-08-08 06:24:44

lmadsen, so the patch is ok?

By: test011 (test011) 2009-08-08 11:06:19

I guess this isn't the place to leave a memo like this. However...

ex)
register => [peername?][transport://]user[@domain][:secret[:authuser]]@host[:port][/extension][~expiry]

The new register format has some mysterious section called [peername?].
Not sure why this is necessary. I thought you can put that in 'host' section.

The fix may be a long-term solution, since secret section may contain anything, but for the time-being you can go back to 1.6.1 branch or just add a 'peername?' (actual name of the peer w/o quote) in front of the string, like this;

register =>peerORcontextname?xxx@xxx.com:abc!5j5?!9!:xxx@hostip/123

If you don't use a corresponding peer, I guess you need to apply the fix.

By: Tilghman Lesher (tilghman) 2009-08-09 01:51:18

The purpose of the peer section is to get Asterisk to use a specific outgoing proxy for the registration request.  The purpose of the patch is to allow you to quote any field, such that you can use characters in those fields that would otherwise be parsed as delimiters.

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

Latest patch in 15008 seems to be working for me!

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

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:37

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:24

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:48

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:15.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