[Asterisk-Users] Formatting in sip.conf...can you have 2 @ signs for register?

Olle E. Johansson oej at edvina.net
Mon Aug 16 12:13:16 MST 2004


Greg Hill wrote:

> On Mon, 16 Aug 2004, Olle E. Johansson wrote:
> 
> 
>>James Freire wrote:
>>
>>
>>>Hi All,
>>>I am trying to setup another sip trunk in addition to what I am already
>>>using.  The sip provider we are using right now gives you your username
>>>as your email address. So IE. If my email is james at james.com.... that is
>>>my username . Now... When I put this in the sip.conf file I have found
>>>that Asterisk is not able to parse it correctly and instantly goes to
>>>the email server to authenticate the sip user upon registration
>>>
>>>Here is the line below in my sip.conf file
>>>
>>>register => username at theiremailhost.com:password at sipprovider.com
>>>
>>>THe error is below
>>>
>>>Aug 16 11:30:05 NOTICE[114695]: chan_sip.c:3922 sip_reg_timeout:
>>>Registration for 'john at useremail.com@sip.voipamericas.com' timed
>>>out, trying again
>>>Aug 16 11:30:06 NOTICE[114695]: chan_sip.c:6575 handle_response: Failed
>>>to authenticate on REGISTER to
>>>'<sip:john at useremail.com>;tag=as1c528b93'
>>>
>>
>>That's obviously an error. Please add it to the bug tracker and we'll solve it.
> 
> 
> 
> I disagree.. although the sip rfc (I'm looking at 3261, June 2002) doesn't
> specifically state that the user field cannot have the @ character in it,
> the language there suggests that '@' is supposed to be the separator
> between the user string and the host string. In addition, it is stated
> that the sip URI scheme follows RFC 2396, which states that all of
> [;/?:@&=+$,] are reserved characters. See section 2.2:
>    The "reserved" syntax class above refers to those characters that are
>    allowed within a URI, but which may not be allowed within a
>    particular component of the generic URI syntax; they are used as
>    delimiters of the components described in Section 3.
> 
> I think Asterisk's behavior is correct and the syntax
> 'john at useremail.com@sip.voipamericas.com' is debateable at best. It's
> possible that replacing the @ in the intended user portion with %40 may
> allow it to slip through Asterisk and get un-escaped by the server on the
> far end.. Anyway, the issue may warrant some more dialogue before
> declaring it a defect.

We are not talking about the user field, it's the digest auth username
that is the important field for authentication. I belive that field is
defined as "quoted-string". I've seen use of @-constructs in http,
logging in to a web site with my e-mail name as the username, so I guess
it's  valid.

http digest auth, used in SIP, is defined in RFC 2617.
Don't mix this with the username part of the SIP URI.

I have to check if my proposed realm authentication scheme I use
in chan_sip2 can handle this.

/Olle



More information about the asterisk-users mailing list