In sip.conf I suggest you use the externip feature which will allow asterisk to put the correct IP address in its SIP packets. See http://www.voip-info.org/w
Main Topics
Browse All TopicsI have a pix firewall and an asterisk computer behind it. I have 2 grandstream telephones outside of the pix and behind linksys firewalls. We can dial each other, but we can not hear each other. How do I setup this up to hear each other.
Also I have to use qualify=2000 to keep the port open, but if the network is slow, the phone does not return back quick enough, is there a time out value I can set long to avoid this situation?
Here are the config files for the pix, asterisk, and sip:
Saved
:
PIX Version 6.3(3)
interface ethernet0 auto
interface ethernet1 100full
nameif ethernet0 outside security0
nameif ethernet1 inside security100
hostname cenetstptrsrtr01
domain-name inetstptrsds.local
fixup protocol dns maximum-length 1024
fixup protocol ftp 21
fixup protocol h323 h225 1720
fixup protocol h323 ras 1718-1719
fixup protocol http 80
fixup protocol rsh 514
fixup protocol rtsp 554
fixup protocol sip 5060
fixup protocol sip udp 5060
fixup protocol skinny 2000
fixup protocol smtp 25
fixup protocol sqlnet 1521
fixup protocol tftp 69
names
object-group service RTP udp
description For SIP
port-object range 10000 20000
object-group service SIP udp
description SIP port 5060-5061
port-object eq 5060
access-list 102 permit tcp any host 67.103.170.6 eq 3389
access-list 102 permit tcp any host 67.103.170.7 eq 3389
access-list 102 permit tcp any host 67.103.170.6 eq pop3
access-list 102 permit tcp any host 67.103.170.6 eq smtp
access-list 102 permit tcp any host 67.103.170.7 eq https
access-list 102 permit tcp any host 67.103.170.7 eq www
access-list 102 permit tcp any host 67.103.170.8 eq www
access-list 102 permit tcp any host 67.103.170.9 eq www
access-list 102 permit tcp any host 67.103.170.10 eq www
access-list 102 permit tcp any host 67.103.170.11 eq www
access-list 102 permit tcp any host 67.103.170.12 eq www
access-list 102 permit tcp any host 67.103.170.13 eq www
access-list 102 permit tcp any host 67.103.170.14 eq www
access-list 102 permit tcp any host 67.103.170.15 eq www
access-list 102 permit esp any any
access-list 102 permit udp any any eq isakmp
access-list 102 permit udp any any eq 4500
access-list 102 permit udp any any eq 10000
access-list 102 permit tcp any host 67.103.170.18 eq www
access-list 102 permit udp any host 67.103.170.3 range 5004 5082
access-list 102 permit tcp any host 67.103.170.3 range 5004 5082
access-list 102 permit udp any host 67.103.170.3 range 10000 20000
access-list 102 permit tcp any host 67.103.170.3 range 10000 20000
access-list 102 permit udp any host 67.103.170.3 eq 4569
access-list 102 permit tcp any host 67.103.170.3 eq 4569
access-list 102 permit tcp any host 67.103.170.3 eq www
access-list 102 permit tcp any host 67.103.170.3 eq ssh
access-list 102 permit tcp any host 67.103.170.7 eq ssh
access-list 102 permit tcp any host 67.103.170.7 eq smtp
access-list 102 permit tcp any host 67.103.170.7 eq pop3
access-list 102 permit tcp any host 67.103.170.6 eq www
access-list 102 permit tcp any host 67.103.170.3 eq smtp
access-list 102 permit tcp any host 67.103.170.3 eq pop3
access-list 102 permit tcp any host 67.103.170.3 eq https
access-list nonat permit ip 192.168.2.0 255.255.255.0 192.168.254.0 255.255.255.0
access-list nonat permit ip 192.168.2.0 255.255.255.0 192.168.3.0 255.255.255.0
access-list vpnlist permit ip 192.168.2.0 255.255.255.0 192.168.3.0 255.255.255.0
access-list VPN_SPLIT permit ip 192.168.2.0 255.255.255.0 192.168.254.0 255.255.255.0
pager lines 24
logging monitor debugging
mtu outside 1500
mtu inside 1500
ip address outside 67.103.170.5 255.255.255.240
ip address inside 192.168.2.251 255.255.255.0
ip audit info action alarm
ip audit attack action alarm
ip local pool VPN_POOL 192.168.254.1-192.168.254.
pdm logging informational 100
pdm history enable
arp timeout 14400
global (outside) 1 67.103.170.2
nat (inside) 0 access-list nonat
nat (inside) 1 0.0.0.0 0.0.0.0 0 0
static (inside,outside) tcp 67.103.170.6 pop3 192.168.2.22 pop3 netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.6 smtp 192.168.2.22 smtp netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.6 3389 192.168.2.22 3389 netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.7 3389 192.168.2.20 3389 netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.7 www 192.168.2.22 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.7 https 192.168.2.22 https netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.8 www 192.168.2.8 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.9 www 192.168.2.9 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.10 www 192.168.2.10 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.11 www 192.168.2.11 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.12 www 192.168.2.12 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.13 www 192.168.2.13 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.14 www 192.168.2.14 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 67.103.170.15 www 192.168.2.15 www netmask 255.255.255.255 0 0
static (inside,outside) 67.103.170.4 192.168.2.99 netmask 255.255.255.255 0 0
static (inside,outside) 67.103.170.3 192.168.2.2 netmask 255.255.255.255 0 0
access-group 102 in interface outside
conduit permit udp any object-group RTP any
conduit permit udp any object-group SIP any
route outside 0.0.0.0 0.0.0.0 67.103.170.1 1
route outside 192.168.254.0 255.255.255.0 67.103.170.1 1
timeout xlate 0:05:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 rpc 0:10:00 h225 1:00:00
timeout h323 0:05:00 mgcp 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout uauth 0:05:00 absolute
aaa-server TACACS+ protocol tacacs+
aaa-server RADIUS protocol radius
aaa-server LOCAL protocol local
http server enable
no snmp-server location
no snmp-server contact
snmp-server community public
no snmp-server enable traps
floodguard enable
sysopt connection permit-ipsec
telnet 0.0.0.0 0.0.0.0 inside
telnet timeout 5
ssh 0.0.0.0 0.0.0.0 outside
ssh 0.0.0.0 0.0.0.0 inside
ssh timeout 60
console timeout 0
dhcpd lease 3600
dhcpd ping_timeout 750
dhcpd auto_config outside
terminal width 80
: end
Here is my asterisk rtp configuration
;
; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
; Defaults are rtpstart=5000 and rtpend=31000
;
rtpstart=10000
rtpend=20000
;
; Whether to enable or disable UDP checksums on RTP traffic
;
;rtpchecksums=no
;
; The amount of time a DTMF digit with no 'end' marker should be
; allowed to continue (in 'samples', 1/8000 of a second)
;
;dtmftimeout=3000
~
~
~
sip.conf
[1131]
type=friend
nat=yes
canreinvite=yes
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=alaw
username=1131
secret=1131
host=dynamic
context=druid-default
callerid="1131" <1131>
mailbox=1131@default
video=no
restrictcid=no
qualify=2000
[1130]
type=friend
nat=yes
canreinvite=yes
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=alaw
username=1130
secret=1130
host=dynamic
context=druid-default
callerid="1130" <1130>
mailbox=1130@default
video=no
restrictcid=no
qualify=2000
Thanks
Eric
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
In sip.conf I suggest you use the externip feature which will allow asterisk to put the correct IP address in its SIP packets. See http://www.voip-info.org/w
I just got a Grandstream working this week with Asterisk, but it had to have an entry for STUN server. It is behind a NAT firewall - very similar to your setup. You can specify any stun server - it doesn't have to be one run by your service provider. e.g. stun.sipgate.net
The settings I am using on my Grandstream are:
local SIP port: 5060
local RTP port: 5004
Use random port: No
NAT Traversal: Yes, STUN server is: stun.sipgate.net
keep-alive interval: 20
Use NAT IP: <none>
Proxy-Require: <none>
If that doesn't work, you need to investigate why the RTP media isn't getting through your NAT firewalls. You might even be able to use port forwarding on the Linksys. RTP media uses UDP. On the pix you need to let UDP 10000 to 20000 through (you probably already do, but I am not familiar with pix). No NAT - or failing that dedicated one-to-one NAT - is the best option for the Asterisk server if possible.
I think you are slightly missing the point. The whole purpose of a STUN server is that it must be on the remote (WAN) side of your NAT router. Your phone communicates with it only very occassionally - e.g. when the phone is rebooted - and the STUN server performs a few simple tests then it tells your phone the outcome of those tests. For example it tells the phone what external IP address it appears to be on and what type of NAT router it is behind. This information is then used whenever the phone needs to communicate with a SIP server, such as Asterisk. It allows the phone to give better information to the SIP server about how it may be contacted through NAT.
It doesn't matter that you don't have a service provider. I don't either. You can still use other people's STUN servers because there is no login or authentication required. All you need to know is the IP address or URL. I gave you an example - stun.sipgate.net. It is a bit like using an NTP time server - the provider doesn't charge for the service and all you need to know is the address of their server.
I assume the Linksys firewalls are also NAT routers. If so, then the Grandstream Status screen should be showing something like this:
NAT: Detected NAT type is full cone
NAT Mapped IP: <the Internet IP address of the Linksys>
NAT mapped port: 33950 (or whatever)
If it was showing "open Interent connection" then it got it wrong and has no hope of working.
All I can suggest is that you try again. Set the STUN server as already described, then power off the Grandstream for several minutes, then power it back on again. Preferably, wait for (or force) the phone to stop being registered on Asterisk before you power it back on.
In my experience, specifying a STUN server is more often helpful than not. However, SIP through NAT (or worse still through double NAT) is still a black art and what works for one case may not work for all. If you want some other suggestions:
1. Try port forwarding on the Linksys for tcp port 5060, plus for all udp ports between 5000 and 50000. Forward to the Grandstream. If that works, try refining the range of udp ports set for forwarding (you will always need 5060, but the range required for the media packets shouldn't need to be so wide as I suggested)
2. Make it so the Asterisk server is not connected to the Internet through NAT (if it is)
3. Use "sip debug" on the Asterisk to examine the SIP packets when you make a call. You might be lucky and be able to see what is going wrong by examining the SIP messages and looking at the IP addresses being used.
4. Try other routes for calls to/from the Grandstream - i.e. not just one Grandstream to the other via Asterisk. Set a script in Asterisk that will just play a voice file when it is called. Can you hear the voice file when you call that service using each Grandstream.
5. Set up a site-to-site VPN tunnel from the Linksys to the pix and send all your VoIP traffic through the tunnel. I expect you would need a more upmarket router than the Linksys for this to be possible. You would also want to use compression such as G.729 to reduce the load going through the VPN tunnel, but that means buying licenses for the Asterisk.
6. Replace the Linksys firewall/router with a UK Draytek Vigor 2100VG (or similar) that has the VoIP phone built-in to the router because this avoids the need to traverse NAT and you just plug an ordinary POTS phone into the Draytek. The Draytek routers sold in the UK can be used with any SIP service, but in the US they are locked to specific SIP service providers so are unsuitable for use with Asterisk.
Business Accounts
Answer for Membership
by: feptiasPosted on 2006-09-14 at 01:33:42ID: 17518710
In the Grandstreams, have you set a STUN server?