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 1.8.3.3 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!
wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.3.3.tar.gz
tar zxvf asterisk-1.8.3.3.tar.gz
Then install the Asterisk, config, and the shamples.
cd asterisk-1.8.3.3/
./configure
make
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-1.8.3.3':
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:
[general]
context = default
bindport = 5060
bindaddr = 0.0.0.0
tcpbindaddr = 0.0.0.0
tcpenable = yes
[1001]
type = friend
callerid = User One <1001>
secret = 1001
host = dynamic
canreinvite = no
dtmfmode = rfc2833
mailbox = 1001
disallow = all
allow = ulaw
transport = udp
[1002]
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:
[general]
static=yes
writeprotect=no
[default]
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.










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
hello? how to install x-lite in ubuntu? i can not install x-lite in ubuntu11.4/64bit/. help me..thnks
Hi chimgee, As you know the x-lite 4 is not available on ubuntu, so I wrote a brand new article about Ekiga and Asterisk. Here is the article: http://letitknow.wordpress.com/2011/10/15/how-to-configure-ekiga-to-connect-to-asterisk-on-ubuntu-desktop/ Bests, Attila
Hi chimgee, I checked the CounterPat’s website, and I realized that the x-lite 4 available only for Mac and Windows.
Thanks, this is the first instruction I’ve come across that actually works. (I used 3CXPhone in Windows to make the test calls.)
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.
Why do all of this when you can install asterisk from packages? I’m not talking about broken packages from the Ubuntu repositories. Follow https://wiki.asterisk.org/wiki/display/AST/Asterisk+Packages instead of compiling from source.
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..
Thanks…
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.
great, post thanks!
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”.
Hello
Thanks for the great tutorial.
Just one thing, though: make sure you have libssl-dev installed, of chan_sip won’t be included and SIP won’t work:
https://issues.asterisk.org/view.php?id=18062
Cheers
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.
Nice guide for 1.8 on 11.04, I have done a guide for Asterisk 10 on Ubuntu 10.04 LTS here:
http://linuxmoz.com/ubuntu-asterisk-10-install-guide/ just thought some of your readers might find this useful.
Thanks,
James
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?
Thanks
seeam
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.
Thanks,
seeam
Excellent guide, thanks!
I also had to install libssl-dev
Without that I had this problem https://issues.asterisk.org/jira/browse/ASTERISK-19289
and this problem https://issues.asterisk.org/view.php?id=14180
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.”
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.
thanks
Saleem
I have the same one also SIP ERROR 408