[asterisk-users] can't get pap2 to register from outside the LAN.

Michael Wyres mwyres at cdm.com.au
Mon Nov 23 20:38:53 CST 2009


I would without the "deny" and "permit" directives in the SIP, and rule out some sort of clash there that is rejecting the address the registration is coming from, and take it from there.


-----Original Message-----
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tim Uckun
Sent: Tuesday, 24 November 2009 12:26
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] can't get pap2 to register from outside the LAN.

I am having a hell of a problem trying to get a linksys pap2t to
register with my asterisk from outside the LAN.

I have tried every combination of NAT, outbound proxy, stun, specify
external IP address etc and it just won't work.  Here are the relevant
details.

In asterisk I have set the following.

externip=my.ip.address
localnet=192.168.0.0/255.255.0.0
nat=yes
bindport=5060


here is the sip user

deny=0.0.0.0/0.0.0.0
type=friend
secret=blah
qualify=yes
port=5060
pickupgroup=
permit=0.0.0.0/0.0.0.0
nat=yes
mailbox=372 at device
host=dynamic
dtmfmode=rfc2833
dial=SIP/372
context=from-internal
canreinvite=no
callgroup=
callerid=device <372>
accountcode=
call-limit=50


I have tried nat = no, nat=never, nat=route, and leaving out the nat
no difference.

On the linksys end I have tried everything I can think of. Nat, no
nat, stun, hard coded external IP address etc. I have read dozens of
web sites and have tried every suggestion given but no joy.

I know other people have had the same problem but none of the links I
ran into had a solution that worked for me.

This device connects perfectly when inside the lan, take it out and it
won't connect no matter what I do.


Here is the sip debug trace. What truly puzzles me is the 401 not
authorized packets. The password is correct, it connects fine inside
the lan but the same username and password fails outside the LAN.


 <------------>
[Nov 24 14:18:41]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>;tag=as1f31845b
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0dc307da"
Content-Length: 0


<------------>
[Nov 24 14:18:41] Scheduling destruction of SIP dialog
'f4e6d9bc-59a7c482 at 192.168.50.183' in 32000 ms (Method: REGISTER)
[Nov 24 14:18:42]  ip
<--- SIP read from 218.101.6.157:5060 --->
REGISTER sip:203.109.148.108 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.183:5060;branch=z9hG4bK-26ca393d
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
Max-Forwards: 70
Contact: 372 <sip:372 at 192.168.50.183:5060>;expires=3600
User-Agent: Linksys/PAP2T-5.1.6(LS)
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura, replaces


<------------->
[Nov 24 14:18:42] --- (12 headers 0 lines) ---
[Nov 24 14:18:42] Using latest REGISTER request as basis request
[Nov 24 14:18:42] Sending to 218.101.6.157 : 5060 (NAT)
[Nov 24 14:18:42]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:372 at 203.109.148.108>
Content-Length: 0


<------------>
[Nov 24 14:18:42]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>;tag=as1f31845b
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0dc307da"
Content-Length: 0


<------------>
[Nov 24 14:18:42] Scheduling destruction of SIP dialog
'f4e6d9bc-59a7c482 at 192.168.50.183' in 32000 ms (Method: REGISTER)
[Nov 24 14:18:44]  ip
<--- SIP read from 218.101.6.157:5060 --->
REGISTER sip:203.109.148.108 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.183:5060;branch=z9hG4bK-26ca393d
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
Max-Forwards: 70
Contact: 372 <sip:372 at 192.168.50.183:5060>;expires=3600
User-Agent: Linksys/PAP2T-5.1.6(LS)
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura, replaces


<------------->
[Nov 24 14:18:44] --- (12 headers 0 lines) ---
[Nov 24 14:18:44] Using latest REGISTER request as basis request
[Nov 24 14:18:44] Sending to 218.101.6.157 : 5060 (NAT)
[Nov 24 14:18:44]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:372 at 203.109.148.108>
Content-Length: 0


<------------>
[Nov 24 14:18:44]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>;tag=as1f31845b
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0dc307da"
Content-Length: 0


<------------>
[Nov 24 14:18:44] Scheduling destruction of SIP dialog
'f4e6d9bc-59a7c482 at 192.168.50.183' in 32000 ms (Method: REGISTER)
[Nov 24 14:18:48]  ip
<--- SIP read from 218.101.6.157:5060 --->
REGISTER sip:203.109.148.108 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.183:5060;branch=z9hG4bK-26ca393d
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
Max-Forwards: 70
Contact: 372 <sip:372 at 192.168.50.183:5060>;expires=3600
User-Agent: Linksys/PAP2T-5.1.6(LS)
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura, replaces


<------------->
[Nov 24 14:18:48] --- (12 headers 0 lines) ---
[Nov 24 14:18:48] Using latest REGISTER request as basis request
[Nov 24 14:18:48] Sending to 218.101.6.157 : 5060 (NAT)
[Nov 24 14:18:48]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:372 at 203.109.148.108>
Content-Length: 0


<------------>
[Nov 24 14:18:48]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>;tag=as1f31845b
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0dc307da"
Content-Length: 0


<------------>
[Nov 24 14:18:48] Scheduling destruction of SIP dialog
'f4e6d9bc-59a7c482 at 192.168.50.183' in 32000 ms (Method: REGISTER)
[Nov 24 14:18:52]  ip
<--- SIP read from 218.101.6.157:5060 --->
REGISTER sip:203.109.148.108 SIP/2.0
Via: SIP/2.0/UDP 192.168.50.183:5060;branch=z9hG4bK-26ca393d
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
Max-Forwards: 70
Contact: 372 <sip:372 at 192.168.50.183:5060>;expires=3600
User-Agent: Linksys/PAP2T-5.1.6(LS)
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: x-sipura, replaces


<------------->
[Nov 24 14:18:52] --- (12 headers 0 lines) ---
[Nov 24 14:18:52] Using latest REGISTER request as basis request
[Nov 24 14:18:52] Sending to 218.101.6.157 : 5060 (NAT)
[Nov 24 14:18:52]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:372 at 203.109.148.108>
Content-Length: 0


<------------>
[Nov 24 14:18:52]
<--- Transmitting (NAT) to 218.101.6.157:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP
192.168.50.183:5060;branch=z9hG4bK-26ca393d;received=218.101.6.157
From: 372 <sip:372 at 203.109.148.108>;tag=e25fccc07a79cd65o0
To: 372 <sip:372 at 203.109.148.108>;tag=as1f31845b
Call-ID: f4e6d9bc-59a7c482 at 192.168.50.183
CSeq: 26779 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="0dc307da"
Content-Length: 0


<------------>
[Nov 24 14:18:52] Scheduling destruction of SIP dialog
'f4e6d9bc-59a7c482 at 192.168.50.183' in 32000 ms (Method: REGISTER)
sip*CLI> sip debug ip

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
IMPORTANT NOTICE TO RECIPIENT

Computer viruses - It is your responsibility to scan this email and any attachments for viruses and defects and rely on those scans as Communications Design & Management Pty Limited (CDM) does not accept any liability for loss or damage arising from receipt or use of this email or any attachments.

Confidentiality - This email and any attachments are intended for the named recipient only and may contain personal information, be it confidential or subject to privilege, none of which are lost or waived because this email may have been sent to you in error. If you are not the named addressee please let CDM know by return email, permanently delete it from your system and destroy all copies and do not use or disclose the contents.

Copyright - This email is subject to copyright and no part of it maybe reproduced in any manner without the written permission of the copyright owner.

Privacy - Within the jurisdiction of Australian law, personal information in this email must be dealt with in compliance with the Australian Federal Privacy Act 1988.




More information about the asterisk-users mailing list