[Asterisk-Users] authentication question

Martin van den Berg martinvdberg at gmail.com
Fri Nov 25 07:46:56 MST 2005


Hi Folks,

I am implementing a SIP ua and have been testing it against the SER
proxy which works fine. So my next step is to test is with Asterisk
and I run into a problem. I can REGISTER my UA with authentication, no
problem but the Asterisk does not accepts my credentials in the
INVITE. I have checked my username and password with the sip.conf file
(secret=...) and it looks ok. You can find the messages below.

Any ideas?

Martin


The trace:
My UA sends the INVITE to Asterisk:

INVITE sip:2300 at Asterix SIP/2.0
Via: SIP/2.0/UDP 192.168.1.126:5060;branch=z9hG4bK-276428-27856
From: "4302" <sip:4302 at Asterix>;tag=27642829233
To: <sip:2300 at Asterix>
Call-ID: 27642811596 at 192.168.1.126
CSeq: 20 INVITE
Contact: <sip:4302 at 192.168.1.126:5060>
Max-Forwards: 70
User-Agent: My UA
Privacy: none
P-Preferred-Identity: "4302" <sip:4302 at Asterix>
P-Preferred-Identity: <tel:4302>
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS
Content-Type: application/sdp
Accept: application/sdp
Content-Length:   234

v=0
o=iS3000 0 0 IN IP4 192.168.1.216
s=-
c=IN IP4 192.168.1.216
t=0 0
m=audio 49368 RTP/AVP 0 8 18 96
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:96 telephone-event/8000
a=ptime:40
a=sendrecv

Asterisk challenges the INVITE:
407 Proxy Authentication Required
Via: SIP/2.0/UDP
192.168.1.126:5060;branch=z9hG4bK-276428-27856;received=10.20.0.1;rport=1025
From: "4302" <sip:4302 at Asterix>;tag=27642829233
To: <sip:2300 at Asterix>;tag=as385f1a51
Call-ID: 27642811596 at 192.168.1.126
CSeq: 20 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:2300 at 10.20.0.2:5068>
Proxy-Authenticate: Digest realm="asterisk.SipTux2", nonce="52beb24a"
Content-Length: 0

ACK sip:2300 at Asterix SIP/2.0
Via: SIP/2.0/UDP 192.168.1.126:5060;branch=z9hG4bK-276428-27856
From: "4302" <sip:4302 at Asterix>;tag=27642829233
To: <sip:2300 at Asterix>;tag=as385f1a51
Call-ID: 27642811596 at 192.168.1.126
CSeq: 20 ACK
Max-Forwards: 70
User-Agent: iS3000 SIP Server, Philips Business Communications
Content-Length: 0

INVITE again with credentials from my UA:
INVITE sip:2300 at Asterix SIP/2.0
Via: SIP/2.0/UDP 192.168.1.126:5060;branch=z9hG4bK-276429-6368
From: "4302" <sip:4302 at Asterix>;tag=2764299705
To: <sip:2300 at Asterix>
Call-ID: 27642931630 at 192.168.1.126
CSeq: 20 INVITE
Contact: <sip:4302 at 192.168.1.126:5060>
Proxy-Authorization: Digest username="4302", realm="asterisk.SipTux2",
nonce="52beb24a", uri="sip:2300 at Asterix",
response="9c3f59f925a7feb47e0631735d103c88", algorithm=MD5
Max-Forwards: 70
User-Agent: My UA
Privacy: none
P-Preferred-Identity: "4302" <sip:4302 at Asterix>
P-Preferred-Identity: <tel:4302>
Allow: INVITE, ACK, CANCEL, BYE, OPTIONS
Content-Type: application/sdp
Accept: application/sdp
Content-Length:   234

v=0
o=iS3000 0 0 IN IP4 192.168.1.216
s=-
c=IN IP4 192.168.1.216
t=0 0
m=audio 49368 RTP/AVP 0 8 18 96
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:96 telephone-event/8000
a=ptime:40
a=sendrecv

SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP
192.168.1.126:5060;branch=z9hG4bK-276429-6368;received=10.20.0.1;rport=1025
From: "4302" <sip:4302 at Asterix>;tag=2764299705
To: <sip:2300 at Asterix>;tag=as64b1c17b
Call-ID: 27642931630 at 192.168.1.126
CSeq: 20 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:2300 at 10.20.0.2:5068>
Proxy-Authenticate: Digest realm="asterisk.SipTux2", nonce="7a055f95"
Content-Length: 0


ACK sip:2300 at Asterix SIP/2.0
Via: SIP/2.0/UDP 192.168.1.126:5060;branch=z9hG4bK-276429-6368
From: "4302" <sip:4302 at Asterix>;tag=2764299705
To: <sip:2300 at Asterix>;tag=as64b1c17b
Call-ID: 27642931630 at 192.168.1.126
CSeq: 20 ACK
Proxy-Authorization: Digest username="4302", realm="asterisk.SipTux2",
nonce="52beb24a", uri="sip:2300 at Asterix",
response="9c3f59f925a7feb47e0631735d103c88", algorithm=MD5
Max-Forwards: 70
User-Agent: iS3000 SIP Server, Philips Business Communications
Content-Length: 0

--
Skype: MartinvdbBerg



More information about the asterisk-users mailing list