How to install Asterisk 1.8 on Ubuntu Server 11.04

In my previous post I installed Asterisk on Ubuntu Server 10.10. The newer Ubuntu Server 11.04 (Natty Narwhal) has just arrived, so I need to test the Asterisk on it.

It is easy to install and use an Asterisk free soft PBX on Ubuntu box – if you do it frequently. I created a step by step guide to prevent you from the usually error messages during the installation:

I use Asterisk on my 64 bit Ubuntu Server 11.04.

After the upgrade on a fresh install, we need three packages to build up our Asterisk. Let’s install the build-essential, libxml2-dev, and ncurses-dev packages.

apt-get install build-essential libxml2-dev ncurses-dev 


You can find all versions of the Asterisk at the download section. Download the latest version, and extract it!

tar zxvf asterisk- 

Then install the Asterisk, config, and the shamples.

cd asterisk- 
make install 
make config 
make samples 

Without the above-mentioned additional packages, you will face with these error messages during the ./configure command run.

Lack of build-essential package:

configure: error: in `/root/asterisk-': 
configure: error: no acceptable C compiler found in $PATH 

Lack of libxml2-dev package:

checking for xml2-config... no 
configure: *** XML documentation will not be available because the 'libxml2' development package is missing. 
configure: *** Please run the 'configure' script with the '--disable-xmldoc' parameter option 
configure: *** or install the 'libxml2' development package. 

Lack of ncurses-dev package:

configure: error: *** termcap support not found (on modern systems, this typically means the ncurses development package is missing) 

When the installation finishes, we have a preconfigured Asterisk. To test the Asterisk with two softphones, let’s configure the sip.conf and the extensions.conf.

Here is the sip.conf file:

context = default 
bindport = 5060 
bindaddr = 
tcpbindaddr = 
tcpenable = yes 

type = friend 
callerid = User One <1001> 
secret = 1001 
host = dynamic 
canreinvite = no 
dtmfmode = rfc2833 
mailbox = 1001 
disallow = all 
allow = ulaw 
transport = udp 

type = friend 
callerid = User Two <1002> 
secret = 1002 
host = dynamic 
canreinvite = no 
dtmfmode = rfc2833 
mailbox = 1002 
disallow = all 
allow = ulaw 
transport = udp 

This config means that the Asterisk listen all IP, port 5060, and the TCP is enabled. It has two extensions defined for User One and User Two.

Here is the extensions.conf file:


exten => 1001,1,Answer() 
exten => 1001,n,Dial(SIP/1001,20,tr) 
exten => 1001,n,Hangup 

exten => 1002,1,Answer() 
exten => 1002,n,Dial(SIP/1002,20,tr) 
exten => 1002,n,Hangup. 

This config means that there are two accessible extensions existing.

After configuring the Asterisk, we need to start it.

/etc/init.d/asterisk start 


I use X-Lite to connect to the soft PBX. Let’s configure the X-Lite!

All data come from the sip.conf. The Account name, and the Display name are the callerid. The User ID and the Authorization name are the extension number – inside the square brackets. The Password is the sicret. The Domain is the IP address of the Asterisk server.

If all configurations are good, the X-Lite will inform you.


Let’s call from User One to User Two.

Here is the User One side:


Here is the User Two side:


Troubleshooting? We always need when we try a new thing. The firs tool is the tcpdump of course, but the asterisk have a good command line interface (Asterisk CLI) to debug the problem. To access the Asterisk CLI type

asterisk -vvvvvvr 

This screen shows a successful call from 1001 to 1002.


The Asterisk works now! Are you wondering why I configured my Asterisk to answer on TCP? Because I would like to test the Direct SIP feature of the Microsoft Communications Server and the Lync. CU next time! ;-)

You can find the OCS 2007 R2 co-existing scenario with Asterisk 1.8 PBX article here.

32 thoughts on “How to install Asterisk 1.8 on Ubuntu Server 11.04

  1. hello good basic guide for asterisk I also installed on ubuntu 64 but I have problem with the Asterisk IAX2 not charge it with other modules to be read that was hayo 64b but not the solution

  2. Hi chimgee, I checked the CounterPat’s website, and I realized that the x-lite 4 available only for Mac and Windows.

  3. Thanks, this is the first instruction I’ve come across that actually works. (I used 3CXPhone in Windows to make the test calls.)

  4. I have your How to install Asterisk 1.8 on Ubuntu Server 10.10 bookmark and recently was looking to do the installation of Asterisk 1.8 on Ubuntu Server 11 and visited here and it was great to see you already had writing an article on it. Never run into any problems with your instructions.

    I would love to see an article from you about install freepbx with Asterisk 1.8 and Ubuntu 11, have already installed it using another article, but had to read various articles to actually install it.

  5. Pingback: How to configure Ekiga to connect to Asterisk on Ubuntu Desktop « Let IT know

  6. Hi,

    I have done all the above steps and was successful.
    but when i checked for /etc/asterisk/ i didn’t found the sip.conf and extensions.conf file so i created the same.

    I tried X-lite and 3cx softphone as well but both of was not able to sync with asterisk.

    could you help me what steps have i missed..


    • Hi Ashray Shah,

      Could you please describe better the “was not able to sync”? You mean that unable to register?

      Try to log in/register your extension during run the Asterisk CLI in verbose mode (
      asterisk -vvvvvvr). Check any error.

  7. Pingback: [ubuntu] Configuring Asterisk PBX | Coders & Admins

  8. Rockin’ dude! Just followed this to build this on FreeBSD 9.0 x64 using asterisk-10.0.1, got the soft phone working with NO problem.

    You have any info on SIP trunk providers?

    • Hi Tom!

      I usually work with companies, that have already a hard PBX, such as an Avaya PBX. They usually keep the original PBX, so I need only a SIP trunk for the “internal” PBX.
      I think you need to read some forum, or “Google is your best friend”. :-)

      • Hi, just used your guide to set up asterisk 11.1.2 on a ubuntu server 12.04, using the terminal interface as I like…
        Thank you for the easy explanation.
        Have you by any chance also published a guide on how to interface asterisk with an avaya ip office ip500 (via SIP trunks)?
        Do you know what level of integration is possible (such as CLI, enquiry and transfer, follow me, busy indication, etc.)?
        Thank you in advance for any reply.

  9. Thank you for the guide. I was hoping this would solve my asterisk nightmare experience, but unfortunately the problems continue. Having tried several of the all-in-one packages like AsteriskNOW and PIAF I thought starting from scratch would resolve my issue, but apparently not. I am experiencing the same issues with this install as all the others I have tried. When attempting to connect via X-Lite over SIP I always receive:

    Account: User One could not be enabled. Problem at server (SIP error 408). Try again later.

    The minimal info on this error message is that it is a possible firewall issue, but this is not my case as I have tried from several local clients with firewall disabled and all yield same results. Ping, SSH, Webmin and every other connection I have tried to the server works perfectly. Turning on the verbose Asterisk CLI yields no messages when attempting to connect.

    Is it possible that I am suffering a SIP issue as mentioned by Vincent above. If anyone here has a way to troubleshoot this issue I would greatly appreciate the advice.

    • Hi Fred,

      My favorite is the Asterisk CLI, because it always help to me. If there is no error message, maybe the problem is located on your client or firewall between the client and server. Try to use wireshark or tcpdump on the client and the firewall to gather more info about the connection. I hope this would help.

      • The issue that Vincent described above finally resolved the issue for me. Thanks to both of you for finally getting this going for me as I have been fighting this “project” for several weeks.

  10. Hi Fred, I am faceing the same problem, ‘Account: User One could not be enabled. Problem at server (SIP error 408). Try again later.’ I can’t resolve it. can u please help me how did u make it?


  11. Hi Fred,
    I am facing exactly the same problem you pointing, ” User One could not be enabled. Problem at server (SIP error 408). Try again later.”
    I can’t resolve it, can u please describe me detail how can i make it please.


  12. Hi to all,
    I am facing exactly the same problem as yarseeam and Fred you pointing, ” User One could not be enabled. Problem at server (SIP error 408). Try again later.”

  13. can you please help me regarding how can I use MINISIP as my softphone and Asterisk as the proxy. To be very clear, I want to know how should I configure the MINISIP to work with asterisk.



  14. hello, i have one question that i have configure my asterisk server on linux using ssh…after i shutdown the window…if i want to start again from CLI mode…what is command use for that? could you please help?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s