create your own

How to Install Asterisk on Ubuntu – Setting up Asterisk PBX

85
rate or flag this page

By expectus

how to install asterisk on ubuntu
how to install asterisk on ubuntu

Asterisk on Ubuntu

Asterisk is one of the most popular free telephony solutions available as it is very simple to setup, has great community support and can be customized for any application. It also features easy to use GUI interface.

This hub will go through setting up asterisk from the packages instead of just downloading an already pre-made image of Asterisk like AsteriskNOW , Tribox or systems similar.Asterisk on ubuntu guide goes through version 1.4 I belive 1.6 recently came out aswell as the changes to the packages.



Packages Required for Asterisk Installation

There are quite a few packages ubuntu will require in order to complete the installation of asterisk on ubuntu successfully, these include running kernel 2.6 of linux, and appropriate packages to execute C programs.

To install the required packages enter root mode using

Sudo su

 

Apt-get –y install linux-headers-$(uname -r) build-essential

automake autoconf bison flex libtool libncurses5-dev libssl-dev

subversion svn-buildpackage

apt-get –y install cvs build-essential automake autoconf bison flex libtool libncurses5-dev libssl-dev libgsm1 libgsm1-dev

apt-get –y install sysvconfig **required to start services**

Note: if packages fail to install try separating the packages and installing them individually.


Installation Steps

Extract Files – Configure each Package – Run Services

tar –xzf zaptel-1.4.12.1.tar.gz

tar –xzf libpri-1.4.10.1.tar.gz

tar -xzf asterisk-1.4.20.tar.gz

tar -xzf asterisk-sounds-1.2.1.tar.gz

tar -xzf asterisk-addons-1.4.7.tar.gz

  • cd zaptel-1.4.12.1
  • ./configure
  • make
  • make install
  • make config
  • service zaptel start
  • cd ..
  • cd libpri-1.4.10.1
  • make
  • make install
  • cd ..
  • cd asterisk-1.4.20
  • ./configure
  • make
  • make install
  • make samples
  • make config
  • cd ..
  • cd asterisk-sounds
  • make install
  • cd ..
  • cd asterisk-addons-1.4.7
  • ./configure
  • make
  • make install
  • service asterisk start


If asterisk fails to start try starting asterisk from directory /etc/asterisk
Asterisk start

Setting up Sip Extensions

Now that asterisk is installed its time to create some users so that we can register ourselves on the asterisk server with a soft phone and then start to make calls over the network.

Edit the file /etc/asterisk/sip.conf

Using “nano /etc/asterisk/sip.conf” or “vim /etc/asterisk/sip.conf”

Copy the following into your sip.conf, If you can’t copy and paste try connecting to your server with Putty once you have installed openssl

[common](!) ; this is template.
type=friend
context=internal
host=dynamic
disallow=all
allow=ulaw
allow=alaw
allow=g723
allow=g729
dtmfmode=rfc2833
 
;
[1000](common)
username=1000
secret=1000
 
;
[1001](common)
username=1001
secret=1001


Here we have setup two users with extensions 1000 and 1001 , you can now registry your softphone with the server using these two extensions and secrets.

Remember to reload your asterisk server when changes have been made. Enter the command line “asterisk –r” and type “reload”

X-lite softphone connected to Asterisk Ubuntu PBX
X-lite softphone connected to Asterisk Ubuntu PBX

Setting up Dialplan’s so we can make Call’s

We cannot make calls until we have setup the dialplan file which will specify how a particular number shall be interpreted and where the call should be sent.

Edit sip.conf to look like the following

[internal]
exten=> _XXXX,1,Dial(SIP/${EXTEN})

The above diaplan specifies anyone that dials 4 digits e.g 1001 , the number one priority will be to Dial, the Sip extension 1001.

X refers to any number from 0 – 9

That’s it for the basic’s in setting up your Asterisk PBX server on ubuntu, next time I will go through creating trunk’s to reach the PBX , setting up ENUM and a few other things.

Asterisk & Ubuntu :)
Asterisk & Ubuntu :)

Print   —   Rate it:  up  down  flag this hub

Comments

RSS for comments on this Hub

dusanotes profile image

dusanotes  says:
2 months ago

WOW! Expectus, you outdid yourself. I'm going to save this for future reference. Your mind is so far more advanced than mine, it's not even possible for me to stay up with you. But I'm going to try. This kind of material is valuable. Have you thought of cataloging it and sharing it in the form of a book? Neat stuff. Don White

expectus profile image

expectus  says:
2 months ago

thanks for the very encouraging comments dusanotes :) I am still pretty new to asterisk but its great to write a hub to help people get started using it. The book idea sounds great as there's a lack of good clear info on asterisk on the web :)

ABTEODORO profile image

ABTEODORO  says:
24 hours ago

You surely have lots of informative hubs.

expectus profile image

expectus  says:
22 hours ago

thanks ABTEODORO

Submit a Comment

Members and Guests

Sign in or sign up and post using a hubpages account.


optional


  • No HTML is allowed in comments, but URLs will be hyperlinked
  • Comments are not for promoting your hubs or other sites

working