How to install Asterisk: Asterisk installation on centos

Today, In this article we will know how to Asterisk Installation on centos 8 or a RedHat-based system. Know more about asterisk installation Installation and configuration of WebRTC with asterisk on Amazon What New in Asterisk 16

Step 1: Updating system

Update your system before installing Asterisk.

sudo yum -y update

After updating set SELinux in permissive mode by running following commands:

setenforce 0
sudo sed -i 's/\(^SELINUX=\).*/\SELINUX=permissive/' /etc/selinux/config
reboot

if you open selinux using “sudo nano /etc/selinux/config” will look like this because we have set selinux in permissive mode:

Step 2: Add EPEL Repository

Add EPEL repository to your CentOS 8 by using following commands:

sudo yum -y install epel-release
sudo yum config-manager --set-enabled powertools

Step 3: Install Development Tools

Now install Development tools and required packages because they are pre-requisite for Asterisk.

sudo yum group -y install "Development Tools"
sudo yum -y install git wget vim 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 libedit libedit-devel

Step 4:

Create a source directory. Here I have used /usr/src and Download the Asterisk Recent version.

wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz

Now we need to unzip/untar this.

tar -xf asterisk-16-current.tar.gz

Now Asterisk 16 latest version has been downloaded.

Step 5

You’re now ready to install the prerequisites needed to build and run Asterisk. The Asterisk team has made this process as easy as possible by providing a install_prereq script to automatically install the needed dependencies based on your distribution. This script is located in Asterisk Folder/Contrib/Scripts.

./install_prereq install

Step 6

Now that the prerequisites have been installed, you can run the configure scripts in preparation for building Asterisk. This command below will run configure scripts for Asterisk:

./configure --with-jansson-bundled

By default, Asterisk uses the menuselect utility to present you with a graphical list of configuration options. Take the time to review these to get a sense of the many modules and options available in an Asterisk installation:

make menuselect

With the configuration script run, you’re ready to build Asterisk from source using make. I’ve not included the output below to save space, but once make is done running, you will see a success prompt and instructions to run the installation:

make

You will get the output like the below

Building Documentation For: third-party channels pbx apps codecs formats cdr cel bridges funcs tests main res addons
+--------- Asterisk Build Complete ---------+
+ Asterisk has successfully been built, and +
+ can be installed by running: +
+ +
+ make install +
+-------------------------------------------+

Once the build has been completed, you are ready to install Asterisk. As the prompt suggests, this task is easy: Just run make install. I also recommend running make samples (to generate config file samples) and make config (to generate systemd unit files).

make install
make samples
make config
systemctl restart asterisk
asterisk -r

[root@localhost ~]# asterisk -r
Asterisk 16.23.0, Copyright (C) 1999 – 2021, Sangoma Technologies Corporation and others.
Created by Mark Spencer markster@digium.com
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under

certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 16.23.0 currently running on localhost (pid = 20587)

Learn More about Asterisk: Asterisk Call Recordings with MixMonitor

Leave a Reply