While testing register with an Asterisk PBX, I found a problem with the refresh registration. It appears Asterisk does a very minimal challenge, but wants a new encryption for every registration refresh. ca_challenge() doesn't see this as a new challenge and returns 0, so there is never a new REGISTER generated using the new nonce after I call nua_authenticate().
I'm not sure exactly how to fix this.
One idea I have is to keep the old header params around, and check to see if any are updated. Return 1 if they are.
I'm not sure which params would need to be compared other than nonce.

Here is the trace:

=================================================================================
00:42:33.715154 10.1.64.123.5060 > 10.0.0.233.5060: udp 483 (DF) [tos 0x48]
REGISTER sip:10.0.0.233:5060 SIP/2.0
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKr6N4FgaD3DpeF
Max-Forwards: 70
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052786 REGISTER
Contact: <sip:10.1.64.123>
Expires: 60
User-Agent: sofia-sip/1.11.8work
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, REFER, UPDATE, NOTIFY
Supported: timer, path
Content-Length: 0

=================================================================================
00:42:33.715154 10.0.0.233.5060 > 10.1.64.123.5060:  udp 436 (DF)
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKr6N4FgaD3DpeF;received=10.1.64.123
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052786 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:[EMAIL PROTECTED]>
Content-Length: 0

=================================================================================
00:42:33.715154 10.0.0.233.5060 > 10.1.64.123.5060:  udp 518 (DF)
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKr6N4FgaD3DpeF;received=10.1.64.123
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>;tag=as68741c85
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052786 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:[EMAIL PROTECTED]>
WWW-Authenticate: Digest realm="asterisk", nonce="307560ef"
Content-Length: 0

=================================================================================
00:42:43.445392 10.1.64.123.5060 > 10.0.0.233.5060: udp 651 (DF) [tos 0x48]
REGISTER sip:10.0.0.233:5060 SIP/2.0
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKHccZHy2KZpFHH
Max-Forwards: 70
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052787 REGISTER
Contact: <sip:10.1.64.123>
Expires: 60
User-Agent: sofia-sip/1.11.8work
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, REFER, UPDATE, NOTIFY
Supported: timer, path
Authorization: Digest username="3016853102", realm="asterisk", nonce="307560ef", algorithm=MD5, uri="sip:10.0.0.233:5060", response="aec635fa800adb171e2ac341325c1d09"
Content-Length: 0

=================================================================================
00:42:43.445392 10.0.0.233.5060 > 10.1.64.123.5060:  udp 436 (DF)
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKHccZHy2KZpFHH;received=10.1.64.123
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052787 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:[EMAIL PROTECTED]>
Content-Length: 0

=================================================================================
00:42:43.445392 10.0.0.233.5060 > 10.1.64.123.5060:  udp 498 (DF)
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKHccZHy2KZpFHH;received=10.1.64.123
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>;tag=as68741c85
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052787 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Expires: 60
Contact: <sip:10.1.64.123>;expires=60
Date: Tue, 23 May 2006 00:42:43 GMT
Content-Length: 0

=================================================================================
00:43:14.336141 10.1.64.123.5060 > 10.0.0.233.5060: udp 651 (DF) [tos 0x48]
REGISTER sip:10.0.0.233:5060 SIP/2.0
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKaj2SKcUtUZ8KK
Max-Forwards: 70
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052788 REGISTER
Contact: <sip:10.1.64.123>
Expires: 60
User-Agent: sofia-sip/1.11.8work
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, REFER, UPDATE, NOTIFY
Supported: timer, path
Authorization: Digest username="3016853102", realm="asterisk", nonce="307560ef", algorithm=MD5, uri="sip:10.0.0.233:5060", response="aec635fa800adb171e2ac341325c1d09"
Content-Length: 0

=================================================================================
00:43:14.336141 10.0.0.233.5060 > 10.1.64.123.5060:  udp 436 (DF)
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKaj2SKcUtUZ8KK;received=10.1.64.123
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052788 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:[EMAIL PROTECTED]>
Content-Length: 0

=================================================================================
00:43:14.336141 10.0.0.233.5060 > 10.1.64.123.5060:  udp 518 (DF)
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.1.64.123;rport;branch=z9hG4bKaj2SKcUtUZ8KK;received=10.1.64.123
From: "phone 2" <sip:[EMAIL PROTECTED]>;tag=vmc3tt2tDca5F
To: "phone 2" <sip:[EMAIL PROTECTED]>;tag=as3b73c3ca
Call-ID: dd54dea4-6497-1229-b08d-77efeae39c02
CSeq: 68052788 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:[EMAIL PROTECTED]>
WWW-Authenticate: Digest realm="asterisk", nonce="37e581a5"
Content-Length: 0





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to