Pull Requests gladly accepted How to Install the Asterisk 11 LTS PBX Server on Ubuntu 12.04
Asterisk is an open source, software implementation of a Private Branch Exchange (PBX). Asterisk is used by small & medium sized businesses and large enterprises – in addition to call centers, carriers, and government agencies.
First, you must make a few structural decisions, before you deploy your cloud PBX.
Voice quality on VoIP calls is affected by network latency, among other factors. Thus, it is advisable to select a datacenter that is closest to the general, geographic location of the majority of your anticipated calls.
Follow the steps outlined in:
-
How To Create Your First DigitalOcean Droplet Virtual Server
For increased security, it is advisable that you create your droplet with pre-installed SSH keys. See How To Use SSH Keys with DigitalOcean Droplets. Windows users: Refer How To Create SSH Keys with PuTTY to Connect to a VPS
-
Initial Server Setup with Ubuntu 12.04 | DigitalOcean.
- For added security, it is advisable that you disable password logins. See.
Set your server's hostname and Fully Qualified Domain Name by implementing the steps in Setting the Hostname & Fully Qualified Domain Name (FQDN) on Ubuntu 12.04 or CentOS 6.4.
You can change your server's timezone to whatever you want; altough it may be best to set it to the same timezone of most of your users. To do so, simply execute, in a terminal:
sudo dpkg-reconfigure tzdata
and follow the instructions in the ensuing, on-screen prompts.
To make sure that your server operating system (OS) is up to date, execute:
sudo apt-get update && sudo apt-get -y dist-upgrade && sudo apt-get -y autoremove && sudo reboot now
When the update completes, the server will reboot to make sure that all of the software upgrades take effect.
Even though Asterisk is packaged in Ubuntu's software repositories, the Asterisk release housed in the repos is out-dated. To download and extract the source files of the most-recent Long Term Support (LTS) version of Asterisk:
cd /usr/src/ && sudo wget -O - "http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-11-current.tar.gz" | sudo tar xzf -
Asterisk is prepackaged with scripts that will install most of the needed dependencies. To use the scripts included with the Asterisk source files, execute:
cd asterisk*/contrib/scripts && sudo ./install_prereq install && sudo ./install_prereq install-unpackaged
During the installation of the dependencies, you will be prompted to enter the code for the country from which your phone system will be operating, as depicted below:
Enter the number 1
for North America, including the United States or Canada; tap on the Tab
key, to highlight <Ok>
; and press Enter
.
Wikipedia maintains a list of country codes.
Now, execute:
cd /usr/src/asterisk* && sudo ./configure && sudo make menuselect && sudo make && sudo make install && sudo make config && sudo make samples
During the installation, the system will present an
Asterisk Module and Build Option Selection
menu. For a default install, tap on theTab
to highlightSave & Exit
, and pressEnter
to allow the install to continue. For more about using Menuselect, please refer to the Asterisk Wiki: Using Menuselect to Select Asterisk Options.
To start Asterisk, execute:
sudo service asterisk start
Asterisk should now be running in the background.
To connect to the Asterisk command-line interface (CLI), execute:
asterisk -rvvv
The
-r
parameter tells the system that you want to re-connect to the Asterisk service. Eachv
parameter increases the verbosity level when you connect to the Asterisk CLI.
For help in the CLI mode, execute:
help
If you would like to exit the Asterisk console and return to your shell, execute:
quit
Sample configuration files can be found in the default directory: /etc/asterisk/
. Create backups of these files:
Execute each line individually.
cd /etc/asterisk
sudo mv modules.conf modules.conf.sample
sudo mv extensions.conf extensions.conf.sample
sudo mv sip.conf sip.conf.sample
sudo mv iax.conf iax.conf.sample
and use them as templates to create new configurations for testing or production purposes.
To receive email notifications from your Asterisk server, follow the steps outlined in How To Install a Send-Only Mail Server with Exim on Ubuntu 12.04 | DigitalOcean.
Any server accessible from the public Internet should be security hardened, and an Asterisk IP-PBX is no exception. Security best practices, however, are not within the scope of this article.
As always, if you need help with the steps outlined in this How-to, look to the DigitalOcean Community for assistance by posing your question(s), below.
Pull Requests gladly accepted