Asterisk Installation Guide By Linux and Asterisk Version

Here I will maintain a “How To” list of installing various versions of Asterisk on various Linux platforms. Please tweet me at @taylorhawkes if any of the linked articles are incorrect or outdated.

linux Version Asterisk Version Article
Ubuntu 14 Asterisk 13

Installing Asterisk 13 from source on Ubuntu 14

Ok, so before you read this guide, I have to urge you to consider ditching Asterisk in favor of using RingRoost. If you are a business or VoIP reseller there is nothing that Asterisk can do that RingRoost can’t (except break), contact us or schedule a demo to see what I mean.

Here is a guide on how to install Asterisk 13 on Ubuntu 14. It’s pretty easy/straight forward except one slightly tricky part – which is installing “PJSIP”, so make sure you read along carefully.

apt-get update

We will install Asterisk in “/usr/src”:

cd /usr/src
wget .
tar -zxvf certified-asterisk-13.1-current.tar.gz
cd cd certified-asterisk-13.1-cert2/

Install some dependencies:

apt-get install build-essential 
apt-get install libxml2-dev
apt-get install libncurses5-dev libreadline-dev libreadline6-dev
apt-get install libssl-dev
apt-get install uuid-dev
apt-get install libjansson-dev
apt-get install libsqlite3-dev
apt-get install pkg-config

At this point we need to select the SIP library we are going to use in Asterisk. SIP is basically VoIP protocol that we MUST have in asterisk. Version 13 of Asterisk is a little awkward because it can use either “PJSIP” (a 3rd party library) or it’s native built in SIP library. The Asterisk team is encouraging people to use “PJSIP” instead of the native SIP library, so in Asterisk 13 PJSIP is the default library, but on Ubuntu 14 PJSIP must be installed and compiled from source.

So we can do things the quick and easy way (use the old Asterisk SIP library) or the right way (install PJSIP). I will outline both approaches below. If you are new to this I would just do the quick/easy way and then maybe switch to PJSIP later.

1. Use native SIP library in asterisk (quick and easy way)

make menuselect

Under channel drivers –> select chan_sip (press enter then save by pressing back then “s”). Then continue to compile & install instructions.

2. Install PJSIP (the right way)

cd /usr/src/
tar -xjvf pjproject-2.4.tar.bz2
cd pjproject-2.4
 ./configure --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS='-O2 -DNDEBUG'
make dep && make && make install 

Go back to your asterisk directory and “./configure” then continue to then continue to compile & install instructions.

cd ../certified-asterisk-13.1-cert2/

Compile and Install Asterisk

make install
makes samples 
make config

Crank asterisk up:

/etc/init.d/asterisk start

Then connect to Asterisk Cli:

asterisk -rvvvvvvvv

Congrats you have at this point successfully installed Asterisk, if your not sure where to go from here you could start by setting up an interactive voice response system on Asterisk which I show how to do step by step in this article:

Here are some common errors & fixes when you are installing asterisk 13 on ubuntu 14.04.

Error Issue Fix
uuid support not found (this typically means the uuid development package is missing Missing Package apt-get install uuid-dev
JSON support not found (this typically means the libjansson development package is missing Missing Package apt-get install libjansson-dev
Please install the SQLite3 development package. Missing Pacakge apt-get install libsqlite3-dev
Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?) Asterisk not running. /etc/init.d/asterisk start

Thanks to these articles for installing Asterisk:

And these articles for working out various bugs/issue I ran into.