Home > linux > How to install Asterisk 1.8 on Ubuntu Server 11.04

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 

Asterisk_01

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 

Asterisk_02

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.

Asterisk_03

Let’s call from User One to User Two.

Here is the User One side:

Asterisk_04

Here is the User Two side:

Asterisk_05

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.

Asterisk_06

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.

About these ads
  1. August 12, 2011 at 22:32

    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. chimgee
    August 16, 2011 at 19:04

    hello? how to install x-lite in ubuntu? i can not install x-lite in ubuntu11.4/64bit/. help me..thnks

  3. atokai
    August 19, 2011 at 10:19

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

  4. Gunnar Hovmark
    August 22, 2011 at 13:14

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

  5. Ricky
    September 21, 2011 at 03:56

    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.

  6. Derek
    December 7, 2011 at 13:44

    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.

  7. Ashray Shah
    January 8, 2012 at 19:09

    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…

    • atokai
      January 17, 2012 at 15:13

      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.

  8. doelper
    January 16, 2012 at 22:21

    great, post thanks!

  9. Tom
    January 27, 2012 at 04:56

    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?

    • atokai
      January 27, 2012 at 13:25

      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”. :-)

      • kanan
        January 10, 2013 at 17:55

        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.
        Kanan

  10. Vincent
    January 30, 2012 at 15:32

    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

  11. Fred Tucker
    February 13, 2012 at 16:59

    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.

    • atokai
      February 14, 2012 at 22:57

      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.

      • Fred Tucker
        March 5, 2012 at 15:56

        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.

  12. James
    March 2, 2012 at 13:01

    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

  13. May 16, 2012 at 11:45

    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

  14. May 16, 2012 at 11:47

    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

  15. bas
    June 23, 2012 at 16:43

    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

  16. Darki
    July 2, 2012 at 16:40

    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.”

  17. Saleem Hasan
    July 17, 2012 at 17:58

    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

  18. JC
    July 26, 2012 at 22:01

    I have the same one also SIP ERROR 408

  19. parin maru
    March 15, 2013 at 05:43

    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?

  20. FrankG
    April 30, 2013 at 18:09

    Hi, I tried installing with the compiling method but is it possible for me to do it this way too?

    http://draalin.com/installing-asterisk-in-ubuntu/

    Not sure if there is a difference, thanks!!

  21. Lehii
    May 6, 2013 at 21:11

    I got stuck on the make install and think this way might be easier for people like me who aren’t used to installing stuff like that.

    I ran into this Asterisk installation tutorial, it seemed to help http://draalin.com/community/index.php?threads/for-those-interested-in-vo-ip-systems.74/

    Just wish I was better @ this stuff lol.

  22. Laury
    May 20, 2013 at 16:07

    Can someone tell me if this Asterisk guide works with the one here?

    http://draalin.com/advanced-asterisk-configuration-in-ubuntu/

    I’m interested in setting up a Vo-IP system.

  23. September 3, 2013 at 18:29

    Reblogged this on scuba323 and commented:
    Wonderful!

  1. October 15, 2011 at 22:55
  2. January 25, 2012 at 02:44

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Follow

Get every new post delivered to your Inbox.

Join 60 other followers

%d bloggers like this: