[Asterisk-Users] SIP register problem

Karl Brose khb at brose.com
Tue Nov 16 11:05:28 MST 2004


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:0032123456789 at sip.aquanta.com>;tag=as2e43c573
>
> To: <sip:0032123456789 at sip.aquanta.com>
>
> Call-ID: 6b8b4567327b23c6643c986966334873 at 123.123.123.123
>
> CSeq: 105 REGISTER
>
> User-Agent: Asterisk PBX
>
> Expires: 120
>
> Contact: <sip:s at 123.123.123.123>
>
> 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:0032123456789 at sip.aquanta.com>;tag=as2e43c573
>
> To: <sip:0032123456789 at sip.aquanta.com>; tag=lPaMk9ATvmCVvvGpOPJFkg
>
> Call-ID: 6b8b4567327b23c6643c986966334873 at 123.123.123.123
>
> 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:0032123456789 at sip.aquanta.com>;tag=as2e43c573
>
> To: <sip:0032123456789 at sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
>
> Call-ID: 6b8b4567327b23c6643c986966334873 at 123.123.123.123
>
> 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:s at 123.123.123.123>
>
> 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:0032123456789 at sip.aquanta.com>;tag=as2e43c573
>
> To: <sip:0032123456789 at sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
>
> Call-ID: 6b8b4567327b23c6643c986966334873 at 123.123.123.123
>
> 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:0032123456789 at sip.aquanta.com>;tag=as2e43c573
>
> To: <sip:0032123456789 at sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
>
> Call-ID: 6b8b4567327b23c6643c986966334873 at 123.123.123.123
>
> 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:s at 123.123.123.123>
>
> 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:0032123456789 at sip.aquanta.com>;tag=as2e43c573
>
> To: <sip:0032123456789 at sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
>
> Call-ID: 6b8b4567327b23c6643c986966334873 at 123.123.123.123
>
> 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:0032123456789 at sip.aquanta.com>;tag=as2e43c573'
>
> Destroying call '6b8b4567327b23c6643c986966334873 at 123.123.123.123'
>
>  
>
>  
>
> 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
>Asterisk-Users at lists.digium.com
>http://lists.digium.com/mailman/listinfo/asterisk-users
>To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>  
>




More information about the asterisk-users mailing list