1 (9) Setup the Asterisk server with the Internet Gate This guide presents ways to setup the Asterisk server together with the Intertex Internet Gate. Below two different setups are described. Also, please check section. Contents 1FORWARD ALL SIP TRAFFIC TO THE ASTERISK SERVER...1 2FORWARD A SPECIFIC DOMAIN...3 3FORWARD AN IP ALIAS...4 4ASTERISK SETTINGS...6 5EXAMPLE SIP.CONF FILE...7 6EXAMPLE EXTENSIONS.CONF FILE...9 1 Forward all SIP traffic to the Asterisk server When using the Intertex Internet Gate in combination with the Asterisk server, you can have SIP hard/soft phones both on the WAN (e.g. the Internet) and on your LAN registered at your Asterisk server. The Intertex Internet Gate is by default SIP transparent. Local IP address: Internet IP address: 69.146.53.180 Static domain forwarding: 80.244.64.92 -> user@80.244.64.92 user@80.244.64.92
2 (9) 1. The easiest way to setup the Asterisk server is to place it on the LAN with manually assigned local IP address (e.g. ). 2. Surf into your Internet Gate (http://192.168.0.1) and (under SIP Advanced) setup a Static domain forwarding: Enter your public IP address (i.e. the Internet Gate WAN address) in the domain field, e.g. 80.244.64.92, and in the Forward to (IP) field the Asterisk server s local IP address, e.g.. Remember to save your settings. When you have setup user accounts on your Asterisk server, all of your SIP hard/soft phones can register on, make calls from and receive calls on the SIP address user@80.244.64.92. Remember that all SIP traffic now will be forwarded to the Asterisk server and that many of the Internet Gate s SIP features, such as Dial Plans, Short extension no, Authentication will be disabled. If desired you can setup a domain (static or dynamic DNS) with your Internet Gate. This enables you to be contacted on SIP addresses such as user@company.com. If you have a static DNS service, just point your domain address, e.g. company.com, at your public IP address, e.g. 80.244.64.92. If you have a dynamic DNS service, you can setup a dynamic DNS account in your Internet Gate (http://192.168.0.1/network/dyndns.asp).
3 (9) 2 Forward a specific domain If you would like to forward a specific domain for your SIP traffic you could choose another setup. With the Internet Gate you could at the same time have several domains pointing at services on your LAN (e.g. the domain company.com point at your web and ftp server and the companysip.com point at your asterisk server). Local IP address: Internet IP address: 80.244.64.92 Static domain forwarding: companysip.com -> user@ companysip.com user@ companysip.com Now let s say you would like to be contacted on the SIP address user@companysip.com, here is the setup: 1Place the Asterisk server on the LAN with manually assigned local IP address (e.g. ). 2If you have a static DNS, point your address, e.g. companysip.com, to your Internet Gate. If you have a dynamic DNS setup a dynamic DNS account in your Internet Gate (http://192.168.0.1/network/dyndns.asp).
4 (9) 3Surf into your Internet Gate (http://192.168.0.1) and enter a Static domain forwarding (under SIP Advanced) from the domain, e.g. companysip.com, to the Asterisk server s local IP address, e.g.. When you have setup user accounts on your Asterisk server, all of your SIP hard/soft phones can register on, make calls from and receive calls on the SIP address user@companysip.com. 3 Forward an IP alias If you rather would like users to be contacted on SIP addresses such as user@80.244.64.91, this is the preferred setup. When using the Intertex Internet Gate in combination with the Asterisk server, you can have SIP hard/soft phones both on the WAN (e.g. the Internet) and on your LAN registered at your Asterisk server. The Intertex Internet Local IP address: Internet IP address: 69.146.53.180 Static domain forwarding: 80.244.64.91 -> user@80.244.64.91 user@80.244.64.91 Gate is by default SIP transparent. The easiest way to setup the Asterisk server is to place it on the LAN with manually assigned local IP address. In order to let users be contacted on SIP addresses such as user@80.244.64.91, here is the setup:
5 (9) 1 Place the Asterisk server on the LAN with manually assigned local IP address (e.g. ). 2 Surf into your Internet Gate (http://192.168.0.1) and click Network below Configurations. At the bottom left, click Advanced. Now, at the top below Internet, you will find IP aliases. Enter the public IP address to the Asterisk server here, e.g. 80.244.64.91. 3 In your Internet Gate, enter a Static domain forwarding (under SIP Advanced) from the domain, e.g. 80.244.64.91, to the Asterisk server s local IP address, e.g.. When you have setup user accounts on your Asterisk server, all of your SIP hard/soft phones can register on, make calls from and receive calls on the SIP address user@80.244.64.91.
6 (9) 4 Asterisk settings NAT traversal Turn of any NAT traversal setup features in the Asterisk server. The Asterisk server should be configured just as it is on the Internet outside any NATs or Firewalls. For example, all peer definitions should have: Make sure that you comment out these lines in sip.conf: externip=200.201.202.203 localnet=192.168.1.0 localmask=255.255.255.0 Outbound Proxy When you use an Asterisk on the LAN with an Internet Gate you should always set the Outbound Proxy setting in sip.conf to the LAN IP address of the Internet Gate router (default 192.168.0.1). outboundproxy=192.168.0.1 Asterisk filters calls based on source IP address The Asterisk matches an incoming call to a peer object that then selects the context that should be used. The peer object can be found by source IP address of the SIP message and since the Internet Gate contains a SIP Proxy the IP address will be that of the SIP Proxy and not the remote callers IP address. If your Asterisk PBX rejects incoming calls passing through an Internet Gate router with a SIP response of 404 Not Found, 403 Forbidden or 407 Authentication Required this may be your problem. This may also be the problem if a call gets routed in a context you did not expect. When using Internet Gate routers you have to make sure you have a peer section that matches the IP address of the Internet Gate (default 192.168.0.1 on LAN). Adding a peer like this in sip.conf: [ig_sip_proxy_peer] type=peer context=inbound-sip-from-ig insecure=port,invite host=192.168.0.1 will do it. You should of course adapt this to the IP address of your Internet Gate unit and the context in extensions.conf you want to run for such calls. Without such a peer the SIP calls from Internet Gate box will be run in the default context.
7 (9) If you want to block certain source IP addresses or SIP users from calling you, we recommend you let the Internet Gate handle this functionality. You can enter additional firewall rules in the Internet Gate that block source IP addresses and you can use the Blacklist features on the SIP settings pages to block SIP users. Silent-suppression To be able to use the Asterisk server s IVR capabilities, remember that in order to get media out from the Asterisk server, it needs media input. Therefore, make sure to disable silent-suppression in your all of your SIP hard/soft phones, i.e. enable background comfort noise. Static domain forwarding [Firmware release 3.16 or earlier] If you are using static domain forwarding from the public WAN address to the Asterisk server, you should also check the "Disable username encoding (registrations)" in the SIP Advanced page. 5 Example sip.conf file ----------------------------------------------------------- /etc/asterisk/sip.conf ******************************************************************** [general] context=default port=5060 Port to bind to (SIP is 5060) bindaddr=0.0.0.0 Address to bind to (all addresses on machine) maxexpirey=3200 defaultexpirey=3000 notifymimetype=text/plain rtptimeout=60 rtpholdtimeout=300 dtmfmode=rfc2833 disallow=all allow=alaw allow=ulaw allow=gsm allow=g729 allow=g711 register => itspun:itsppassw@myitsp.com/555123 register with ITSP register => asterisk:asterisk@mysipproxy register with your Internet Gate ******************************************************************** [outboundpstn] outbound PSTN calls via ITSP type=peer username= itspun fromuser= itspun fromdomain=myitsp.com
8 (9) secret=itsppassw host=myitsp.com port=5060 qualify=no insecure=port,invite Allow incoming calls without authentication context=external-dialplan ******************************************************************** [inboundsip] inbound SIP calls via Internet Gate type=peer host=192.168.0.1 insecure=port,invite Allow incoming calls without authentication context=external-dialplan ******************************************************************** [outboundsip] outbound SIP calls via Internet Gate type=friend username=asterisk fromdomain=mysipproxy secret=asterisk host=mysipproxy port=5060 qualify=no insecure=port,invite Allow incoming calls without authentication context=external-dialplan ******************************************************************** [1234] local user type=friend username=1234 secret=pw1 host=dynamic context=internal-dialplan ******************************************************************** [2345] local user type=friend username=2345 secret=pw2 host=dynamic context=internal-dialplan
9 (9) 6) Example extensions.conf file ********************************************************************** /etc/asterisk/extensions.conf ********************************************************************** [external-dialplan] external users only allowed to call registered users exten => _XXXX,1,Dial(SIP/${EXTEN}) [internal-dialplan] internal users can call pstn and registered users exten => _XXXX,1,Dial(SIP/${EXTEN}) exten => _XXXXX.,1,Dial(SIP/${EXTEN}@outboundpstn) long numbers to pstn