Install Asterisk on CentOS

Asterisk is distribution-agnostic and can be installed on almost any Linux distribution. In this chapter I will guide you through the process of installing Asterisk on CentOS, a popular Linux distribution based on Red Hat. I will install the software from source, which means that I will obtain the Asterisk source code, unpack it, compile it, and then install it.

It is also possible to install Asterisk directly from a repository. Although this type of installation is much easier to perform, I feel that by installing from source you can really modify the installation to suit your needs and get to know the structure of Asterisk a little bit more. However, if you are looking for the fastest way to get Asterisk up and running, check out this article.

 

Here are the steps for installing Asterisk on CentOS:

1. First, we need to make sure that we are using the latest packages available. To update every package installed on the system, use the following command:

yum update

2. Once the updates are installed, reboot your system. We will also need to install some additional packages required by Asterisk. Run the following command in the terminal:

yum install gcc gcc-c++ make wget subversion libxml2-devel ncurses-devel openssl-devel sqlite-devel libuuid-devel vim-enhanced jansson-devel.x86_64

3. Now, we need to download the software. We will download the Asterisk source code using a tool called wget. This tool in its most basic form accepts only a single parameter – the URL of the resource you would like to download. You can get the download links on here. Multiple Asterisk versions are available, but we will download Asterisk 13 LTS using the following command (of course, to download the file, your system needs to be connected to the Internet):

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
The LTS in the name of the Asterisk release stands for Long Term Support and indicates that the release will be fully supported for four years. There are also Standard releases of Asterisk, which are supported only for a year.

 

4. Extract the files using the following command:

tar xvfz asterisk-13-current.tar.gz

5. Now, run the configure script to make sure that all the dependencies are met:

cd asterisk-13.13.1
./configure

6. Next, we need to compile the code (make), move it to the correct location on the filesystem (make install), and install the initialization script (make config):

make
make install
make config

 

Geek University 2022