Voip Asterisk Getway
Voip Asterisk Getway
Voip Asterisk Getway
org/applications/gateway
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:
Voip Gateway
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
hey
we think the word ‘community’ better describes these cats. Calling them stray cats gives one the
impression that these cats don’t have a home and that they wander around -- but they do actually
have a home, 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. pure term paper |
accounting assignment | annotated bibliography | assignments | computer programming
assignment
Note that not every Asterisk implementation requires telephony hardware. Systems that are
connected only by VoIP connections communicate using the host computer's Ethernet port.
Connection Types
Analog connections are commonly used in small businesses and homes. Each analog connection
uses a single pair of copper wires. Asterisk connects with analog lines using an analog interface
card that converts the voice and signaling information into Asterisk's native digital format.
ISDN BRI connections are digital telephone lines that have replaced analog lines in some places.
BRI is very popular in Germany and is also common in businesses in the UK. BRI connections
can carry up to two conversations at the same time and support some advanced features not
available with analog connections. ISDN can use either a two-wire "U" interface or a four-wire
"S/T" interface.
T1, E1 and J1 are standards for high capacity telephony connections. T1 "trunks" or "spans" are
the standard in the United States. A T1 can carry as many as 24 simultaneous conversations. E1
is popular throughout much of the rest of the world. E1s are slightly higher bandwidth and can
carry up to 30 simultaneous calls. J1 trunks are essentially the Japanese version of the US T1
standard.
There are several different services offered over T1, E1 and J1 connections. The most popular
service type is ISDN PRI. PRI circuits use what is known as "out-of-band" signaling -- that is,
one of the 24 channels (T1) or two of the 32 channels (E1) is reserved for sending call
management messages.
T1/E1/J1 lines can also be used as data carriers for providing Internet or private data network
services using the HDLC protocol.
For more information on both BRI and PRI forms of ISDN, check out the Wikipedia article.
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. Internal gateway cards generally connect through the computer's internal
expansion bus. Cards are available in "PCI" and "PCI Express" (or PCIe) form factors. External
gateways connect with Asterisk over the local area network (LAN) or the PC's USB bus.
Internal gateway cards are the most common means of connecting Asterisk to the PSTN or to a
legacy telecom system. Cards typically fall into the same categories as telephony connections:
analog, ISDN-BRI, and T1/E1/J1 devices. (There are a few hybrid devices on the market that
support both analog and ISDN-BRI.)
Analog Cards
Analog cards are available in various capacities, ranging from a single port (which connects a
single analog telephone line and thus a single telephone call)
up to a maximum 24 ports.
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. These are daughter modules (small circuit cards that
attach to the main card) that determine the function of each of
the ports on the card. Analog ports can either connect to an
analog line from the telephone company using a port
connected to an "FXO" module, or can power and control an analog phone using an "FXS"
module.
Most analog card manufacturers build analog cards with interchangeable modules. By including
both FXO and FXS modules, a card can offer both FXO (line) and FXS (phone) capabilities.
This makes it simple to build an Asterisk-based application that can both connect to the PSTN
and control analog devices like fax machines, credit card terminals or TDDs.
VoIP gateways built to connect legacy equipment (PBXs, key systems) with VoIP services
generally use FXS ports. FXS ports provide dial tone and line voltage to a phone, exactly like the
phone company's line does. This means that FXS ports can be connected to "line" or "trunk"
ports on the legacy system and can emulate telco analog lines.
Using FXO (line) ports to connect analog PBX ports with VoIP phones or remote VoIP servers is
another common Asterisk gateway application. In this scenario, analog station ports on the PBX
are connected to FXO ports on the Asterisk gateway card. When the PBX sends a call to the
cross-connected analog station port, Asterisk forwards it as a VoIP call to the designated
endpoint.
The limitation of this arrangement is the one-extension/one-port nature of PBX analog stations.
The signaling capabilities of analog station ports are generally very limited. This means that the
port can only respond to calls to the single extension number with which it is associated. 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, E1 and J1 digital lines
(sometimes called "trunks"). Digital cards include one or more ports,
each of which connects to an individual digital circuit. Trunks are often
referred to as "spans", thus a single port card is a "single span" device,
while a four port card is a "quad span" device. Most digital cards connect
using RJ-45 jacks (the same kind of jack as is commonly used for
Ethernet connections). Connections between the card and a telephone
company T1 line are connected using a "straight-through" cable (exactly like the cables that
connect Ethernet ports). 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.
Digital spans can be configured to carry telephone calls in several formats. (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.)
When selecting your PSTN interface device, be sure to find a model that supports hardware
echo cancellation. Phone lines and even short-distance tie line connections to legacy gear
frequently suffer from line and network echo. Hardware echo cancellation eliminates echo and
provides a significantly better caller experience.
[Hide]
Cooling is also an important issue. PSTN interface cards can add to the overall heat load of the
server. Failure to provide proper ventillation can cause stability issues and can lead to premature
failure of critical components.
CPU and memory requirements vary depending on the application. Small systems can be built on
embedded processors using only a few megabytes of memory. Large scale system that process
thousands of simultaneous calls require significantly more horsepower and memory. The safest
bet is to go with the most powerful CPU and the most memory that fits within your budget.
If your application calls for TDM hardware, be sure that your server includes the correct type of
card slot. Cards are available in PCI and PCI Express form factors and at a variety of voltages.
See the "Select Your Telephony Hardware" section for more information on the various
interconnect formats.
[Hide]
Step 3: Install Linux & Asterisk
Once you have your Asterisk hardware the next step is software. You will either need to install
Linux or use a ready-to-run distribution to install Linux, Asterisk and various related software
packages. Since these application tutorials are intended to help you create custom telephony
applications we will start with a generic installation of CentOS 5.3 and then install Asterisk from
the Yum repository. This make it relatively easy to keep Asterisk up to date and avoids the
complexities of hand compiling the Asterisk source code.
Download or copy the .iso image to a computer with a CD or DVD burner (writer). Keep in mind
that the images are roughly 700 MB each and the DVD image is over 3 GB.
Install CentOS
To install CentOS Linux, insert the newly burned CD in the CD or DVD drive of the target
computer and boot. Be sure that your system is set to boot from the CD or DVD drive. (You can
either adjust the boot order in the system BIOS or use a one-time boot menu if your system
supports it.)
Full details of the CentOS installation are beyond the scope of this tutorial. Several excellent
quick-start tutorials can be found at Howto Forge, including this one. For more detailed
installation instructions you can also refer to the CentOS Installation Guide . In general it is safe
to select the default options throughout the installation process. Be sure to select a secure root
password when prompted. IP Telephony systems are a frequent target for hackers and
maintaining system security is extremely important.
Note that the installation of graphical environments (Gnome, KDE, etc.) is perfectly acceptable
on systems used for development or unit testing. When building production servers or systems
designed for load testing it is recommended that the graphical interfaces and subsystems (frame
buffers) be omitted.
Now, use the text editor of your choice to create a new file named "centos-asterisk.repo" in the
"/etc/yum.repos.d" folder. Add the following text to the file:
[asterisk-tested]
name=CentOS-$releasever - Asterisk - Tested
baseurl=http://packages.asterisk.org/centos/$releasever/tested/$basearch/
enabled=0
gpgcheck=0
#gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium
[asterisk-current]
name=CentOS-$releasever - Asterisk - Current
baseurl=http://packages.asterisk.org/centos/$releasever/current/$basearch/
enabled=1
gpgcheck=0
#gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium
Save the new file and create another named "centos-digium.repo" and insert the following text:
[digium-tested]
name=CentOS-$releasever - Digium - Tested
baseurl=http://packages.digium.com/centos/$releasever/tested/$basearch/
enabled=0
gpgcheck=0
#gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium
[digium-current]
name=CentOS-$releasever - Digium - Current
baseurl=http://packages.digium.com/centos/$releasever/current/$basearch/
enabled=1
gpgcheck=0
#gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium
Now you should be ready to install Asterisk. To start the installation, open a terminal window
and type the following:
The system will connect with the Asterisk and Digium yum servers, download the necessary
packages for Asterisk 1.6 and install them. For a detailed view of sample output from the install
see the Yum installation page.
When the installation is complete, reboot your system to activate Asterisk and DAHDi. By
default DAHDi will start automatically. To enable auto-start of Asterisk, run the following
command:
[root@localhost~]# asterisk -r
Asterisk 1.6.0.15, Copyright (C) 1999 - 2009 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for
details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it
under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.6.0.15 currently running on localhost (pid = 3052)
Verbosity is at least 3
localhost*CLI>
Congratulations, you now have Asterisk installed and running. To exit from the Asterisk CLI,
simply type 'exit'.
[Hide]
DAHDi Connections
DAHDi is the "Digium Asterisk Hardware Device Interface" project and is the standard means
for connecting Asterisk with PSTN interface cards. If your application doesn't require PSTN
connections (i.e. your solution is VoIP-only) you can skip to the VoIP Connections section.
To configure your DAHDi interfaces, be sure that your cards are installed and properly
connected to the computer. If you are using analog cards with FXS (station) ports, remember to
connect one of the power connectors from the PC's power supply with the molex coupler on the
edge of the card. FXS draws more power than the PCI and PCI Express buses can provide, so the
connection is mandatory. Analog with FXO (line) interfaces only don't need the power
connection.
To configure the cards you need to edit two files. This can be done using any standard text editor
(emacs, vi, vim, gedit, kedit, etc.). 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). The first file is the /etc/dahdi/system.conf file. This file configures the parameters for the
low-level card drivers. There are only a few options that need to be set in this file. Below are
configurations for both a system with one digital card (in T1 mode):
# Global data
loadzone = us
defaultzone = us
VoIP Connections
Over the next few days we will be filling in the remainder of these tutorials. Sorry for any
inconvenience. Please check back soon.
Hide