Gateways connect legacy phone equipment (PBXs, ACDs, voicemail systems, etc.) to modern VoIP systems and services. Asterisk supports many different communications protocols from both the modern world of VoIP and from the legacy PSTN. This makes it a powerful tool for building gateways and protocol converters.

Below is a recipe for building a VoIP-to-PSTN gateway using Asterisk, an analog or digital telephony interface card and a standard PC server. The steps are as follows: 1. 2. 3. 4. 5. »

Select your telephony interface hardware. Select your computer hardware. Install Asterisk Configure your connections Build your gateway dialplan

Login or register to post comments

Voip Gateway
Submitted by cary113 on Fri, 03/12/2010 - 20:40. I love Voip phone service. I use it to run my fish finders company. This is really cool because my phone bills are virtually gone now. Thanks

Login or register to post comments

Submitted by raj7749 on Thu, 03/04/2010 - 08:46.

Note that not every Asterisk implementation requires telephony hardware.. ISDN BRI connections are digital telephone lines that have replaced analog lines in some places.but they do actually have a home. Connection Types Analog connections are commonly used in small businesses and homes. BRI is very popular in Germany and is also common in businesses in the UK. Calling them stray cats gives one the impression that these cats don’t have a home and that they wander around -. Asterisk connects with analog lines using an analog interface card that converts the voice and signaling information into Asterisk's native digital format. 03/04/2010 .. pure term paper | accounting assignment | annotated bibliography | assignments | computer programming assignment • Login or register to post comments Step 1: Select Your Telephony Hardware Asterisk applications that connect with legacy telephony systems (PBXs or the PSTN) require telephony interface hardware.. Larger systems (more than 12 lines) frequently use T1. T1 "trunks" or "spans" are the standard in the United States. ISDN can use either a two-wire "U" interface or a four-wire "S/T" interface. If you're new to it fesible to install asterisk on fedora core 12 unite.10:29. BRI connections can carry up to two conversations at the same time and support some advanced features not available with analog connections. check out the Asterisk telephony by clicking the "More" link below. Systems that are connected only by VoIP connections communicate using the host computer's Ethernet port. A T1 can carry as many as 24 simultaneous conversations. E1 or J1 digital connections. E1 and J1 are standards for high capacity telephony connections. Each analog connection uses a single pair of copper wires. which is the environment they live in! Some of these community cats have been residents in the environment for much longer than some of the residents. E1 . T1. we think the word ‘community’ better describes these cats. • Login or register to post comments we think the word ‘community’ Submitted by jinani7 on Thu. Small system generally use analog or ISDN BRI connections.

ranging from a single port (which connects a single analog telephone line and thus a single telephone call) up to a maximum 24 ports. External gateways connect with Asterisk over the local area network (LAN) or the PC's USB bus. J1 trunks are essentially the Japanese version of the US T1 standard. The other end of the cable plugs into a telco phone jack or an analog port on the legacy PBX. The most popular service type is ISDN PRI. Interface Hardware Asterisk connects with analog and digital telephony connections through either a gateway card that is installed in the host computer (the computer running Asterisk) or through an external gateway device. These are daughter modules (small circuit cards that attach to the main card) that determine the function of each of the ports on the popular throughout much of the rest of the world. (There are a few hybrid devices on the market that support both analog and ISDN-BRI. Internal gateway cards generally connect through the computer's internal expansion bus.) Analog Cards Analog cards are available in various capacities. For more information on both BRI and PRI forms of ISDN. T1/E1/J1 lines can also be used as data carriers for providing Internet or private data network services using the HDLC protocol. Each jack on the back of the card takes a single RJ-11 phone cable. and T1/E1/J1 devices.that is. ISDN-BRI. Cards typically fall into the same categories as telephony connections: analog. Analog ports can either connect to an analog line from the telephone company using a port . PRI circuits use what is known as "out-of-band" signaling -. E1 and J1 connections. Note in the image to the left that the card (an 8 port model made by Digium) the red blocks to the right-hand side of the card. Internal gateway cards are the most common means of connecting Asterisk to the PSTN or to a legacy telecom system. one of the 24 channels (T1) or two of the 32 channels (E1) is reserved for sending call management messages. Low density analog cards generally use the same kind of connector as most home and small business phone devices: the RJ-11 jack. E1s are slightly higher bandwidth and can carry up to 30 simultaneous calls. Cards are available in "PCI" and "PCI Express" (or PCIe) form factors. check out the Wikipedia article. There are several different services offered over T1.

This makes it simple to build an Asterisk-based application that can both connect to the PSTN and control analog devices like fax machines. Most analog card manufacturers build analog cards with interchangeable modules. thus a single port card is a "single span" device. Trunks are often referred to as "spans". The signaling capabilities of analog station ports are generally very limited. each of which connects to an individual digital circuit. Connections between the card and a telephone company T1 line are connected using a "straight-through" cable (exactly like the cables that . The limitation of this arrangement is the one-extension/one-port nature of PBX analog stations. E1 and J1 digital lines (sometimes called "trunks"). High density analog cards often use an RJ-21 (or "amphenol") connector and require an opposite gender RJ-21 connection from the telco or PBX. analog station ports on the PBX are connected to FXO ports on the Asterisk gateway card. a card can offer both FXO (line) and FXS (phone) capabilities. In this scenario. This 24 port card has been configured with three four-port FXS modules (green) and three four-port FXO modules (red).connected to an "FXO" module. while a four port card is a "quad span" device. This means that the port can only respond to calls to the single extension number with which it is associated. This allows it to connect 12 analog devices and 12 analog phone lines. Note the green modules on the card in the image to the left. By including both FXO and FXS modules. This means that FXS ports can be connected to "line" or "trunk" ports on the legacy system and can emulate telco analog lines. When the PBX sends a call to the cross-connected analog station port. FXO Ports In Analog Gateways Using FXO (line) ports to connect analog PBX ports with VoIP phones or remote VoIP servers is another common Asterisk gateway application. FXS ports provide dial tone and line voltage to a phone. credit card terminals or TDDs. or can power and control an analog phone using an "FXS" module. It therefore cannot be used as a shared connection between the PBX and the Asterisk (and whatever connects with the Asterisk). Digital Cards Digital cards allow Asterisk to connect with T1. exactly like the phone company's line does. Digital cards include one or more ports. key systems) with VoIP services generally use FXS ports. Most digital cards connect using RJ-45 jacks (the same kind of jack as is commonly used for Ethernet connections). FXS Ports In Analog Gateways VoIP gateways built to connect legacy equipment (PBXs. Asterisk forwards it as a VoIP call to the designated endpoint.

Large scale system that process thousands of simultaneous calls require significantly more horsepower and memory. Failure to provide proper ventillation can cause stability issues and can lead to premature failure of critical components. So while you can build an Asterisk server using a Start with a reasonably powerful and reliable server-class system as your platform. CPU and memory requirements vary depending on the application. Connections between the card and a local PBX or other "CPE" device require a "cross-over" cable or a straight-through cable with a cross-over adapter. While not required. Telephony systems are generally mission-critical components and therefore need to be as reliable as possible. 5 or 10) and dual power supplies. but when building a production telephony application server you should follow a few basic best-practice guidelines. (Note that the RJ-45 format is the current standard in North America but that physical form factors vary depending on region and telephone service provider. Phone lines and even short-distance tie line connections to legacy gear frequently suffer from line and network echo. The safest bet is to go with the most powerful CPU and the most memory that fits within your budget. be sure to find a model that supports hardware echo cancellation. [Hide] Step 2: Select Your Computer Hardware Asterisk can run on virtually any modern computer. Cards are available in PCI and PCI Express form factors and at a variety of voltages. If your application calls for TDM hardware. be sure that your server includes the correct type of card slot. See the "Select Your Telephony Hardware" section for more information on the various interconnect formats. it's generally a good idea to use a system with redundancy features including mirrored hard disk drives (RAID 1.connect Ethernet ports). Digital spans can be configured to carry telephone calls in several formats. Cooling is also an important issue.) When selecting your PSTN interface device. Click the "More" link below to learn the basic requirements for a solid Asterisk server. Hardware echo cancellation eliminates echo and provides a significantly better caller experience. PSTN interface cards can add to the overall heat load of the server. [Hide] . Small systems can be built on embedded processors using only a few megabytes of memory.

) Full details of the CentOS installation are beyond the scope of this tutorial.3 The first step is to download a copy of the CentOS 5. Most CentOS mirrors offer the distribution as either 5 CD images or a single DVD image. Several excellent quick-start tutorials can be found at Howto Forge. Be sure to select a secure root password when prompted. Asterisk and various related software packages.) is perfectly acceptable on systems used for development or unit testing. You will either need to install Linux or use a ready-to-run distribution to install Linux. Most mirrors host the CD images and a BitTorrent seed file for downloading the DVD image. Download CentOS Linux 5. Install CentOS To install CentOS Linux. including this one. To download the DVD image use a BitTorrent client. Either method works for the purposes of this tutorial. When building production servers or systems . insert the newly burned CD in the CD or DVD drive of the target computer and boot. (You can either adjust the boot order in the system BIOS or use a one-time boot menu if your system supports it. KDE. Since these application tutorials are intended to help you create custom telephony applications we will start with a generic installation of CentOS 5. IP Telephony systems are a frequent target for hackers and maintaining system security is extremely important. Use the CentOS 5 mirrors list to select a mirror.iso image to a computer with a CD or DVD burner (writer). etc. Note that if you are installing on virtual machine you can generally use the ISO image without burning it to physical media. In general it is safe to select the default options throughout the installation process.3 and then install Asterisk from the Yum repository. Be sure that your system is set to boot from the CD or DVD drive. Note that the installation of graphical environments (Gnome.iso To CDs or DVD Use your CD or DVD burner software to burn the ISO image to an actual CD. Download or copy the . Burn The CentOS . There are two supported system architectures available. download the 32-bit version. For more detailed installation instructions you can also refer to the CentOS Installation Guide . a 32-bit version of Linux and can run on either 32-bit or 64-bit systems. If in doubt.3 installation image. Keep in mind that the images are roughly 700 MB each and the DVD image is over 3 GB. and a 64-bit version that runs only on x86_64 hardware.Step 3: Install Linux & Asterisk Once you have your Asterisk hardware the next step is software. This make it relatively easy to keep Asterisk up to date and avoids the complexities of hand compiling the Asterisk source code.

Add the following text to the file: [asterisk-tested] name=CentOS-$releasever .digium. Add Asterisk Yum Repositories After the install is complete and your new CentOS Linux system is up and running.6 and install them.asterisk.asterisk.digium.asterisk.digium.Current baseurl=http://packages.Tested baseurl=$releasever/tested/$basearch/ enabled=0 gpgcheck=0 #gpgkey=http://packages.Asterisk .asterisk.Tested baseurl=http://packages.)$releasever/current/$basearch/ enabled=1 gpgcheck=0 #gpgkey= Save the new file and create another named "centos-digium. use the text editor of your choice to create a new file named "centos-asterisk. log in as the root user with the password you set during the [digium-current] name=CentOS-$releasever .Current baseurl=http://packages. Create a non-privileged user account for day to day operations. For a detailed view of sample output from the install see the Yum installation page.repo" in the "/etc/ [asterisk-current] name=CentOS-$releasever .Digium .repo" and insert the following text: [digium-tested] name=CentOS-$releasever .com/RPM-GPG-KEY-Digium Now you should be ready to install Asterisk.Asterisk .Digium .org/centos/$releasever/current/$basearch/ enabled=1 gpgcheck=0 #gpgkey=http://packages. (Note that you generally want to avoid logging in as root. . To start the installation. download the necessary packages for Asterisk 1.designed for load testing it is recommended that the graphical interfaces and subsystems (frame buffers) be$releasever/tested/$basearch/ enabled=0 gpgcheck=0 #gpgkey=http://packages. open a terminal window and type the following: [root@localhost~]# yum install asterisk16 asterisk16-configs asterisk16voicemail dahdi-linux dahdi-tools libpri The system will connect with the Asterisk and Digium yum servers.digium.repos.d" folder.

execute: [root@localhost~]# service asterisk stop Test Your Asterisk Installation Once the Asterisk service is started you should be able to access the Asterisk command line interface from the Linux command line as follows: [root@localhost~]# asterisk -r The system should respond with something similar to: Asterisk 1. This is free software. you now have Asterisk installed and running. run the following command: [root@localhost~]# chkconfig asterisk on To manually start Asterisk you can use the following: [root@localhost~]# service asterisk start To stop Asterisk. with components licensed under the GNU General Public License version 2 and other licenses. ========================================================================= Connected to Asterisk 1. To enable auto-start of Asterisk. To exit from the Asterisk CLI.15. type 'core show warranty' for details.When the installation is complete.2009 Digium. [Hide] Step 4: Configure Connections Now that Asterisk is installed and running you need to edit the system configuration files to implement connections to VoIP and PSTN services. Created by Mark Spencer Asterisk comes with ABSOLUTELY NO WARRANTY.6.0.15 currently running on localhost (pid = 3052) Verbosity is at least 3 localhost*CLI> Congratulations.6. By default DAHDi will start automatically. Copyright (C) 1999 . simply type 'exit'. Inc.0. reboot your system to activate Asterisk and DAHDi. Type 'core show license' for details. you are welcome to redistribute it under certain conditions. Since this step is common to all applications (Asterisk doesn't do much good if it is not connected to anything) it contains information on creating both service connections (connections to VoIP or PSTN services) and endpoint . and others.

conf file. This can be done using any standard text editor (emacs.2.connections (connections to phones or terminal adapters). kedit. To configure the cards you need to edit two files. # your manual changes will be LOST. The first file is the /etc/dahdi/system.25-47 # Global data loadzone defaultzone = us = us VoIP Connections .). # Dahdi Configuration File # # This file is parsed by the Dahdi Configurator. FXS draws more power than the PCI and PCI Express buses can provide. Below are configurations for both a system with one digital card (in T1 mode): # Autogenerated by /usr/sbin/dahdi_genconf on Wed Sep 23 08:25:39 2009 # If you edit this file and execute /usr/sbin/dahdi_genconf again. DAHDi Connections DAHDi is the "Digium Asterisk Hardware Device Interface" project and is the standard means for connecting Asterisk with PSTN interface cards. be sure that your cards are installed and properly connected to the computer. remember to connect one of the power connectors from the PC's power supply with the molex coupler on the edge of the card. Analog with FXO (line) interfaces only don't need the power connection. To configure your DAHDi interfaces.b8zs # termtype: te bchan=1-23 dchan=24 echocanceller=mg2. Some applications require both service and endpoint connections (PBX.e. your solution is VoIP-only) you can skip to the VoIP Connections section. gedit.esf.b8zs # termtype: te bchan=25-47 dchan=48 echocanceller=mg2. etc.esf. vim. ACD) while others may require only service connections. If your application doesn't require PSTN connections (i.1-23 # Span 2: TE2/0/2 "T2XXP (PCI) Card 0 Span 2" span=2.0. so the connection is mandatory. There are only a few options that need to be set in this file. dahdi_cfg # # Span 1: TE2/0/1 "T2XXP (PCI) Card 0 Span 1" (MASTER) span=1. vi.1. Note that you will need to be logged in as the root user to edit these files (or use the sudo command if your Linux distribution uses sudo instead of direct root access). This file configures the parameters for the low-level card drivers.0. If you are using analog cards with FXS (station) ports.

.. Please check back soon. Hide Step 5: Build Your Gateway Dialplan More info here.Over the next few days we will be filling in the remainder of these tutorials. . Sorry for any inconvenience.