[Home]

Summary:ASTERISK-13750: register: '/' in username not supported
Reporter:Holger Hornung (netview)Labels:
Date Opened:2009-03-15 05:02:54Date Closed:2009-06-16 13:47:49
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) chan_sip.c.patch
Description:My VoIP-Provider 'bluesip.net' needs a username in the following way:
'bluesip/name'

sip.conf:
...
register => bluesip/name:secret@bluesip.net/bluesip

But the register attempt is rejected with:
chan_sip.c:6542 sip_register: Format for registration is [transport://]user[:secret[:authuser]]@domain[:port][/extension][~expiry] at line 69
Comments:By: Tilghman Lesher (tilghman) 2009-03-15 11:10:53

Since '/' is a reserved character for URI-encoded schemes, it must be escaped, if you want to use it within a field like this.  So, the proper way to set this in a register line would be:

register => bluesip%2Fname:secret@bluesip.net/bluesip

By: Holger Hornung (netview) 2009-03-15 16:26:03

Sorry - but it seems not to work:

[Mar 15 22:19:25] NOTICE[8187]: chan_sip.c:16225 handle_response_register: Failed to authenticate on REGISTER to 'bluesip%2Fname@bluesip.net' (Tries 3)

By: Leif Madsen (lmadsen) 2009-03-16 08:01:23

It could be that the other end doesn't support the escaped version (I've had other providers who don't accept the escaped versions, such as one problem I had with using the escaped version of '#' in a username).

By: Tilghman Lesher (tilghman) 2009-03-16 10:31:32

In any case, this is something that you need to take up with your provider.

By: Holger Hornung (netview) 2009-03-19 03:57:57

bluesip has opened this record for asterisk 1.4 - please take a look:

http://bugs.digium.com/view.php?id=14025

A backport to the 1.6 branch would be nice.

By: ffs (ffs) 2009-03-19 07:16:45

This bug is not related to bugid# 14025, but the method of how the 'callback' parameter is parsed is broken as it supposes that '/' is a reserved character for all fields of the register line which is not true.

Moving the callback parsing some lines and only search within the hostname part of the register string fixes the problem (For version 1.6.1.0-RC2 move after the "*hostname++ = '\0';" line and change 'buf' to 'hostname').

A patch will follow as soon as I'm approved to upload...

By: hobbystern (hobbystern) 2009-04-06 03:21:49

I can confirm the bug now in Asterisk 1.6.20

Hope it can be solved in the future - so that i can use a cleanly build system without patches.

Regards, Stefan

By: Leif Madsen (lmadsen) 2009-04-09 12:12:29

I'm setting this to be targeted for 1.6.3.0, but there still needs to be a decision from the developers to determine if this is an appropriate change to go in.

By: Leif Madsen (lmadsen) 2009-04-09 12:13:01

Just curious of your opinion about this patch. Do you think something like this should go in?

By: Olle Johansson (oej) 2009-04-09 12:19:51

We should be able to handle this character in the username field, if it's allowed by the RFC. You should not have to enter it encoded, but we are forced to encode it when sending it in the username, but *not* in the authentication part or when calculating MD5.

One should propably try with encoded part in username and unencoded in auth user to get a real idea about what to fix.

By: Digium Subversion (svnbot) 2009-04-09 12:20:51

Repository: asterisk
Revision: 187381

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r187381 | tilghman | 2009-04-09 12:20:50 -0500 (Thu, 09 Apr 2009) | 4 lines

Allow '/' in username portion of register; this is a regression.
(closes issue ASTERISK-13750)
Reported by: Netview

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

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

By: Digium Subversion (svnbot) 2009-04-09 12:22:39

Repository: asterisk
Revision: 187388

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

------------------------------------------------------------------------
r187388 | tilghman | 2009-04-09 12:22:39 -0500 (Thu, 09 Apr 2009) | 11 lines

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

........
 r187381 | tilghman | 2009-04-09 12:20:49 -0500 (Thu, 09 Apr 2009) | 4 lines
 
 Allow '/' in username portion of register; this is a regression.
 (closes issue ASTERISK-13750)
  Reported by: Netview
........

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

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

By: Digium Subversion (svnbot) 2009-04-09 12:23:15

Repository: asterisk
Revision: 187391

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

------------------------------------------------------------------------
r187391 | tilghman | 2009-04-09 12:23:15 -0500 (Thu, 09 Apr 2009) | 11 lines

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

........
 r187381 | tilghman | 2009-04-09 12:20:49 -0500 (Thu, 09 Apr 2009) | 4 lines
 
 Allow '/' in username portion of register; this is a regression.
 (closes issue ASTERISK-13750)
  Reported by: Netview
........

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

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