2008-12-11
How to build and customize an IP PBX with Asterisk ?
This article demonstrates how to roll your own PBX in about an hour or two. Provided that the instructions herein are followed carefully, you too should be able to set up your very own switchboard/PBX system and all for the cost of the target hardware of your choice.
What is a PBX ? why set one up?
A PBX (Private Branch Exchange) is a switch station for telephone systems. It consists mainly of several branches of telephone systems and it switches connections to and from them, thereby linking phone lines.
Companies use a PBX for connecting all their internal phones to an external line. This way, they can lease only one line and have many people using it, with each one having a phone at the desk with different number. The number is not in the same format as a phone number though, as it depends on the internal numbering. Inside a PBX, you only need to dial three-digit or four-digit numbers to make a call to another phone in the network. We often refer to this number as an extension.
Most people are familiar with PBXs because they've used them in an office environment, but what if you wanted to use one in small office or your house? Enter Asterisk.
The beauty of Asterisk (see also Asterisk.org) is that it is free and offers all this functionality right out of the box. Asterisk is a software implementation of a hardware PBX and can run on a variety of hardware platforms. The features and benefits of owning an Asterisk PBX are numerous, and seemingly only limited by the imagination of the person who sets up and uses an Asterisk PBX. (Click to see the features of Asterisk ).
Prepare for setting up your PBX
There are many ways of setting up an Asterisk PBX, with some being easier than others. The easiest manner in which to set up a fully functional Asterisk PBX is to download and install aprecompiled/tuned distribution such as Trixbox, PBX in a flash, Asterisk NOW, etc. Just take your pick of those. These are great if you don't care to learn about how your PBX operates or need to do a mindless "click and drool" install. The problem with precompiled asterisk distributions is, while they are simple, they are not as flexible and extensible as a home-brewed Asterisk installation from the source code. When you install one of these "distros", it is quite often that important decisions are already made for you, and you must work within the framework of the distribution to keep the box "happy". When you roll your own Asterisk from the sources, you get more say in what goes into the build and how it is customized/extended at the expense of a slightly more complicated planning and installation process. However, it's not as hard as you might think and it's quite worth it in the end to "roll your own".
Asterisk installed from the source code enables you to pick your choice of underlying OS (Debian, Ubuntu, Fedora, Mandrake, SuSE, etc) and also fine tune the installation for your OS environment and your hardware for best possible performance. In this article I will cover the steps needed to install Asterisk for the Ubuntu Linux operating system. This article assumes you know how to do a minimal command line only base system install of Ubuntu Linux. You certainly don't want to run a GUI on your Asterisk box as it would consume unnecessary resources.
Step 1: prepare a minimal Ubuntu machine, wiht a command line only install
Step 2: download source packages
After you've prepared your minimal Ubuntu machine, you will need to download a few source packages from Asterisk. Please perform the following steps on your command line as the root user. To set your root password, log in as your regular user account you created during installation and type the following commands:
sudo passwd root
when asked for your password enter your regular USER password, hit ENTER, followed by the desired root password and then hit ENTER, confirm the desired password once more and then you're done.
Logged in as the root user we'll download the needed packages by running the following script in your terminal screen. If you are familiar with Putty, you can also do this remotely via a windows desktop or SSH into the box as root from any other Linux/Mac machine.
NOTE: we will be using Asterisk 1.4 NOT 1.6 as 1.6 is the unstable release.
Source packages needed :
asterisk-1.4.21.2
zaptel-1.4.11
libpri-1.4.5
asterisk-addons-1.4.7
asterisk-gui
I have written a script file to simplify the process on an Ubuntu 8.04 system. Copy and paste the following code into a new file in a terminal window and save the file as "astsetup.sh". Then when you save the file, make it executable by running this command: chmod +x astsetup.sh.
——> BEGIN COPYING CODE TO NEW FILE
######## Prepare Build Environment
apt-get install build-essential speex libspeex-dev gsm-utils \
libgsm1-dev libgsmme-dev libgsm1 libgsm-tools \
libncurses5-dev ncurses-term linux-headers-2.6.24-19-generic \
libncurses5-dbg doxygen subversion
######## Download Asterisk Source Packages
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.21.2.tar.gz
wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.11.tar.gz
wget http://downloads.digium.com/pub/libpri/releases/libpri-1.4.5.tar.gz
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-addons-1.4.7.tar.gz
svn co http://svn.digium.com/svn/asterisk-gui/trunk asterisk-gui
######## Extract all packages for building
tar -zxvf asterisk-1.4.21.2.tar.gz && tar -zxvf zaptel-1.4.11.tar.gz \
&& tar -zxvf asterisk-addons-1.4.7.tar.gz && tar -zxvf libpri-1.4.5.tar.gz
######## Begin Building and Installing Source Packages
cd libpri-1.4.5
make
make install
cd ../zaptel-1.4.11
make clean
./configure
make menuselect
make install
make config
cd ../asterisk-1.4.21.2
make clean
./configure
make menuselect
make install
make samples
make progdocs
cd ../asterisk-addons-1.4.7
make clean
./configure
make menuselect
make install
make samples
cd ../asterisk-gui
./configure
make
make install
make samples
cd /root
mkdir packages
mv *.gz /root/packages/.
echo INSTALLATION COMPLETE PLEASE CONFIGURE WEB GUI
———-> END COPYING CODE TO NEW FILE
One final step remains in order to bring the GUI up and running. We must edit two files:
/etc/asterisk/http.conf and
etc/asterisk/manager.conf.
/etc/asterisk/http.conf:
[general]
enabled=yes
enablestatic=yes ; without this, you can only send AMI commands, not display
; html content
bindaddr=0.0.0.0 ; address you want the Asterisk HTTP server to respond on
bindport=9000 ; port you want the Asterisk HTTP server to respond on
prefix=asterisk ; will form part of the URI, similar to a directory name
/etc/asterisk/manager.conf:
[general]
enabled=yes ; you may already have AMI enabled if you are using it for other things
webenabled=yes ; this enables the interaction between the Asterisk web server and AMI
[admin] ; This is the manager username. You can name the user whatever you want
secret = password
read = system,call,log,verbose,command,agent,user,config
write = system,call,log,verbose,command,agent,user,config
———–
That's it! Restart your PBX server and point your browser to:
http://ip-of-pbx:9000/asterisk/static/config/cfgbasic.html (where IP of PBX is the IP address of your PBX box)
You should then see the web GUI and should be able to logon and start creating extensions (users).
If you don't see the GUI after restarting your PBX, login as root and just start Asterisk by typing asterisk on the command line. You can also set it to start at system boot by adding it to your /etc/rc.local startup script. Also, if you have an account with a VOIP service provider, you can setup your PBX to be the "gateway" to your office/home with ease.
Asterisk is very flexible, scalable, and limitless in its scope of use, so there is no way I can tell you everything that can be done with this amazing piece of software. It's use is not just limited to communication and phone management and there are thousands of hacks that can be applied to Asterisk. Some of them are:
Home Automation using X10 addressable switches
Remote home/office alarm/lock control
Remote environmental/audio monitoring
Conference Rooms
E-mail reader (text to speech access to any email account)
Remote Dictation
Voice Recognition
Ability to run system commands by phone - Remote Control
Phones and Extension Types
Asterisk supports any standards based SIP or IAX compatible voip phone. Softphones and VOIP ATAs (Analog Telephone Adaptors) are also another way to interface with your Asterisk system. With an ATA you can turn your existing analog corded or cordless phones into VOIP phones.
Voip Service Providers/PSTN
Asterisk can connect with the world either directly with a voip service provider that allows a "byod" (Bring Your Own Device) plan, or directly with the PSTN (Public Switched Telephone Network) via an Asterisk card.
cheap asterisk card
Cheap asterisk card
What is a PBX ?
Why you need setup an ip pbx based on my cheap asterisk card ?
There are many asterisk card vendors, however, my asterisk card is cheap but good .
A PBX (Private Branch Exchange) is a switch station for telephone systems. It consists mainly of several branches of telephone systems and it switches connections to and from them, thereby linking phone lines.
Companies use a PBX for connecting all their internal phones to an external line. This way, they can lease only one line and have many people using it, with each one having a phone at the desk with different number. The number is not in the same format as a phone number though, as it depends on the internal numbering. Inside a PBX, you only need to dial three-digit or four-digit numbers to make a call to another phone in the network. We often refer to this number as an extension.
Most people are familiar with PBXs because they've used them in an office environment, but what if you wanted to use one in small office or your house? Enter Asterisk.
The beauty of Asterisk (see also Asterisk.org) is that it is free and offers all this functionality right out of the box. Asterisk is a software implementation of a hardware PBX and can run on a variety of hardware platforms. The features and benefits of owning an Asterisk PBX are numerous, and seemingly only limited by the imagination of the person who sets up and uses an Asterisk PBX.
2008-12-05
Cheap Asterisk card with 1 E1 port
VoIP Asterisk PCI card RX-1E1
supports both telephony and data modes. RX-1E1 has one E1/PRI
interfaces supporting PRA signaling, HDLC, PPP and Frame Relay
data modes, and any combination thereof. With the VoIP Asterisk card RX-1E1, you can
easily build your IP-PBX or Carrier system .
Interfaces:
-1 X E1 interfaces
-PCI 5.0V interface
Features:
One PRI port 30 channels
Hardware DTMF detection
Conference Bridge
PCM bus connectors (PCM30, PCM64, PCM128)
4 dual-color LEDs (layer 1 state indicators)
Active channel switching (across multiple cards over the external PCM bus)
PRI ISDN protocol stack
Suitable for 3.3 volts and 5.0 volts 32 bit PCI 2.2 slots
Applications:
ISDN PRI PBX
ISDN least cost router
Voice over IP PRI gateways
VoIP integration of ISDN equipment
PBX to PBX trunking
IVR
Data Modes:
Cisco HDLC
HDLC
PPP
Multilink PPP
Frame Relay
Voice Modes:
-EuroISDN
-AT&R 4ESS
-Lucent 5E
-National ISDN2