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@sip.aquanta.com>;tag=as2e43c573
To: <sip:0032123456789@sip.aquanta.com>
Call-ID: 6b8b4567327b23c6643c986966334873@123.123.123.123
CSeq: 105 REGISTER
User-Agent: Asterisk PBX
Expires: 120
Contact: <sip:s@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@sip.aquanta.com>;tag=as2e43c573
To: <sip:0032123456789@sip.aquanta.com>; tag=lPaMk9ATvmCVvvGpOPJFkg
Call-ID: 6b8b4567327b23c6643c986966334873@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@sip.aquanta.com>;tag=as2e43c573
To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
Call-ID: 6b8b4567327b23c6643c986966334873@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@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@sip.aquanta.com>;tag=as2e43c573
To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
Call-ID: 6b8b4567327b23c6643c986966334873@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@sip.aquanta.com>;tag=as2e43c573
To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
Call-ID: 6b8b4567327b23c6643c986966334873@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@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@sip.aquanta.com>;tag=as2e43c573
To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg
Call-ID: 6b8b4567327b23c6643c986966334873@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@sip.aquanta.com>;tag=as2e43c573'
Destroying call '6b8b4567327b23c6643c986966334873@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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20041116/f107a005/attachment.htm
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@sip.aquanta.com>;tag=as2e43c573 > > To: <sip:0032123456789@sip.aquanta.com> > > Call-ID: 6b8b4567327b23c6643c986966334873@123.123.123.123 > > CSeq: 105 REGISTER > > User-Agent: Asterisk PBX > > Expires: 120 > > Contact: <sip:s@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@sip.aquanta.com>;tag=as2e43c573 > > To: <sip:0032123456789@sip.aquanta.com>; tag=lPaMk9ATvmCVvvGpOPJFkg > > Call-ID: 6b8b4567327b23c6643c986966334873@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@sip.aquanta.com>;tag=as2e43c573 > > To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg > > Call-ID: 6b8b4567327b23c6643c986966334873@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@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@sip.aquanta.com>;tag=as2e43c573 > > To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg > > Call-ID: 6b8b4567327b23c6643c986966334873@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@sip.aquanta.com>;tag=as2e43c573 > > To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg > > Call-ID: 6b8b4567327b23c6643c986966334873@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@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@sip.aquanta.com>;tag=as2e43c573 > > To: <sip:0032123456789@sip.aquanta.com>;tag=lPaMk9ATvmCVvvGpOPJFkg > > Call-ID: 6b8b4567327b23c6643c986966334873@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@sip.aquanta.com>;tag=as2e43c573' > > Destroying call '6b8b4567327b23c6643c986966334873@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@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 > >
Hi all, We have two asterisk PBX. We would like to register it with SIP peer. The client sends the register request. It gets back: Jan 2 01:31:27 WARNING[186]: chan_sip.c:9760 handle_response_register: Got 404 Not found on SIP register to service sipteszt1@217.xxx.32.207, giving up server: Sip.conf [general] context=blackbox-in ; Default context for incoming calls realm=xxxxxxx bindport=5061 ; UDP Port to bind to (SIP standard port is 5060) bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) srvlookup=yes ; Enable DNS SRV lookups on outbound calls [sipteszt] type=user context=siporka username=sipteszt1 fromuser=sipteszt1 secret=password accountcode=sipteszt host=dynamic disallow=all ;allow=ilbc ;allow=speex allow=gsm allow=speex allow=alaw nat=yes notransfer=yes canreinvite=no qualify=no [sipteszt] type=peer fromuser=sipteszt1 username=sipteszt1 secret=password accountcode=sipteszt host=dynamic disallow=all ;allow=ilbc ;allow=speex allow=gsm allow=speex allow=alaw notransfer=yes canreinvite=no qualify=yes Client: sip.conf [general] context=default ; Default context for incoming calls accountcode=sip bindport=5060 ; UDP Port to bind to (SIP standard port is 5060) bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all) srvlookup=yes ; Enable DNS SRV lookups on outbound calls callevents=yes ; generate manager events when sip ua performs events (e.g. hold) subscribecontext=ext-local-custom register => sipteszt:password@217.xxx.32.207/sipteszt [sipteszt] type=peer host=217.xxx.32.207 fromuser=sipteszt1 fromdomainusername=sipteszt1 secret=password dtmfmode=rfc2833 canreinvite=no disallow=all allow=alaw allow=gsm allow=ilbc nat=no qualify=no accountcode=12 trunktimestamps=no ; incoming peer from 217.xxx.32.207 [sipteszt-in] type=user host=217.xxx.32.207 username=sipteszt1 context=incoming dtmfmode=rfc2833 disallow=all allow=alaw allow=gsm allow=ilbc accountcode=12 trunktimestamps=no Kind regards Szolke
You changed your default SIP (bindport) port to 5061 at the server, so your client needs to look there. Try like these register => sipteszt:password@217.xxx.32.207:50/sipteszt bindport=5061 ; UDP Port to bind to (SIP standard port is 5060) Adri? Vidal