[Asterisk-Dev] 1.0.5, SIP, possible bug: "From:" field wrong in authentication?

Andreas Greulich andreas.greulich at spl.ch
Fri Feb 18 09:09:43 MST 2005


Hi all,

I just tried to upgrade from 1.0.1 to 1.0.5, but had to go back to 1.0.1 because
my Stanaphone settings (SIP channel) didn't work anymore. Maybe I'm missing
something, but this could be a bug...?

My settings:
sip.conf:
[Stanaphone]
type=friend
insecure=very
secret=####
username=9146186487
host=sip.stanaphone.com
canreinvite=no
nat=0
dtmfmode=info
disallow=all
allow=ulaw
disallow=gsm


extensions.conf:
[shortcuts]
...
exten => 903,3,Dial(SIP/18005558355 at Stanaphone,60,)


sip debug gives the following (shortened) output at an outgoing call to 903 from
my GHrandStream, look at the "From" fields:

Initial call request (everything ok):

Reliably Transmitting:
INVITE sip:18005558355 at sip.stanaphone.com SIP/2.0
Via: SIP/2.0/UDP 217.162.36.14:5060;branch=z9hG4bK1fd07762
From: "9146186487" <sip:9146186487 at 217.162.36.14>;tag=as321af8e6
To: <sip:18005558355 at sip.stanaphone.com>
Contact: <sip:9146186487 at 217.162.36.14>
...

server asks for challenge-response-authentication (also ok):

Sip read:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 217.162.36.14:5060;branch=z9hG4bK1fd07762
From: "9146186487" <sip:9146186487 at 217.162.36.14>;tag=as321af8e6
To: <sip:18005558355 at sip.stanaphone.com>;tag=4e487a...
Call-ID: 5125047a50e129574aeec9db742e612e at 217.162.36.14
CSeq: 102 INVITE
WWW-Authenticate: Digest realm="sip.stanaphone.com",
nonce="42160b612b0ed32cd6ce0bb3683695482cbed930"
Server: Sip EXpress router (0.8.14 (i386/freebsd))
...

Asterisks acknowledges the request (which is fine too):

Transmitting:
ACK sip:18005558355 at sip.stanaphone.com SIP/2.0
Via: SIP/2.0/UDP 217.162.36.14:5060;branch=z9hG4bK1fd07762
From: "9146186487" <sip:9146186487 at 217.162.36.14>;tag=as321af8e6
To: <sip:18005558355 at sip.stanaphone.com>;tag=4e487ad2f...
Contact: <sip:9146186487 at 217.162.36.14>
...

And now it comes... when sending the authentication (response to challenge), it
suddenly writes "903" into the "From:" field, instead of "9146186487" that it
used until now:

Reliably Transmitting:
INVITE sip:18005558355 at sip.stanaphone.com SIP/2.0
Via: SIP/2.0/UDP 217.162.36.14:5060;branch=z9hG4bK1155668b
From: "903" <sip:903 at 217.162.36.14>;tag=as321af8e6
     ^^^^^^^^
To: <sip:18005558355 at sip.stanaphone.com>
Contact: <sip:903 at 217.162.36.14>
Call-ID: 5125047a50e129574aeec9db742e612e at 217.162.36.14
CSeq: 103 INVITE
...

this is sent several times without getting an answer (not shown here), and after
4 or 5 retransmissions, Stanaphone finally replies with the logical answer:

Sip read:
SIP/2.0 403 From user does not match authenticated user
Via: SIP/2.0/UDP 217.162.36.14:5060;branch=z9hG4bK1155668b
From: "903" <sip:903 at 217.162.36.14>;tag=as321af8e6
To: <sip:18005558355 at sip.stanaphone.com>;tag=4e487ad2f2fa...
Call-ID: 5125047a50e129574aeec9db742e612e at 217.162.36.14
CSeq: 103 INVITE
Server: Sip EXpress router (0.8.14 (i386/freebsd))
...


I'm not sure if I missed something in teh config (maybe something changed
meanwhile?); for the time being, I'm back on 1.0.1, but think it might be worth
mentioning. I don't know if this happens in 1.0.2/3/4, but definitely it doesn't
happen in 1.0.1. Can anyone confirm this? Or was it already mentioned? I still
miss a seatch function in the mailing list archive... (*hint*)


Regards, Andy

-- 

Andreas Greulich
E-Mail: andreas.greulich at spl.ch
Skype: klaymen-neverhood

Sermo datur cunctis, animi sapientia paucis.




More information about the asterisk-dev mailing list