Sunteți pe pagina 1din 5

2008 International Conference on Computer and Electrical Engineering

Asterisk Voice Exchange: An Alternative to Conventional EPBX

Mohammed A Qadeer Ale Imran


Department of Computer Engineering, Department of Electronics Engineering,
Aligarh Muslim University, Aligarh, India Aligarh Muslim University, Aligarh, India
maqadeer@zhcet.ac.in aleimran@zhcet.ac.in

Abstract

This paper highlights the design and


implementation aspects of a VoIP based Asterisk voice
exchange, Developing a fully functional voice
exchange requires to set up a server based on Asterisk,
connecting clients to that server with the help of soft
phones and then configuring the softphones with the
server. Here in our implementation we have connected
the clients to the server with the help of IAX protocols.
The first part of the paper contains some introductory
concepts about VoIP, followed by Asterisk’s internal Fig1:Diagrammatic View of VoIP
architecture. In the third part of the paper we discuss
about the codecs and protocols used by the packet
switching based PBX networks and finally we brush up This concept allowed PC users to avoid long
about the design and implementation aspects. distance charges, hence great for international calling
and a promising solution to the corporate world. In fact
Keywords-VoIP, PBX, IAX, SIP, Asterisk, Trunk. one of the main areas of its applications are the call-
centers, where the customer is able to communicate
I. Introduction with an operator via the internet. Recently there have
been proposals in various countries to allow internet
The development of Asterisk based Voice telephony, which is indeed a welcome step. This means
Exchange and its applications needs to take into that people can use VoIP services to connect to the
account the growing complexity with the existing PBX traditional telephone. In this case call travels across the
(private branch exchange) networks [1]. A promising IP network, but terminates at the local phone network,
solution is the voice exchange based on Asterisk, whose owner than charges a fee that is typically the
which works on VoIP [2] (voice over internet price of a local call [3]. Unrestricted VoIP, which is the
protocols) and provides a more promising and flexible basic building block of Asterisk based voice exchange
solution. VoIP technology originated in about 1995, makes it possible for people to use their phones either
when hobbyists began to realize the potential of fixed or mobile to call others in the country and
sending voice data packets over the internet rather than internationally for a fraction of the prices they pay
communicating through standard telephone systems. now. all that one needs to make a PC to PC call is a
The idea is to use the internet as a telephone network VoIP based software .
with some additional capabilities. Instead of
communicating over a circuit switched network, this Besides this, Engg economics also plays an
application allows communication between two parties important role in popularizing this new concept. A
over the packet switched internet and it was in 1995, normal telephonic call requires 64 kbps, whereas the
when the first internet softphone appeared. same can be handled an as low as 6-8kbps using
codecs such as GSM. Hence the bandwidth
requirements will be considerably reduced and one can
stuff up, more calls in the same given bandwidth,

978-0-7695-3504-3/08 $25.00 © 2008 IEEE 652


DOI 10.1109/ICCEE.2008.176
providing a clear cut advantage. In thhe future people PBX core system. This advanceed core handles the
will stop paying for voice calls just like they don’t pay internal interconnection of the PBX
X, cleanly abstracted
for each e-mail they sent or each sitee they view. Of from the specific protocols, cod decs, and hardware
course a service provider would chharge a fee for interfaces from the telephony appliications. This allows
providing internet services, but everrything you did Asterisk to use any suitable hardwware and technology
beyond that point wouldn’t carry any eextra cost .But in available now or in the future to perform
p its essential
a future where everyone will always bbe connected the functions, connecting hardware andd applications.
convergence several commentators haave been talking
about will finally become a reality. The Asterisk core handles these items internally [5]
PBX Switching The essence of Asterisk,
A of course, is
a Private Branch Exchange Switching system,
2. Asterisk as a Voice exchangee connecting calls together between n various users and
automated tasks. The Switching Core transparently
Private Branch Exchange is sim mply a private connects callers arriving on varrious hardware and
telephone network which is used withinn a organization. software interfaces.
PBX systems are large installations able to handle Application Launcher launchess applications which
many extensions. PBX systemss are highly
perform services for uses, such as voicemail, file
programmable and customizable, able to meet the playback, and directory listing.
needs and demands of different businessses[1]. Codec Translator uses codecc modules for the
encoding and decoding of variouss audio compression
formats used in the telephony ind dustry. A number of
codecs are available to suit diversee needs and arrive at
the best balance between audio qu uality and bandwidth
usage.
Scheduler and I/O Manager haandles low-level task
Fig 2: A conventional PB
BX scheduling and system manageement for optimal
performance under all load conditio ons
Asterisk is a complete PBX in softwware written in C
programming language and it runs on Linux operating
systems. Asterisk does voice overr IP in many
protocols, and can interoperate w with almost all
standards-based telephony equipment using relatively
inexpensive hardware like for ex PCI cards[4].
Asterisk in fact creates a PBX that rivals the
functionalities of traditional telephonee based systems.
Asterisk based voice exchange is cosst effective, low
maintenance and flexible enough to hhandle all voice Fig 4: Asterisk’s Arch
hitecture
and data networking .Asterisk does PBX switching,
CODEC translation and various other aapplications like 2.2. Loadable Module API’S
voicemail, conference bridging, IVR R and various
others. Four APIs are defined for loadable modules,
facilitating hardware and protocol abstraction. Using
this loadable module system, the Asterisk core does
not have to worry about details of how a caller is
connecting, what codecs are in use etc.

Channel API The channel API handles the type of


connection a caller is arriving on, be it a VoIP
connection, ISDN, PRI, Robbed biit signaling, or some
other technology. Dynamic mod dules are loaded to
Fig 3: Overview of Asterisk ssystem
handle the lower layer details of theese connections.
2.1. Asterisk’s Architecture Application API The applicatiion API allows for
various task modules to be run to perform various
Asterisk is carefully designed for maximum functions. Conferencing, Paging, Directory Listing.
flexibility. Specific APIs are defined aaround a central

653
Voicemail, In-line data transmission, and any other technologies are SIP and H.323[7]. SIP is an
task which a PBX system might perform now or in the application layer protocol, designed to be independent
future are handled by these separate modules. of the underlying transport layers and is used for
Codec Translator API Loads codec modules to establishing, managing and terminating a multimedia
support various audio encoding and decoding formats session.. In fact SIP is a text based protocol just like
such as GSM, Mu-Law, A-law, and even MP3. HTTP protocol and its lightweight approach towards
File Format API Handles the reading and writing of setting up a call is what makes it quite a popular choice
various file formats for the storage of data in the file for VoIP based networks [2].
system.
Using these APIs Asterisk achieves a complete
abstraction between its core functions as a PBX server
system and the varied technologies existing (or in
development) in the telephony arena. The modular
form is what allows Asterisk to seamlessly integrate
both currently implemented telephony switching
hardware and the growing Packet Voice technologies
emerging today[2]. The ability to load codec modules Fig 5: SIP call set up
allows Asterisk to support both the extremely compact
codecs necessary for Packet Voice over slow IAX is the Inter Asterisk Protocol used by Asterisk
connections such as a telephone modem while still and is a alternative to SIP ,H.323..Its generally used to
providing high audio quality over less constricted enable VoIP connections between servers and between
connections. The application API provides for flexible servers and clients.IAX is a very robust and fully
use of application modules to perform any function featured protocol yet its quite simple.. It is agnostic to
flexibly on demand, and allows for open development codecs and number of streams, meaning that it can be
of new applications to suit unique needs and situations. used as a transport for virtually any type of data.
In addition, loading all applications as modules allows [5]This capability will be useful as videophones
for a flexible system, allowing the administrator to becoming common.IAX supports both trunking and
design the best suited path for callers on the PBX multiplexing of the channels on the same link. In fact
system and modify call paths to suit the changing. the basic goals for which IAX was designed were 1)
Reduction in Bandwidth used in media transmissions
2) To provide basic support for NAT transparency and
3. Codecs and Protocols 3) To be easy to use behind firewalls.

Asterisk is quite versatile and has been designed


such that it can use a wide range of codecs and
protocols. Codecs are the mean with the help of which Fig 6: IAX could be easily used beyond firewalls
analog signals can be converted to digital and
transmitted via an IP network. Both SIP and IAX generally show the same
efficiency for lower no of simultaneous calls; however
Table 1: Various Codecs Used by Asterisk [3] as number of calls generally goes on increasing, IAX
takes the lead in performance over SIP.

4. Implementing the Asterisk Based Voice


Exchange
We have installed Fedora 4 Linux to implement
Asterisk and begin realizing our voice exchange by
VoIP generally uses two types of protocols 1). compiling the Asterisk and IAX has been used to
Signaling Protocols-for setting up a conversation 2) connect multiple clients with the server.
Media transfer protocols for actual transfer of data, The following commands help us in compiling the
once the connection has been set.[6] To obtain good Asterisk.
voice quality across the network we need to minimize
the packet losses, jitter, and use echo cancellation cd/root/sam/asterisk
techniques .Generally used protocols for VoIP based make

654
make install For setting up a client on IAX client on Asterisk we do
make samples the following:
make progdocs
;[imran]
;type=friend
;secret=2222
;auth=md5
;host=dynamic
;reinvite=no
;canreinvite=no
;qualify=1000
;dtmfmode=inband;callerid="imran"<2222>
Fig7: Snapshot after the complete installation ;disallow=all
;allow=gsm
;context=incoming
Once it has been successfully installed we can start
Asterisk on the server by running the following
commands

/root/sam/asterisk-vvvc

4.1. Asterisk’s Dial Plan


The dial plan is stored in a text file, the
configuration file extensions.conf. In this file actions
are connected to extensions. Each extension belongs to Fig 8: IAX.conf file
a context, either the default context or a specific
context you create, like incoming sip calls, long- Whereas for setting up the Extensions on the
distance outbound PSTN calls, local calls, inter-office Asterisk server we do the following:
calls, etc. Users connecting to asterisk all belong to a For editing the Extensions configuration file
specific context (specified in the channel configuration /etc/asterisk/extensions.conf
file), which is where asterisk looks for advice on how [inbound-from-iax];
to handle the calls placed by that user, checking the Our context for IAX- clients
access rights to expensive lines, with different rule sets exten => extension no, priority, application
for local users and contacts calling from an outside (argl,arg2,...)
line. exten => 1111,1,Dial(IAX2/${EXTEN})
• /etc/asterisk exten => 2222,1,Dial(IAX2/${EXTEN})
Contains all of asterisk configuration files and exten => 3333,1,Dial(IAX2/${EXTEN})
logic information. exten => 4444,1,Dial(IAX2/${EXTEN})
• /usr/lib/asterisk/modules exten => 5555,1,Dial(IAX2/${EXTEN})
Contains all of asterisk’s loadable modules, exten => 6666,1,Dial(IAX2/${EXTEN})
operating asterisk functionality.
Applications, channels and resources are located
in this directory.
• /var/lib/asterisk/sounds
Contains all of asterisk’s sound files for playback
and pre-loaded applications (eg: VoiceMail).
• /var/lib/asterisk/agi-bin
Contains all of asterisk’s AGI scripts and AGI
logic.
Fig 9: Extensions.conf file
4.2. Configuring the Files
We configure the IAX and the Extensions at the Once we are done with this, we need to concentrate
following: on the installation and registration of the soft phones
IAX: /etc/asterisk/iax.conf that we are going to use at the client end.
Extensions: /etc/asterisk/extensions.conf

655
yet done the connection of our server with the
conventional PSTN, though it could be done with the
help of PCI cards like for example Digium’s
TDM400P to validate the connectivity with the
existent circuit switched network
A S T E R IS K P B X
H o s t: H o m e
P h o n e L in e c o n n e c te d to F X O c a r d
PSTN
SER VER A

S IP C L IE N T S @ S c h o o l

S IP C L IE N T S @ H o m e
4001@ school
3001@ hom e

IN T E R N E T

4002@ school
3002@ hom e

2001
1001 1002

A S T E R IS K P B X
A n a l o g p h o n e s co n n e c te d t o F X S c a rd
H o s t: S c h o o l
2002

Fig 11: IDEFISK softphones being registered on the


SER VER B

A n a lo g p h o n e s c o n n e c t e d
to F X S c a r d

server
Fig 12: Experimental set up of Asterisk based voice
Asterisk PBX currently support 4 types of exchange
extension: Zap (TDM), SIP (VoIP), IAX2 (VoIP) and a
custom extension. By utilizing the various options, 5. Conclusion and Future Work
enclosed within each extension, it is possible to
manipulate each extension’s behavior. The custom We expect that design and implementation
extension can be utilized to program special presented in this paper will be a valuable developing
functionality extensions, enabling the creation of guide for similar kind of operations. Asterisk based
extensions binded services, such as MicroBilling, voice exchange provides us with a much better
Information gathering, etc. Once an extension had been alternative solution. Its not only cost effective but also
defined, several optional parameters can be modified, provides us with various features which we generally
in order to complement the default settings..Special don’t get with the conventional circuit switched based
attention must be given to NAT traversal issues and PBX. Moreover the system also provides for unlimited
DTMF issues, when working with IAX based expansion and since it runs on a secure operating
extensions. system like LINUX, its much less prone to viruses,
You use a trunk to carry a call (or any number of worms and hackers. As far as future work is concerned,
calls) to a Voice Service Provider or a device that cares we would like to connect our Asterisk PBX with the
about what number you send to it (eg, another conventional circuit switched networks with the help of
Asterisk™/FreePBX™ Machine). There are 5 types of PCI cards like for example Digium’s TDM400P [7] .
trunks supported:
• Zap Trunk – Zap trunks provide connectivity 6. References
to legacy TDM systems via Analog interfaces
(FXO/FXS) or Digital interfaces (E1/T1). [1] Andre du Toit, “Private PBX Networks: Cost Effective
• IAX2 Trunk – IAX2 trunks provide Communication Solutions” in Proc. IEEE 3rd AFRICON Conference
interconnecting between Asterisk™ servers, 1992.
utilizing the Inter-Asterisk Exchange [2] Guo Fang Mao, Alex Talevski, Elizabeth Chang, ”Voice over
Protocol. Internet Protocol on mobile devices” in Proc. 6th IEEE ICIS 2007.
• SIP Trunk – SIP trunks provide
interconnecting between Asterisk™ and SIP [3] Md. Zaidul Alam, Saugata Bose, Md. Mhafuzur Rahman,
Mohammad Abdullah Al-Mumin, “Small office PBX using Voice
service providers, utilizing the Session over IP” in Proc. IEEE ICACT 2007, Feb 12-14 2007
Initiation Protocol.
• ENUM Trunk – ENUM trunks utilize the [4] Ryosuke Yamamoto, Fumikazu Iseki, Moo Wan Kim,
e164.org number lookup services, and as a “Validation of VoIP System for University Network” in Proc. IEEE
ICACT 2008, Feb 17-20 2008.
practice aren’t used in generic PBX
installations. [5] Asterisk.org, "Features and Architecture of Asterisk PBX",
• Custom Trunk – Custom trunks are available http://www.asterisk.org/features, accessed in March, 2006.
in order to configure any type of trunk which
[6] Taemoor Abbasi, Shekhar Prasad , Nabil Seddigh, Ioannis
is not covered by the previous trunks, eg. Lambadaris “A comparative study of the SIP & IAX voice
H323, BRI ISDN, etc. protocols” in Proc. IEEE CCECE/CCGEI, Saskatoon, May 2005

Here in our implementation, though we have not [7] Anand Gorti ”A fault tolerant VoIP implementation based on
open standards”, in Proc. IEEE 6th EDCC’06, 2006.

656

S-ar putea să vă placă și