Page 126 - Asterisk™: The Future of Telephony
P. 126

The following configuration should get you connected with an Internet Telephony
                                    *
               Service Provider (ITSP),  although it is impossible to know the unique configurations
               each service provider will require from you, and ideally the provider will give you the
               configuration required to connect your system with its own. However, not all are going
               to support Asterisk, so we’re going to provide you with a generic configuration which
               should help you get on your way and, ideally, going in a matter of minutes:

                   [my_service_provider]
                   type=peer
                   host=10.251.55.100
                   fromuser=my_unique_id
                   secret=my_special_secret
                   context=incoming_calls
                   dtmfmode=rfc2833
                   disallow=all
                   allow=gsm
                   allow=ulaw
                   deny=0.0.0.0/0
                   permit=10.251.55.100/32
                   insecure=invite


                                       Configuring a Local Firewall

                  If you’re running iptables on the same machine as the Asterisk box, then you can run
                  the following commands to open port 5060 for SIP signaling, and ports 10,000 through
                  20,000 for the RTP traffic. You can also narrow the range of RTP ports in the rtp.conf
                  file located in /etc/asterisk. An excellent book on iptables firewalls is Linux Firewalls by
                  Steve Suehring and Robert Ziegler (Novell Press).
                   # iptables -I RH-Firewall-1-INPUT -p udp --dport 5060 -j ACCEPT
                   # iptables -I RH-Firewall-1-INPUT -p udp --dport 10000:20000 -j ACCEPT
                   # service iptables save
                  Be aware that this will allow all UDP traffic from any source access to ports 5060 and
                  10,000 through 20,000.



               Most of the previous configuration may be familiar to you by now, but in case it’s not,
               here is a brief rundown.
               By defining the type as a peer, we are telling Asterisk not to match on the [my_serv
               ice_provider] name, but rather to match on the IP address in the INVITE message
               (when the provider is sending us a call). The host parameter is the IP address that we’ll
               place our calls to, and the IP address we’ll be matching on when receiving a call from
               the provider.


               # Be sure to check the policy of any service provider you are looking to connect with, as some of them may not
                 allow you to use a PBX system with its service.
               * Also known as a VoIP Service Provider (VSP).

               98 | Chapter 4: Initial Configuration of Asterisk
   121   122   123   124   125   126   127   128   129   130   131