How to Install Asterisk 16 on RHEL 8 / CentOS 8


Asterisk is a CLI based software implementation of a private branch exchange (PBX). In conjunction with suitable telephony hardware interfaces and network applications, Asterisk is used to establish and control telephone calls between telecommunication endpoints, such as customary telephone sets, destinations on the public switched telephone network (PSTN), and devices or services on voice over Internet Protocol (VoIP) networks. Its name comes from the asterisk (*) symbol for a signal used in dual-tone multi-frequency (DTMF) dialing. In this detailed guide, you will learn how to install Asterisk 16 on CentOS / RHEL 8.

Click here to see Asterisk Features


Step 1: Install EPEL 8 Repository

Before proceed to this article, update your system

dnf update -y

Run below command to install EPEL Release 8

dnf install -y

Step 2: Disable SELinux

Open file /etc/SELinux/config using below command and modify a line from SELINUX=enforcing to SELINUX=disabled

vi /etc/selinux/config

Then, save changes and exit

Now reboot your machine


Step 3: Install Dependencies

Install software Development tools and other required dependencies to run Asterisk using following commands.

dnf groupinstall "Development Tools" -y

dnf install git wget net-tools sqlite-devel psmisc ncurses-devel libtermcap-devel newt-devel libxml2-devel libtiff-devel gtk2-devel libtool libuuid-devel subversion kernel-devel kernel-devel-$(uname -r) crontabs cronie-anacron -y

Step 4: Compile and Install Jansson

Jansson is a C library, it is used to encode/decode and manipulate JSON data. run below commands to install it.

cd /usr/src/
git clone
cd jansson
autoreconf -i
./configure --prefix=/usr/
make && make install

Step 5: Compile and Install PJSIP

PJSIP is a free and open-source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. It combines signaling protocol (SIP) with rich multimedia framework and NAT traversal functionality into high-level API that is portable and suitable for almost any type of systems ranging from desktops, embedded systems, to mobile handsets.

run following command to install PJSIP

cd /usr/src/
git clone
cd pjproject
./configure CFLAGS="-DNDEBUG -DPJ_HAS_IPV6=1" --prefix=/usr --libdir=/usr/lib64 --enable-shared --disable-video --disable-sound --disable-opencore-amr
make dep
make install

Step 6: Install and Configure Asterisk

All dependencies are installed and Asterisk is ready for installation.

cd /usr/src/
tar xfz asterisk-16-current.tar.gz
rm -f asterisk-16-current.tar.gz
cd asterisk-16*/

Install libedit packages using below commands:

dnf install -y

dnf install -y

Asterisk Configuration

./configure --libdir=/usr/lib64

Step 7: Configure Asterisk Menu Options

Set Asterisk menu options by using the following command, you can also select your desired options.

Here you will use arrow keys (Up, Down, Right and Left) to navigate and Enter key to select the desired option. The selected option will be marked with * symbol.

make menuselect

i Select “app_macro” under Applications section.

ii Under “Add-ons” select “chan_ooh323” and “format_mp3”

iii Under “Core Sound Packages” select the following Audio formats.


iv For “Music On Hold” select the following minimal modules


v On Extra Sound Packages select as shown below


Then Save and Exit.

Step 8: Build and Install Asterisk

Download the mp3 decoder library into the source tree and build Asterisk


make install
make samples
make config

Step 9: Create Asterisk User and Start Asterisk

Create a group and user for asterisk services, and assign appropriate permissions using following commands

groupadd asterisk
useradd -r -d /var/lib/asterisk -g asterisk asterisk
usermod -aG audio,dialout asterisk
chown -R asterisk.asterisk /etc/asterisk /var/{lib,log,spool}/asterisk /usr/lib64/asterisk

Set Asterisk default user:

edit /etc/sysconfig/asterisk file by using below command

vi /etc/sysconfig/asterisk

and add below lines in this file.


Then edit /etc/asterisk/asterisk.conf file by using below command.

vi /etc/asterisk/asterisk.conf

and add below lines in this file.

runuser = asterisk ; The user to run as.
rungroup = asterisk ; The group to run as.

Step 10: Setup Asterisk service

Now restart asterisk service and enable it on boot

systemctl restart asterisk
systemctl enable asterisk
systemctl status asterisk

Verify that you can connect to Asterisk CLI by running below command

asterisk -rvv

If you entered in above screen congratulation! you have access to Asterisk on CentOS / RHEL.

Also, you can read our posts about CentOS and RHEL.

Please share this post and join our Telegram Channel.


  1. Oct 21 07:02:31 localhost.localdomain asterisk[14308]: Shutting down asterisk: [ OK ]
    Oct 21 07:02:31 localhost.localdomain systemd[1]: Stopped LSB: Asterisk PBX.
    Oct 21 07:02:31 localhost.localdomain systemd[1]: Starting LSB: Asterisk PBX…
    Oct 21 07:02:31 localhost.localdomain asterisk[14339]: Starting asterisk:
    Oct 21 07:02:31 localhost.localdomain systemd[1]: asterisk.service: Can’t open PID file /var/run/asterisk/ (yet?) after start: No such file or directory
    Oct 21 07:07:31 localhost.localdomain systemd[1]: asterisk.service: Start operation timed out. Terminating.
    Oct 21 07:07:31 localhost.localdomain systemd[1]: asterisk.service: Failed with result ‘timeout’.
    Oct 21 07:07:31 localhost.localdomain systemd[1]: Failed to start LSB: Asterisk PBX.

    Me pareciĆ³ que todo corriĆ³ bien….no se en que fallo?


Please enter your comment!
Please enter your name here