I build a server in my LAN with IP address 192.168.1.79
and I build a nat rule on my router to translate port 5060 to the server
when i install x-lite in the LAN (192.168.1.179) , every thing is OK , and if i use x-lite on the computer with a public IP , it’s also worked, but if the x-lite is in a NAT net , it never worked , and i will got a 401 Unauthorized message . I think it would be something wrong about nat setting .
then i got a hard phone in the LAN (192.168.1.100), after all the setting , finally i got a 401 Unauthorized too , i was in puzzle .
if i use “sip show peers” i can see the hard phone
following is the debug message
Sip read:
REGISTER sip:192.168.1.79 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bKm7PkeFhrT
Max-Forwards: 70
User-Agent: PHONE
From: “1300” sip:1300@192.168.1.79;tag=seI9Ly4MDgRC7DC4
To: “1300” sip:1300@192.168.1.79
Call-ID: Irc2xoxzOivTISZ2@192.168.1.100
CSeq: 15441 REGISTER
Contact: sip:1300@192.168.1.100:5060
Expires: 60
Content-Length: 0
11 headers, 0 lines
Using latest request as basis request
Sending to 192.168.1.100 : 5060 (non-NAT)
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bKm7PkeFhrT
From: “1300” sip:1300@192.168.1.79;tag=seI9Ly4MDgRC7DC4
To: “1300” sip:1300@192.168.1.79
Call-ID: Irc2xoxzOivTISZ2@192.168.1.100
CSeq: 15441 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:1300@192.168.1.79
Content-Length: 0
to 192.168.1.100:5060
Transmitting (no NAT):
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bKm7PkeFhrT
From: “1300” sip:1300@192.168.1.79;tag=seI9Ly4MDgRC7DC4
To: “1300” sip:1300@192.168.1.79;tag=as437d3df5
Call-ID: Irc2xoxzOivTISZ2@192.168.1.100
CSeq: 15441 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:1300@192.168.1.79
WWW-Authenticate: Digest realm=“asterisk”, nonce="354a857a"
Content-Length: 0
to 192.168.1.100:5060
Scheduling destruction of call ‘Irc2xoxzOivTISZ2@192.168.1.100’ in 15000 ms
asterisk*CLI>
Sip read:
REGISTER sip:192.168.1.79 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bKW4N1ezT6g
Max-Forwards: 70
User-Agent: PHONE
From: “1300” sip:1300@192.168.1.79;tag=tv2AWSNqHSUbnevS
To: “1300” sip:1300@192.168.1.79
Call-ID: Irc2xoxzOivTISZ2@192.168.1.100
CSeq: 15442 REGISTER
Contact: sip:1300@192.168.1.100:5060
Expires: 60
Authorization: Digest username=“1300”, realm=“asterisk”, nonce=“354a857a”, uri=“sip:192.168.1.79”, response="d278a4e0c77e3ec28fbfd26cf49a2c92"
Content-Length: 0
12 headers, 0 lines
Using latest request as basis request
Sending to 192.168.1.100 : 5060 (non-NAT)
Transmitting (no NAT):
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bKW4N1ezT6g
From: “1300” sip:1300@192.168.1.79;tag=tv2AWSNqHSUbnevS
To: “1300” sip:1300@192.168.1.79
Call-ID: Irc2xoxzOivTISZ2@192.168.1.100
CSeq: 15442 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: sip:1300@192.168.1.79
Content-Length: 0
to 192.168.1.100:5060
Transmitting (no NAT):
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bKW4N1ezT6g
From: “1300” sip:1300@192.168.1.79;tag=tv2AWSNqHSUbnevS
To: “1300” sip:1300@192.168.1.79;tag=as437d3df5
Call-ID: Irc2xoxzOivTISZ2@192.168.1.100
CSeq: 15442 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Expires: 60
Contact: sip:1300@192.168.1.100:5060;expires=60
Date: Mon, 05 Sep 2005 09:28:36 GMT
Content-Length: 0
to 192.168.1.100:5060
Scheduling destruction of call ‘Irc2xoxzOivTISZ2@192.168.1.100’ in 15000 ms