@ in username

My username contains one of the reserved characters -’@’

my registration string should look like foo@bar@1.2.3.4 but this obviously will not work.

What is the proper syntax here ? Using Asterisk 1.6.0

UPDATE:

Asterisk 1.4 registers fine, and sends

REGISTER sip:1.2.3.4
From: sip:foo@bar

Asterisk 1.6 sends:

REGISTER sip:bar
From: sip:foo@bar

which causes the server to reject authentication.

Can you try with either single or double quote, i.e. username=‘me@junk.com’, register=>‘me@junk.com’:@some_company.com, etc.?

The real problem here is that @ is illegal in SIP URLs, not that it is illegal to Asterisk. It will almost certainly need quoting at the SIP level, but the domain name mustn’t be quoted.

I would have thought so; however, interestingly my VoiceGlobe account (in the form of @<e-mail_account.com>) registers just fine to its server with no quotes from my asterisk-1.6.x. Honestly, I have no idea why mine works; however, if no quotes don’t work for OP, it certainly won’t hurt to try with quotes to see if that will resolve the issue.

With single quotes - ‘foo@bar’:secret@1.2.3.4 Asteriks sends

REGISTER sip:bar’
From: sip:‘foo@bar’

with double quotes: is the same story with single quotes replaced by double quotes.

Anyway, it works in 1.4 , why did we change it for 1.6 ?

See my post above that the @ works just fine on my asterisk-1.6.x with my VoiceGlobe account.

See my post above that the @ works just fine on my asterisk-1.6.x with my VoiceGlobe account.[/quote]

Well did not work with mine. The thing that saved me is the fact the last part of the register string can be a context. In that context you can define all kinds of things like fromdomain. It can give you the same registration SIP packet as in 1.4.

Still the question remains why so significant changes are introduced in between 1.4 and 1.6 ?

Did you compare the codes from 1.4 to 1.6? Unless you have done such a comparison, there isn’t any changes between 1.4 to 1.6 w.r.t the @ that I am aware of. Afterall, my asterisk-1.6.x, whose sip.conf file with my VoiceGlobe account was inherited from my asterisk-1.4.x with one change to replace the depricated username with the new defaultuser, still works fine with the @ in its username. Had there been any changes, perhaps such changes would either have caused the problems (which isn’t the case) or didn’t cause any problems (which is the case) to my existing sip.conf file. May be, it is best for you to post your sip.conf file here for readers to digest and come up with some sort of solution.

[quote=“mazilo”]
Did you compare the codes from 1.4 to 1.6? Unless you have done such a comparison, there isn’t any changes between 1.4 to 1.6 w.r.t the @ that I am aware of. [/quote]
Yes, check http://svnview.digium.com/svn/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&r1=254550&r2=105596&diff_format=l for the diff beween 1.4 and 1.6.0. You need to look at line 6537 where the function sip_register is. There is almost no original code left in the latest 1.6.0 version.

Update: The change which broke it for me is here: https://issues.asterisk.org/view.php?id=12474

It works because your sip provider does not care about the REGISTER line.

[quote]
May be, it is best for you to post your sip.conf file here for readers to digest and come up with some sort of solution.[/quote]
You did not read my post where I explained that I got it already working after using context as the last part of the register string.

Yes, check http://svnview.digium.com/svn/asterisk/branches/1.6.0/channels/chan_sip.c?view=diff&r1=254550&r2=105596&diff_format=l for the diff beween 1.4 and 1.6.0. You need to look at line 6537 where the function sip_register is. There is almost no original code left in the latest 1.6.0 version.

Update: The change which broke it for me is here: https://issues.asterisk.org/view.php?id=12474[/quote]
I am glad you found the above report.

It works because your sip provider does not care about the REGISTER line.[/quote]
I don’t think so. I believe VoiceGlobe supports @ username. Otherwise, I will have no need to use the @. One thing you may want to try is to create a free account on VoiceGlobe, and see if you still encounter the same problem. Also, I wouldn’t mind if the VoSP in question has offer a free SIP P2P account so I can try it. :bulb:

I did. Perhaps, you didn’t read my post saying that my VoiceGlobe configuration was copied directly from asterisk-1.4.x to asterisk-1.6.x with no modification w.r.t @ username and it still works! :wink:

thor wrote: “I got it already working after using context as the last part of the register string”.

I would appreciate an example of exactly how this is done - it seems I have the same problem, please see this post:
http://fonality.com/trixbox/forums/trixbox-forums/help/how-configure-sip-trung-when-digest-username-must-contain-sign

Peter :question: