Saturday, September 10, 2011

Installing Asterisk


(If you don't have linux install follow this link http://shomail.blogspot.com/2011/09/ubuntu-installation.html)

Most Asterisk configurations are composed of three main packages : the main Asterisk program (asterisk), the telephony drivers (Dahdi), and the PRI libraries (libpri).

If you plan on a pure VoIP network, the only real requirement is the asterisk package, but we recommend installing all three packages; you can choose what modules to activate later. Dahdi required if you are using analog or digital hardware as a timing source.

The libpri library is optional unless you’re using ISDN PRI interfaces, and you may save a small amount of RAM if you don’t load it, but we recommend that it be installed in conjunction with the dahdi package for completeness.

Before installing  above 3 packages, following packages had been installed:

linux-source (needed if you are going to recompile the linux kernel)

linux-headers (needed for compiling dahdi)

openssl           

ssh

build-essential

libncurses5-dev

you may install above 6 packages using command apt-get e.g.: apt-get install openssl

Obtaining the Source Code


The best place  to get source code  for Asterisk and  its packages  is directly  from  the http://www.asterisk.org web site or FTP server.

The easiest way to obtain the most recent release  is through the use of the program wget

Note that we will be making use of the /usr/src/ directory to extract and compile the Asterisk source, although some system administrators may prefer to use /usr/local/src. Also be aware that you will need root access to write files to the /usr/src/ directory and to install Asterisk and its associated packages.

To obtain the latest release source code via wget, enter the following commands on the command line:

# cd /usr/src/

# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-1.8.2.3.tar.gz

# wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/releases/dahdi-linux-complete-2.4.0+2.4.0.tar.gz

# wget http://downloads.asterisk.org/pub/telephony/libpri/releases/libpri-1.4.11.5.tar.gz

Extracting the Source Code


The packages you downloaded from the FTP server are compressed archives containing the source code; thus, you will need to extract them before compiling. If you didn’t download the packages to /usr/src/, either move them there now or specify the full path to their location. We will be using the GNU tar application to extract the source code from the compressed archive. This is a simple process that can be achieved through the use of the following commands:

#tar –xvzf asterisk-1.8.2.3.tar.gz

#tar –xvzf dahdi-linux-complete-2.4.0+2.4.0.tar.gz

#tar –xvzf libpri-1.4.11.5.tar.gz

Compiling Dahdi


This is a simple-to-install 'complete' DAHDI kit for Linux users. It is designed to be a drop-in replacement for users used to building Zaptel 1.2 or 1.4 for their system without specifying any special build options, file locations, or anything else. If you need to influence the build or installation process in any way outside the defaults, you will need to use the installation steps specific to the dahdi-linux and dahdi-tools packages separately (both of which are located in subdirectories of the dahdi-complete package).

To install this package, execute these commands:

# cd /usr/src/dahdi-version

# make all

# make install

# make config


Compiling libpri


The libpri libraries do not make use of the autoconf build environment thus, the installation is simplified. libpri is used by various makers of Time Division Multiplexing (TDM) hardware, but even  if you don’t have the hardware installed, it is safe to compile and install this library. You must compile and install libpri before Asterisk, as it will be detected and used when Asterisk is compiled. Here are the commands (replace version with your version of libpri):

# cd /usr/src/libpri-version

# make clean

# make

# make install

Compiling Asterisk

Once you’ve compiled and installed the dahdi and libpri packages (if you need them), you can move on to Asterisk. This section walks you through a standard installation.

# cd /usr/src/asterisk-version           

# make clean

# ./configure

# make all

# make install

# make samples  

Run the make samples command to install the default configuration files. Installing these files  (instead of  configuring  each  file manually) will  allow  you  to get  your Asterisk system up and running much faster. Many of the default values are fine for Asterisk.

Running Asterisk

Once you’ve successfully installed asterisk, simply type:

#asterisk

1 comment:

  1. This blog is great source of information which is very useful for me. Thank you very much.

    LOVELY IMAGES FOR VALENTINE DAY.

    ReplyDelete