Is the SIPquest server sending the 401 Unauthorized message verbatim as you printed it here?
I.e. is the WWW-Authentcate header broken up into several lines like that?
If so, how man spaces are actually at the beginning of each new line?
Continuation lines are allowed in SIP, but I think it's only one space at the beginning of each new line.
To make Asterisk parse this correctly you need to turn on
pedantic=yes


It's silly that Asterisk doesn't turn this header parsing on by default, no reason not to.
If this fixes your problem, you should edit the sip source code and remove the if clause
before calling lws2sws(blah blah) there is only one instance in the code.
pedantic=yes may break other things for you.



Cyrille Demaret wrote:

Hi,



I'm trying to register Asterisk with my sip provider but I've a problem. Here's the log file :



REGISTER sip:sip.aquanta.com SIP/2.0

Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK2810ee43

From: <sip:[EMAIL PROTECTED]>;tag=as2e43c573

To: <sip:[EMAIL PROTECTED]>

Call-ID: [EMAIL PROTECTED]

CSeq: 105 REGISTER

User-Agent: Asterisk PBX

Expires: 120

Contact: <sip:[EMAIL PROTECTED]>

Event: registration

Content-Length: 0



 (no NAT) to 212.3.244.8:5060

ziki5*CLI>



Sip read:

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK2810ee43

From: <sip:[EMAIL PROTECTED]>;tag=as2e43c573

To: <sip:[EMAIL PROTECTED]>; tag=lPaMk9ATvmCVvvGpOPJFkg

Call-ID: [EMAIL PROTECTED]

Cseq: 105 REGISTER

Date: Tue, 16 Nov 2004 17:23:15 GMT

Server: SIPquest-SIP-Server/2.2

Content-Length: 0

WWW-Authenticate: Digest realm="sip.aquanta.com",

        nonce="hDeaQQR5yOCHgx8YjKqI5zOcB1w=",

        stale=FALSE,

        algorithm=MD5,

        qop="auth"





14 headers, 0 lines

12 headers, 0 lines

Reliably Transmitting:

REGISTER sip:sip.aquanta.com SIP/2.0

Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK06fcb9f0

From: <sip:[EMAIL PROTECTED]>;tag=as2e43c573

To: <sip:[EMAIL PROTECTED]>;tag=lPaMk9ATvmCVvvGpOPJFkg

Call-ID: [EMAIL PROTECTED]

CSeq: 106 REGISTER

User-Agent: Asterisk PBX

Authorization: Digest username="0032123456789", realm="sip.aquanta.com", algorithm=MD5, uri="sip:sip.aquanta.com", nonce="", response="854c3960f84b454af9d25fcfdb0aaee4", opaque=""

Expires: 120

Contact: <sip:[EMAIL PROTECTED]>

Event: registration

Content-Length: 0



 (no NAT) to 212.3.244.8:5060

ziki5*CLI>



Sip read:

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK06fcb9f0

From: <sip:[EMAIL PROTECTED]>;tag=as2e43c573

To: <sip:[EMAIL PROTECTED]>;tag=lPaMk9ATvmCVvvGpOPJFkg

Call-ID: [EMAIL PROTECTED]

Cseq: 106 REGISTER

Date: Tue, 16 Nov 2004 17:23:15 GMT

Server: SIPquest-SIP-Server/2.2

Content-Length: 0

WWW-Authenticate: Digest realm="sip.aquanta.com",

        nonce="hDeaQQR5yOCHgx8YjKqI5zOcB1w=",

        stale=TRUE,

        algorithm=MD5,

        qop="auth"





14 headers, 0 lines

12 headers, 0 lines

Reliably Transmitting:

REGISTER sip:sip.aquanta.com SIP/2.0

Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK05c0559b

From: <sip:[EMAIL PROTECTED]>;tag=as2e43c573

To: <sip:[EMAIL PROTECTED]>;tag=lPaMk9ATvmCVvvGpOPJFkg

Call-ID: [EMAIL PROTECTED]

CSeq: 107 REGISTER

User-Agent: Asterisk PBX

Authorization: Digest username="0032123456789", realm="sip.aquanta.com", algorithm=MD5, uri="sip:sip.aquanta.com", nonce="", response="854c3960f84b454af9d25fcfdb0aaee4", opaque=""

Expires: 120

Contact: <sip:[EMAIL PROTECTED]>

Event: registration

Content-Length: 0



 (no NAT) to 212.3.244.8:5060

ziki5*CLI>



Sip read:

SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 123.123.123.123:5060;branch=z9hG4bK05c0559b

From: <sip:[EMAIL PROTECTED]>;tag=as2e43c573

To: <sip:[EMAIL PROTECTED]>;tag=lPaMk9ATvmCVvvGpOPJFkg

Call-ID: [EMAIL PROTECTED]

Cseq: 107 REGISTER

Date: Tue, 16 Nov 2004 17:23:15 GMT

Server: SIPquest-SIP-Server/2.2

Content-Length: 0

WWW-Authenticate: Digest realm="sip.aquanta.com",

        nonce="hDeaQQR5yOCHgx8YjKqI5zOcB1w=",

        stale=TRUE,

        algorithm=MD5,

        qop="auth"





14 headers, 0 lines

Nov 16 18:19:49 NOTICE[26352]: chan_sip.c:6768 handle_response: Failed to authenticate on REGISTER to '<sip:[EMAIL PROTECTED]>;tag=as2e43c573'

Destroying call '[EMAIL PROTECTED]'





It's seems that the nonce is not sended back to the server with de REGISTER packet.



I don't know if it's due to the \n in the "WWW-Authenticate" response. Do you think it's possible?



Thank you,



Sincerely,



Cyrille Demaret

------------------------------------------------------------------------

_______________________________________________
Asterisk-Users mailing list
[EMAIL PROTECTED]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users



_______________________________________________ Asterisk-Users mailing list [EMAIL PROTECTED] http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to