Need an Asterisk setup? Why not combine the long term support of an Ubuntu LTS release with the long term support of a Certified Asterisk release?
Certified Asterisk releases are supported for around 4 years, and Ubuntu LTS for around 5 years, helping ensure you don’t need to mess around with major reconfiguration again for some time.
We’ll be working with Certified Asterisk 13 and Ubuntu 14.04. Certified Asterisk 13 has an end-of-life date (EOL) of October 24, 2019, and Ubuntu 14.04 has an EOL of April 2019.
A list of Asterisk versions and their end of life dates can be found here:
Let’s start by making sure we are up to date
apt-get update && apt-get -y upgrade
Make sure kernel headers are installed
apt-get -y install linux-headers-$(uname -r)
Grab a sensible build environment along with subversion and git which we will use later to retrieve additional source code
apt-get -y install build-essential subversion git
For many people, the next two sections will be optional, you can probably skip down to the “Asterisk” section below.
On the system I’m working with, I have a Digium T1/E1 PRI card, so I’m going to grab the DAHDI modules and tools as well. You may want to install DAHDI regardless of your hardware for the dahdi_dummy timing driver. At one point the Zaptel dummy driver was used for MeetMe conferences when Digium hardware based timing was absent, although I’m not sure if this still remains the case.
We’ll be building our source under /usr/local/src, so switch in to that directory.
Download and unpack DAHDI
tar zxvf dahdi-linux-complete-current.tar.gz
Switch in to the newly created source directory, compile, and install DAHDI.
If you have DAHDI hardware you should see the type of card in the make config output
Adding system startup for /etc/init.d/dahdi ...
/etc/rc0.d/K30dahdi -> ../init.d/dahdi
/etc/rc1.d/K30dahdi -> ../init.d/dahdi
/etc/rc6.d/K30dahdi -> ../init.d/dahdi
/etc/rc2.d/S15dahdi -> ../init.d/dahdi
/etc/rc3.d/S15dahdi -> ../init.d/dahdi
/etc/rc4.d/S15dahdi -> ../init.d/dahdi
/etc/rc5.d/S15dahdi -> ../init.d/dahdi
DAHDI has been configured.
List of detected DAHDI devices:
pci:0000:04:02.0 wcte13xp+ d161:800b Wildcard TE132/TE134
run 'dahdi_genconf modules' to load support for only
the DAHDI hardware installed in this system. By
default support for all DAHDI hardware is loaded at
Switch back to /usr/local/src to continue building other packages
As I mentioned above I have a PRI card, so I also will be installing libpri, but you can skip this step if it doesn’t apply to you.
tar zxvf libpri-1.4-current.tar.gz
OK, finally we can get to building Asterisk. Let’s find the latest certified Asterisk 13 on this page:
At the time of writing it looks like that is 13.1-cert1, so that’s what we’ll use in this example (you may need to adjust these instructions accordingly).
Download the gzip compressed Asterisk tarball.
Decompress and unpack the file
tar zxvf certified-asterisk-13.1-current.tar.gz
Switch in to the newly created source directory
Add mp3 support
Fetch all the prerequisites available in the package repository
If libvpb0 gets installed you may be prompted to type in your country calling code
After installation completes you should see a message indicating success.
## install completed successfully
There may be additional source code to grab that wasn’t retrieved from the Ubuntu repository. This will potentially install Network Broadcast Sound, libresample, jansson, libsrtp, and pjproject
Now that the prerequisites should be well covered, let’s configure Asterisk.
Run the configure script
If everything works out, you should get the ASCII art Asterisk logo
.$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$$$$$$ $$
Ensure the the modules you want are enabled.
You might want to see if there are any neat things you want. format_mp3 for example, or EXTRA-SOUNDS-EN-GSM might be desirable.
Channel Drivers -> chan_sip
Add-ons -> format_mp3
Extra Sounds Packages -> EXTRA-SOUNDS-EN-GSM
Recently the Asterisk project started using PJSIP as a replacement for the older chan_sip. If you want or need the classic Asterisk SIP module you’ll have to manually select it.
To use the deprecated chan_sip, unselect the the PJSIP channel driver.
Next, select the chan_sip driver.
When you are done making any changes “Save & Exit” out of menuconfig.
Now it is time to build Asterisk
You should get a message that the build completed successfully.
+--------- Asterisk Build Complete ---------+
+ Asterisk has successfully been built, and +
+ can be installed by running: +
+ make install +
So let’s copy the newly built files into the right places on the system
If everything went to plan, you should see a message that the install completed successfully.
+---- Asterisk Installation Complete -------+
+ YOU MUST READ THE SECURITY DOCUMENT +
+ Asterisk has successfully been installed. +
+ If you would like to install the sample +
+ configuration files (overwriting any +
+ existing config files), run: +
+ make samples +
+----------------- or ---------------------+
+ You can go ahead and install the asterisk +
+ program documentation now or later run: +
+ make progdocs +
+ **Note** This requires that you have +
+ doxygen installed on your local system +
Copy the init startup scripts to make asterisk start on boot
Adding system startup for /etc/init.d/asterisk ...
/etc/rc0.d/K91asterisk -> ../init.d/asterisk
/etc/rc1.d/K91asterisk -> ../init.d/asterisk
/etc/rc6.d/K91asterisk -> ../init.d/asterisk
/etc/rc2.d/S50asterisk -> ../init.d/asterisk
/etc/rc3.d/S50asterisk -> ../init.d/asterisk
/etc/rc4.d/S50asterisk -> ../init.d/asterisk
/etc/rc5.d/S50asterisk -> ../init.d/asterisk
And you’re done.