[Asterisk-Users] Setting up externip and local net for Asterisk behind NAT

Zeeshan zeeshan at acabling.com
Sun Nov 13 03:59:06 MST 2005


Hi everybody,
 
I was not successful to make my Asteirsk receive calls. Please help me
to set it up.
 
My Asterisk is behind a Linksys router.
My Local IP, i.e. Router's IP is 192.168.0.1
My External IP is 24.57.xxx.xxx
My Asterisk's IP is 192.168.0.105
My X-Lite's IP is 192.168.0.103 and it is on ext 201
My SIP provider's IP is 209.167.xxx.xxx
 
My extensions work fine, and X-Lite also successfully dials out.
But the problem begins when I dial to my Asterisk server from my other
phone which is 514-854-7804
 
On debugging, I get the following screen which shows that it is
successfully receiving the call but is not directing it to my extension
201, which is X-Lite.
 
===========================
Sip read: 
INVITE sip:s at 24.57.xxx.xxx SIP/2.0 
Via: SIP/2.0/UDP 209.167.xxx.xxx:5060;branch=z9hG4bK6cfbf611;rport 
From: "5148547804" ;tag=as664e8fb1 
To: 
Contact: 
Call-ID: 69fe681d36cf7497678dfdae625793f8 at 209.167.xxx.xxx 
CSeq: 102 INVITE 
User-Agent: Asterisk PBX 
Date: Sun, 13 Nov 2005 06:12:18 GMT 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER 
Content-Type: application/sdp 
Content-Length: 377 
 
v=0 
o=root 2173 2173 IN IP4 209.167.xxx.xxx 
s=session 
c=IN IP4 209.167.xxx.xxx
t=0 0 
m=audio 11448 RTP/AVP 18 97 110 111 0 8 3 101 
a=rtpmap:18 G729/8000 
a=rtpmap:97 iLBC/8000 
a=rtpmap:110 speex/8000 
a=rtpmap:111 G726-32/8000 
a=rtpmap:0 PCMU/8000 
a=rtpmap:8 PCMA/8000 
a=rtpmap:3 GSM/8000 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-16 
a=silenceSupp:off - - - - 
 
Nov 12 22:03:00 VERBOSE[1430]: 12 headers, 16 lines
Nov 12 22:03:00 DEBUG[1430]: ##### Testing 209.167.xxx.xxx with
192.168.0.0
Nov 12 22:03:00 DEBUG[1430]: Target address 209.167.xxx.xxx is not
local, substituting externip
Nov 12 22:03:00 VERBOSE[1430]: Using latest request as basis request
Nov 12 22:03:00 VERBOSE[1430]: Sending to 209.167.xxx.xxx : 5060 (NAT)
Nov 12 22:03:00 VERBOSE[1430]: Found peer '209.167.xxx.xxx'
Nov 12 22:03:00 DEBUG[1430]: Setting NAT on RTP to 0
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 18
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 97
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 110
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 111
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 0
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 8
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 3
Nov 12 22:03:00 VERBOSE[1430]: Found RTP audio format 101
Nov 12 22:03:00 VERBOSE[1430]: Peer audio RTP is at port
209.167.xxx.xxx:11448
Nov 12 22:03:00 DEBUG[1430]: Peer audio RTP is at port
209.167.xxx.xxx:11448
Nov 12 22:03:00 VERBOSE[1430]: Found description format G729
Nov 12 22:03:00 VERBOSE[1430]: Found description format iLBC
Nov 12 22:03:00 VERBOSE[1430]: Found description format speex
Nov 12 22:03:00 VERBOSE[1430]: Found description format G726-32
Nov 12 22:03:00 VERBOSE[1430]: Found description format PCMU
Nov 12 22:03:00 VERBOSE[1430]: Found description format PCMA
Nov 12 22:03:00 VERBOSE[1430]: Found description format GSM
Nov 12 22:03:00 VERBOSE[1430]: Found description format telephone-event
Nov 12 22:03:00 VERBOSE[1430]: Capabilities: us - 0xc (ulaw|alaw), peer
- audio=0x71e (gsm|ulaw|alaw|g726|g729|speex|ilbc)/video=0x0 (nothing),
combined - 0xc (ulaw|alaw)
Nov 12 22:03:00 VERBOSE[1430]: Non-codec capabilities: us - 0x1 (g723),
peer - 0x1 (g723), combined - 0x1 (g723)
Nov 12 22:03:00 DEBUG[1430]: Check for res for 
Nov 12 22:03:00 DEBUG[1430]: is not a local user
Nov 12 22:03:00 VERBOSE[1430]: Looking for s in ravi
Nov 12 22:03:00 VERBOSE[1430]: Reliably Transmitting (no NAT):
SIP/2.0 404 Not Found 
Via: SIP/2.0/UDP 209.167.xxx.xxx:5060;branch=z9hG4bK6cfbf611 
From: "5148547804" ;tag=as664e8fb1 
To: ;tag=as10f3cdea 
Call-ID: 69fe681d36cf7497678dfdae625793f8 at 209.167.xxx.xxx 
CSeq: 102 INVITE 
User-Agent: Asterisk PBX 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER 
Contact: 
Content-Length: 0
===========================
 
My sip.conf is
 
===========================
[general]
 
port = 5060
bindaddr = 0.0.0.0
disallow=all
allow=ulaw
allow=alaw
nat=yes
externip=24.57.xxx.xxx
fromdomain=209.167.xxx.xxx
localnet=192.168.0.1/255.255.255.0
context = external
 
register=555555558:47076 at 209.167.97.165
 
[201]
username=201
type=friend
secret=1111
qualify=no
port=5060
nat=yes
host=dynamic
dtmfmode=rfc2833
context=internal
canreinvite=no
callerid="Home Phone" <201>
 
[trunk]
username=555555558
type=peer
secret=47076
host=209.167.xxx.xxx
 
[trunk_incoming]
type=user
secret=47076
host=209.167.xxx.xxx
===========================
 
My extensions.conf has following lines to deal with incoming SIP calls
===========================
[external]
exten => _X.,1,Dial(SIP/201,60,tr)

===========================
 
Please tell me where am i making mistake. If somebody else has same
setup as mines, i'll appreciate if you can send me your sip.conf and
extensions.conf
 
Thanks,
Zeeshan A Zakaria




More information about the asterisk-users mailing list