[Home]

Summary:ASTERISK-07219: can't parse WWW-Authenticate: Header correctly
Reporter:Jin Ke Jiang (jjk)Labels:
Date Opened:2006-06-22 03:10:08Date Closed:2011-06-07 14:07:21
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Registration
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:I capture the packet in ethereal, the
WWW-Authenticate Header format is correctly parsed. According to RFC 3261, the format of the Header is correct, but Asterisk can't get the nonce correctly.

the raw header format is as follow:

WWW-Authenticate: Digest realm="zte",\r\n\t        nonce="4c5f4edd30bd4c1f7a0fa315ecbbbb3f",\r\n\tZTE-ID=c042aaa7643fd6007340d00960e3e99c^M



****** ADDITIONAL INFORMATION ******

The message I got.

[code]
SIP/2.0 401 Unauthorized^M
Via: SIP/2.0/UDP x.x.x.x:5082;received=x.x.x.x;rport=5082;branch=z9hG4bK1b1c8e7c^M
To: <sip:10111160008@x.x.x.x>^M
From: <sip:10111160008@x.x.x.x>;tag=as2ad07e05^M
Call-ID: 06fbc91c22011d2a308fd3b33fd90248@127.0.0.1^M
CSeq: 104 REGISTER^M
User-Agent: ZTE-SoftSwitch^M
WWW-Authenticate: Digest realm="zte",^M
       nonce="4c5f4edd30bd4c1f7a0fa315ecbbbb3f",^M
       ZTE-ID=c042aaa7643fd6007340d00960e3e99c^M
Event: registration^M
^M

^@^M--- (11 headers 0 lines)---
^@Responding to challenge, registration to domain/host name x.x.x.x
^@REGISTER 13 headers, 0 lines
^@^M^[[Klocalhost*CLI> ^MREGISTER attempt 4 to 10111160008@x.x.x.x
^@Reliably Transmitting (no NAT) to 211.96.x.x:5060:
REGISTER sip:211.96.x.x SIP/2.0^M
Via: SIP/2.0/UDP 202.x.x.x:5082;branch=z9hG4bK767a1104;rport^M
From: <sip:10111160008@211.96.x.x>;tag=as1f7b53d9^M
To: <sip:10111160008@211.96.x.x>^M
Call-ID: 06fbc91c22011d2a308fd3b33fd90248@127.0.0.1^M
CSeq: 105 REGISTER^M
User-Agent: BOL2000.COM CallingCard Platform^M
Max-Forwards: 70^M
Authorization: Digest username="10111160008", realm="zte", algorithm=MD5, uri="sip:211.96.x.x", nonce="", response="e0e996de5dc1efffa8dcb8ce37513633", opaque=""^M
Expires: 600^M
Contact: <sip:s@202.64.x.x:5082>^M
Event: registration^M
Content-Length: 0^M
^M
[/code]
Comments:By: Olle Johansson (oej) 2006-06-22 09:54:26

Turn pedantic on in sip.conf and test again.

By: Joshua C. Colp (jcolp) 2006-06-22 09:56:41

Can you try setting pedantic to yes in the general section of your sip.conf, looks like they're sending the header as a multiline one and I don't believe we parse that by default.

By: Jin Ke Jiang (jjk) 2006-06-23 00:10:38

Yes, that solve the problem, thanks a lot!