Sunday 27 August 2017

How to Install Asterisk on Ubuntu 14.04


Asterisk Installation


This document explains how to install Asterisk on Ubuntu 14.04,
the installation steps are given below:


1. We are using AWS server instance here, so create AWS instance and log into the server.

2. Now first we have to update system, type below command to update system from terminal

apt-get update && apt-get upgrade -y

3. Install dependency with following command, while installing these dependencies, it may ask you MySQL password to set, give password of your choice and remember

apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git unixodbc-dev uuid uuid-dev libasound2-dev libogg-dev libvorbis-dev libcurl4-openssl-dev libical-dev libneon27-dev libsrtp0-dev libspandsp-dev libmyodbc

4. Now reboot server

5. After reboot type these commands

a2enmod rewrite
service apache2 restart

6. Install and configure Asterisk

Download required source files in /usr/src directory

cd /usr/src

wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz

wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
In my case it was,
wget http://downloads.asterisk.org/pub/telephony/asterisk/old-releases/asterisk-13.15.0.tar.gz (can download any specific version also from this link)

wget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.7.tar.gz
wget http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2


Compile and Install DAHDI (Required if any hardware card installed to support PRI like lines)

cd /usr/src
tar xvfz dahdi-linux-complete-current.tar.gz
rm -f dahdi-linux-complete-current.tar.gz
cd dahdi-linux-complete-*
make all
make install
make config
cd /usr/src
tar xvfz libpri-current.tar.gz
rm -f libpri-current.tar.gz
cd libpri-*
make
make install


Compile and install janson

cd /usr/src
tar vxfz jansson.tar.gz
rm -f jansson.tar.gz
cd jansson-*
autoreconf -i
./configure
make
make install


Compile and install Asterisk

cd /usr/src
tar xvfz asterisk-13-current.tar.gz
rm -f asterisk-13-current.tar.gz
cd asterisk-*
contrib/scripts/install_prereq install (this step may ask to enter telephony country code like 61, you can give as per your country)
./configure
contrib/scripts/get_mp3_source.sh
make menuselect


make
make install
make config
ldconfig
update-rc.d -f asterisk remove
make samples

Now, you have installed Asterisk, type below commands from terminal as root user, to go to Asterisk cli,

asterisk
asterisk -rvvvv
core restart now
asterisk -rvvvv
core reload

3 comments:

  1. Thanks for sharing such useful information with us. I hope you will share some more information about VoIP development. Please keep sharing!

    VoIP Development

    ReplyDelete
  2. This is very useful article. Please add
    sudo /etc/init.d/asterisk start
    command because after installation asterisk service being stopped.

    ReplyDelete
  3. thank you for this article. just for the 'tar' command put the 'f' towards the end to specify the file that will follow. Example tar xvzf file

    ReplyDelete