Skip to content

Instantly share code, notes, and snippets.

@bigyan
Forked from paneru-rajan/asterisk_ubuntu.md
Created October 17, 2017 09:49
Show Gist options
  • Save bigyan/a1da57ca0e9bf30b9c68e4ab66757407 to your computer and use it in GitHub Desktop.
Save bigyan/a1da57ca0e9bf30b9c68e4ab66757407 to your computer and use it in GitHub Desktop.
[Asterisk installation in Ubuntu] Building Asterisk in ubuntu #asterisk #ubuntu #build

Asterisk Installation

Exhaustive steps of Installation

A step by step process to install Asterisk.

I have tested on Ubuntu 16.04, nevertheless, it will work on another distro with few changes.

Update and Upgrade the system

sudo apt-get update
sudo apt-get upgrade -y

Install some dependent packages

sudo apt-get install xmlstarlet libpt-dev -y

Export Environment Viarable

export PTLIB_CONFIG=/usr/share/ptlib/make/ptlib-config

Configuring the directory to download and save Asterisk

cd /usr/local
sudo chmod -R 777 src
cd src

Download asterisk. If you want another version the go here, and replace the below link accordingly.

Please Note: For webrtc to work we need atleast 13.15.0 or 14.4.0 version of Asterisk.

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

Untar the downloaded file, if you have downloaded other version please the change the name accordingly.

tar -xvzf asterisk-13-current.tar.gz

Going Inside the Directory

cd asterisk-13.17.2/contrib/scripts

Install dependent package for Asterisk. You are asked to confirm and Enter the Country code, For Nepal, I had used 977.

sudo ./install_prereq install

Configuring Asterisk with pjsip, if you are using sip please omit --with-pjproject-bundled

cd ../../
./configure --with-pjproject-bundled

You can select relevent option via GUI mode, for this use make menuselect. Here we need to select opus codec and I used the cli.

make menuselect.makeopts
menuselect/menuselect --enable codec_opus menuselect.makeopts

Making and Installing

make
sudo make install

Create Sample and Config

sudo make samples
sudo make config

To open the asterisk

sudo asterisk -cvvvvv

To reload Asterisk

sudo asterisk -rvvvvv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment