Skip to content

Instantly share code, notes, and snippets.

@linuxfemale
Created November 18, 2019 14:24
Show Gist options
  • Save linuxfemale/0cc2abd837a2fbb5a77a361a9eae99f5 to your computer and use it in GitHub Desktop.
Save linuxfemale/0cc2abd837a2fbb5a77a361a9eae99f5 to your computer and use it in GitHub Desktop.
Asterisk 16 LTS on Ubuntu 18.04
sudo apt update && sudo apt -y upgrade
sudo apt -y install git curl wget libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev uuid-dev
If you get an error for subversion package on Ubuntu like below:
E: Package 'subversion' has no installation candidate
Then add universe repository and install subversion from it:
sudo add-apt-repository universe
sudo apt update && sudo apt -y install subversion
sudo apt policy asterisk
##Download Asterisk 16 LTS tarball
cd /usr/src/
sudo curl -O http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
sudo tar xvf asterisk-16-current.tar.gz
cd asterisk-16*/
sudo contrib/scripts/get_mp3_source.sh
sudo contrib/scripts/install_prereq install
##Build and Install Asterisk 16 on Ubuntu 18.04
sudo ./configure
sudo make menuselect
Use arrow keys to navigate, and Enter key to select.
On Add-ons select chan_ooh323 and format_mp3 as shown below
On Core Sound Packages, select the formats of Audio packets like below
For Music On Hold, select the following minimal modules
On Extra Sound Packages select as shown below:
Enable app_macro under Applications menu.
You can change other configurations you see fit. When done, save and exit then install Asterisk with selected modules.
Then build Asterisk by running:
sudo make
sudo make install
sudo make progdocs
sudo make samples
sudo make config
sudo ldconfig
##Create Asterisk User
sudo groupadd asterisk
sudo useradd -r -d /var/lib/asterisk -g asterisk asterisk
sudo usermod -aG audio,dialout asterisk
sudo chown -R asterisk.asterisk /etc/asterisk
sudo chown -R asterisk.asterisk /var/{lib,log,spool}/asterisk
sudo chown -R asterisk.asterisk /usr/lib/asterisk
##Set Asterisk default user to asterisk:
sudo nano /etc/default/asterisk
AST_USER="asterisk"
AST_GROUP="asterisk"
sudo nano /etc/asterisk/asterisk.conf
runuser = asterisk ; The user to run as.
rungroup = asterisk ; The group to run as.
sudo systemctl restart asterisk
sudo systemctl enable asterisk
sudo asterisk -rvv
sudo ufw allow proto tcp from any to any port 5060,5061
@DevSecOpsGuy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment