Tuesday, August 5, 2008

Asterisk How to

Asterisk Step - By Step :
Asterisk Installation can be of 3 types -
1. Using Asterisk Live CD ( Slast)
2. Installing Asterisk from CD (Asterisk@Home, TrixBox) and
3. Installing Asterisk direct from internet.

Firstly i tried installing Asterisk from Live CD but i can not manage the network as the hardware used here in India has not the get detected by that.
Then i tried installing Asterisk@Home and TrixBox both are basically configured for Digium hardwares so i started thinking about the last option.
When compiling Asterisk from source, there are four major pieces to the puzzle:

LibPRI - it is a library for handling the PRI signaling standard.The PRI standard was created by the Bell System back in the 1970s and is now an ITU standard. LibPRI is a C implementation of the standard.This package may be required depending on the hardware installed on the system.

Zaptel - is the package that contains the driver and libraries for Asterisk to talk to Zapata telephony hardware, which are the telephone interface cards discussed earlier. This is a handy package to install, even if there is no Zaptel hardware on the system, since the conferencing software requires it for timing purposes.

Asterisk-Addons - it is a package that contains certain optional “bells and whistles,” such as an MP3 player so Asterisk can handle sound files encoded in MP3, and modules for logging calls to a MySQL database. While these modules are completely optional, they are good to have, especially the MP3 player, and the resources they take up are minimal. Installing them is recommended.

Asterisk - This package contains the code for compiling the PBX and all its modules.

Asterisk has three dependencies:
ncurses (www.gnu.org/software/ncurses/), a library for text-based “graphical” displays.
OpenSSL (www.openssl.org/), an open-source library of the TLS and SSL protocols.
zlib (www.zlib.net/), a data compression library.
and must be the compiler like GNU C Compiler (gcc).


Now we are going into Asterisk installation:

Step 1: Asterisk code are available at http://www.asterisk.org/downloads. Grabbing Asterisk directly only downloads the Asterisk package, so you’ll want to download the LibPRI, Zaptel, and Asterisk- Addons and the sound core libraries separately.The latest versions of each package should end in -current. Since there are multiple source archives, it is best to put all of them in a common subdirectory wherever the system’s source code directory is located (for example: /usr/src).

Step 2: Get the source code for libpri, Asterisk, Asterisk-addons and sound files first:
wget ftp.digium.com/pub/asterisk/releases/asterisk-1.4.21.tar.gz
wget ftp.digium.com/pub/zaptel/releases/zaptel-1.4.11.tar.gz
wget ftp..digium.com/pub/libpri/releases/libpri-1.4.4.tar.gz
wget ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.4.7.tar.gz
wget ftp.digium.com/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gz


Step 3: Now we have to unpack the tarballs:
tar xvzf asterisk-1.4.21.tar.gz
tar xvzf zaptel-1.4.11.tar.gz
tar xvzf libpri-1.4.4.tar.gz
tar xvzf asterisk-addons-1.4.7.tar.gz
tar xvzf asterisk-core-sounds-en-wav-current.tar.gz


Step 4: Procedure said the sequence of installing should be zaptel, libpri, asterisk, asterisk-addons and then sounds. But as i get some problem installing zaptel in Amazon EC2 i do not it is the right procedure or not but still we should proceed in that way. For installing zaptel we need to install the kernel-sources and kernel-headers first( version should be the one used in your Operating System).
sudo apt-get install linux-source-2.6.15
sudo apt-get install linux-headers-2.6.22-14-xen


Step 5: Installing Zaptel:
cd zaptel-1.4.0/
./configure

menuselect utility: menuselect is a new feature in Asterisk 1.4 and above that allows you to choose which modules to compile and install, permitting you to “trim the fat” of any software not required in your particular situation. For example, if you do not have a Digium TDM400, you can deselect the wctdm module during menuselect and that module will not be compiled or installed.
make menuselect
The controls used in menuselect: Pressing Enter or the Spacebar will select/deselect a module or enter a menu. F8 will select all the modules, and F7
will deselect all the modules.To save and quit, press x, and to quit without saving, press q. If you forget any of the keys, press h and the help screen will be displayed. Menuselect lists a description at the bottom of the screen that explains which module supports which card.
Next, compile the Zaptel modules.This is done in one of two ways. If the system is running a 2.4.X kernel, simply run:
make
However, if the system is running a 2.6.X kernel, run:
make linux26
After the modules are done compiling, regardless of the system kernel version, run the installation command as a root user:
make install
And so the Zaptel modules will install. Now get back to the previous directory:
cd ../

Step 6: Installing Libpri:
cd libpri-1.4.4/
Now compile the libpri modules
make
run the installation
make install
After installation get back again.
cd ../

Step 7: Installing Asterisk:
cd asterisk-1.4.21/
./configure
make menuselect
make
make install
Now you can create sample .conf(configuration files) files.
make sample
Now you can get the documentation
make progdocs

Step 8: you can try running asterisk to check if the installation is properly made or not.
asterisk -c
you will get few warnings and can see the CLI> prompt, it means Asterisk is running
more common commands we can run here like:
show dialplan
sip show peers




AddThis Feed Button

No comments: