After a fresh install of Ubuntu 11.10 I needed to install asterisk again, so I figured I’d make some notes for the next time I have to do it.

I’m using Asterisk 1.8 rather than the latest bleeding edge because 1.8 has long term support until 2015-10-21 where as the 10.x branch is end of life 2013-10-12. I have too many other things to do these days than reconfigure asterisk, figure out which of my third party add-ons work, etc every time there is an update.

Since this is a new install, I’m updating the package list and all my files that might be out of date

apt-get update
apt-get upgrade

Make sure kernel headers are installed

apt-get install linux-headers-`uname -r`

Grab a bunch of packages for building asterisk, dependencies, compilers, etc

apt-get install build-essential # Compiler
apt-get install libxml2-dev # Required
apt-get install libncurses5-dev libreadline-dev libreadline6-dev  # Termcap stuff
apt-get install libiksemel-dev # For Google Talk support
apt-get install libvorbis-dev  # For Ogg Vorbis format support
apt-get install libssl-dev # Needed for SIP
apt-get install libspeex-dev libspeexdsp-dev  # For speex codec
apt-get install mpg123 libmpg123-0 sox openssl wget subversion openssh-server # Odds and ends

Switch into /usr/src directory as a place to build the source from

cd /usr/src

Downloaded and untar DAHDI. I don’t have any Digium hardware in this computer, but I wanted the DAHDI pseudo timing source for MeetMe conferences.

wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases/dahdi-linux-2.6.0.tar.gz
tar -zxvf dahdi-linux-2.6.0.tar.gz

Move into the build directory, compile and install DAHDI

cd dahdi-linux-2.6.0/
make
make install
cd ..

Download and untar Asterisk

wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.10.1.tar.gz
tar -zxvf asterisk-1.8.10.1.tar.gz

Move into the build directory

cd asterisk-1.8.10.1/

Add mp3 support

./contrib/scripts/get_mp3_source.sh

Run the configure script

./configure

If everything works out, you should get the ascii art Asterisk logo

               .$$$$$$$$$$$$$$$=..      
            .$7$7..          .7$$7:.    
          .$$:.                 ,$7.7  
        .$7.     7$$$$           .$$77  
     ..$$.       $$$$$            .$$$7
    ..7$   .?.   $$$$$   .?.       7$$$.
   $.$.   .$$$7. $$$$7 .7$$$.      .$$$.
 .777.   .$$$$$$77$$$77$$$$$7.      $$$,
 $$$~      .7$$$$$$$$$$$$$7.       .$$$.
.$$7          .7$$$$$$$7:          ?$$$.
$$$          ?7$$$$$$$$$$I        .$$$7
$$$       .7$$$$$$$$$$$$$$$$      :$$$.
$$$       $$$$$$7$$$$$$$$$$$$    .$$$.  
$$$        $$$   7$$$7  .$$$    .$$$.  
$$$$             $$$$7         .$$$.    
7$$$7            7$$$$        7$$$      
 $$$$$                        $$$      
  $$$$7.                       $$  (TM)    
   $$$$$$$.           .7$$$$$$  $$      
     $$$$$$$$$$$$7$$$$$$$$$.$$$$$$      
       $$$$$$$$$$$$$$$$.

Optionally choose asterisk components to be installed

make menuconfig

Build the binaries

make

Copy the files to the right places

make install

Optionally copy the sample configs into /etc/asterisk

make samples

Copy the init startup scripts to make asterisk start on boot

make config

And you’re done.

Installing Tomato USB on Asus Routers (RT-N16 etc) in Windows arrow-right
Next post

arrow-left Camera Fodder
Previous post

  • Adnan

    March 30, 2012 at 3:21 PM |

    You might want to install openssl which is required for SIP before you configure:

    sudo apt-get install libssl-dev

  • Chris

    April 5, 2012 at 2:35 PM |

    Thank you Adnan, you are correct. I’ve updated the post to reflect it.

  • david

    April 24, 2012 at 12:22 AM |

    help error in “./configure”

    configure: error: in `/usr/src/asterisk-1.8.10.1′:
    configure: error: C++ preprocessor “/lib/cpp” fails sanity check
    See `config.log’ for more details

    help me please?

  • Rolox

    May 1, 2012 at 8:42 PM |

    you are a god among men, thank you so much, if it isnt too much trouble could i have your e-mail address? i have to make a project on an elastix-based call center and i have some doubts, given that im not that good at linux, so i was wondering if i could ask you a few questions. thank you so much for the info

  • Chris

    May 7, 2012 at 10:47 AM |

    I would prefer you ask your questions here in the comments so that they might benefit other people in the future. I’m not in the business of providing technical support for the Internet, but if I have time and think I might be able to help I’ll generally try to do that.

  • liger

    May 21, 2012 at 4:11 PM |

    I get errors when compiling by make command

  • Chris

    June 13, 2012 at 9:29 PM |

    The specifics of the error would probably be useful. If you put it on Pastebin.com and provide a link here I’d be happy to take a look.

  • Chris

    June 13, 2012 at 9:31 PM |

    Hi David,

    Did you install the package ‘build-essential’?

    sudo apt-get install build-essential

    That usually gives you a sane working environment.

  • silas2

    July 25, 2012 at 11:16 AM |

    Thanks! Great post. Saved me a load of time. I did have to make a single modification though, for the dahdi I had to get the dahdi-complete file to install the dahdi tools (whatever they do), without which I coulnd’t get the dahdi to configure.

  • Adnan

    July 27, 2012 at 3:13 PM |

    David/Liger,

    If you want help – paste your logs here and provide as much detail as possible.

  • gheyath

    February 2, 2013 at 5:49 AM |

    thanx for this….

  • J

    February 25, 2013 at 4:39 PM |

    Everytime there is kernel update (under Ubuntu 12.04) I need to recompile dahdi so it places the modules in the kernel folder (/lib/modules/3.X.Y.ZZ-generic). Is there any way to always keep the modules in case there are kernel updates?

  • Chris

    February 26, 2013 at 9:01 AM |

    This is the idea behind DKMS.
    http://en.wikipedia.org/wiki/Dynamic_Kernel_Module_Support

    You can have DKMS rebuild the source for you every time the kernel is upgraded. This can be setup manually with the source you’ve selected. If you are less partial to what version of DAHDI you are running you can fetch the Ubuntu packages for DAHDI and DKMS (dahdi, dahdi-dkms, etc)

  • Imane

    April 23, 2013 at 10:55 AM |

    Thank you so much for your help

  • keving

    May 6, 2013 at 3:16 PM |

    I got stuck at one point and I believe this way might be easier for people like me who aren’t used to installing stuff this advanced.

    I ran into this Asterisk installation tutorial to help [redacted by editor]

  • Chris

    May 6, 2013 at 9:35 PM |

    Thanks for the reply, however the solution you linked installs asterisk via apt-get, which is a bit different than what this article is about. You lose some flexibility by installing the precompiled package and generally won’t be getting the latest branch release, but for many people “apt-get install asterisk” is sufficient (and you are correct, it’s much easier). I’ve removed your link because there are many others like it, and the jist of it is just:

    sudo apt-get install asterisk

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>