The problem lies in the fact that the second INVITE with proper
credentials is not send within the same dialog as established by the
initial INVITE for which 407 was sent by Proxy. You must as well
increment the Cseq in this case,which is same here.

Regards
ajit 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin
van den Berg
Sent: Friday, November 25, 2005 8:18 PM
To: Sip-implementors
Subject: [Sip-implementors] authentication question

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. The username and password are ok.

Any ideas?

Martin


The trace:
My UA sends the INVITE to Asterisk:

INVITE sip:[EMAIL PROTECTED] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.126:5060;branch=z9hG4bK-276428-27856
From: "4302" <sip:[EMAIL PROTECTED]>;tag=27642829233
To: <sip:[EMAIL PROTECTED]>
Call-ID: [EMAIL PROTECTED]
CSeq: 20 INVITE
Contact: <sip:[EMAIL PROTECTED]:5060>
Max-Forwards: 70
User-Agent: My UA
Privacy: none
P-Preferred-Identity: "4302" <sip:[EMAIL PROTECTED]>
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:[EMAIL PROTECTED]>;tag=27642829233
To: <sip:[EMAIL PROTECTED]>;tag=as385f1a51
Call-ID: [EMAIL PROTECTED]
CSeq: 20 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:[EMAIL PROTECTED]:5068>
Proxy-Authenticate: Digest realm="asterisk.SipTux2", nonce="52beb24a"
Content-Length: 0

ACK sip:[EMAIL PROTECTED] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.126:5060;branch=z9hG4bK-276428-27856
From: "4302" <sip:[EMAIL PROTECTED]>;tag=27642829233
To: <sip:[EMAIL PROTECTED]>;tag=as385f1a51
Call-ID: [EMAIL PROTECTED]
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:[EMAIL PROTECTED] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.126:5060;branch=z9hG4bK-276429-6368
From: "4302" <sip:[EMAIL PROTECTED]>;tag=2764299705
To: <sip:[EMAIL PROTECTED]>
Call-ID: [EMAIL PROTECTED]
CSeq: 20 INVITE
Contact: <sip:[EMAIL PROTECTED]:5060>
Proxy-Authorization: Digest username="4302", realm="asterisk.SipTux2",
nonce="52beb24a", uri="sip:[EMAIL PROTECTED]",
response="9c3f59f925a7feb47e0631735d103c88", algorithm=MD5
Max-Forwards: 70
User-Agent: My UA
Privacy: none
P-Preferred-Identity: "4302" <sip:[EMAIL PROTECTED]>
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=1
025
From: "4302" <sip:[EMAIL PROTECTED]>;tag=2764299705
To: <sip:[EMAIL PROTECTED]>;tag=as64b1c17b
Call-ID: [EMAIL PROTECTED]
CSeq: 20 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:[EMAIL PROTECTED]:5068>
Proxy-Authenticate: Digest realm="asterisk.SipTux2", nonce="7a055f95"
Content-Length: 0


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

--
Skype: MartinvdbBerg


--
Skype: MartinvdbBerg

_______________________________________________
Sip-implementors mailing list
[email protected]
http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors

_______________________________________________
Sip-implementors mailing list
[email protected]
http://lists.cs.columbia.edu/mailman/listinfo/sip-implementors

Reply via email to