Possible bug in sip channel when user accounts start with 0

Hi all,

I had a weird problem with a Swiss voip provider (Netvoip) where I was unable to receive incoming calls, while it worked for other providers. I think the problem lies in Asterisk (I’m using 1.2.3) - under certain circumstances the REGISTRY-packet contains a wrong “Contact:” header. Below the details:

In sip.conf I have the following registry lines (I add the one of another provider Citytel, where everything works fine):


Note that I add a mnemonic string behind “/” that I re-use in extensions.conf to make things easier to read. Normally a good idea, but not in this case… Normally, Asterisk should forward this strung as “Contact:” header at registration. This works finw for Citytel:

REGISTER sip:voipgateway.org SIP/2.0
Via: SIP/2.0/UDP 217.162.x.x:5060;branch=z9hG4bK1c0b5b1c;rport
From: <sip:4132xxxxxxx@voipgateway.org>;tag=as14896e5b
To: <sip:4132xxxxxxx@voipgateway.org>
Call-ID: 5bb69b17643cf4230c26ede767c38c33@
User-Agent: unknown
Max-Forwards: 70
Expires: 600
Contact: <sip:FromCitytel@217.162.x.x>
Event: registration
Content-Length: 0

As you can see, “FromCitytel” appears under “Contact:”. But the Netvoip registration packet looks different:

REGISTER sip:sip.netvoip.ch SIP/2.0
Via: SIP/2.0/UDP 217.162.x.x:5060;branch=z9hG4bK36a730fd;rport
From: <sip:031xxxxxxx@sip.netvoip.ch>;tag=as096d8708
To: <sip:031xxxxxxx@sip.netvoip.ch>
Call-ID: 7099da115a0cd9fb6bf066b5574ee273@
User-Agent: unknown
Max-Forwards: 70
Expires: 600
Contact: <sip:031xxxxxxx@217.162.x.x>
Event: registration
Content-Length: 0

As you can see, Asterisk now puts the default username instead of the string I gave above into the Contact header! I didn’t check the code, but the only reason I could imagine while this is happening is the fact, that Netvoip uses numbers as usernames that start with a zero. Ths only solution for this problem is to use also this usernumber and no mnemonic inside extensions.conf… no big deal, IF you find that out… :smile: Still, it would be nicer to have it fixed.

I have a lot of accounts that start with 0, but I’m not having your problem.
(using 1.2.1)


REGISTER sip:voip.eutelia.it SIP/2.0
Via: SIP/2.0/UDP 81.xx.xx.xx:5060;branch=z9hG4bK5d68a545;rport
From: sip:079-------@voip.eutelia.it;tag=as4dff5100
To: sip:079-------@voip.eutelia.it
Call-ID: 1737346273ac6d8806e0825d689f1bda@
User-Agent: Asterisk PBX
Max-Forwards: 70
Expires: 1500
Contact: sip:fromAHO@81.xx.xx.xx
Event: registration
Content-Length: 0

Checkyour sip.conf

Strange, my sip.conf is easy enough that I can’t think of any possible problem concerning my problem… if it is not the leading zero, it might eventually be the trailing # in the password (which is part of it), or something else… anyway, as it works now without explicit contact name, I will leave it as it is. If a system works, don’t fix it :smiley: Just thought I’ll post it here in case it really is a bug in Asterisk. Thanks for your help anyway!