How To Install Asterisk PBX 18 LTS on CentOS 7. We’re going to do Asterisk 18 LTS installation in this guide. This will be a complete easy to follow tutorial. For recent release of Asterisk, check out How to Install Asterisk 16 PBX on CentOS 7. So let’s start by defining what a PBX and Asterisk is?
What Is a PBX?
Asterisk, first and foremost, is a Private Branch Exchange. A PBX is a piece of equipment that handles telephone switching owned by a private business, rather than a telephone company. A PBX can be thought of as a private phone switchboard, connecting to one or more telephones on one side and usually connecting to one or more telephone lines on the other.
What is Asterisk?
Asterisk is a complete PBX. It implements all the major features of most commercially available PBXes. It also implements, for free, features that often cost a lot in a commercial installation: Conference calling, Direct Inward System Access, Call Parking, and Call Queues, just to name a few.
The basic features provided by Asterisk are:
Blacklisting (Block callers by Caller ID)
Call Detail Reporting
Dial by Name Directory
Interactive Voice Response (Auto Attendant)
Time Condition Call Routing
Hold Music/Recordings (MP3)
Extended Call Reporting
DISA (Direct Inward System Access)
Graphical Call Manager
Among others. So let’s get started.
Step 1 – Set Server Hostname
You can set hostname and timezone before doing any installation. Use below commands.
Compile and install DAHDI if you are connecting to PSTN. This is OPTIONAL, install if you’ll connect to PSTN.
tar xvfz dahdi-linux-complete-current.tar.gz
tar xvfz libpri-current.tar.gz
rm -f dahdi-linux-complete-current.tar.gz libpri-current.tar.gz
Compile and install pjproject
CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr \
--enable-shared --disable-sound \
--disable-resample --disable-video \
Compile and install Asterisk
tar xvfz asterisk-18-current.tar.gz
Setup menu options by running the following command
On Add-ons select chan_ooh323 and format_mp3 as shown below
On Core Sound Packages, select the formats of Audio packets like below
On Music On Hold, option select the following modules as shown in the picture below
On Extra Sound Packages select as shown below:
Now run the following command to download the mp3 decoder library into the source tree.
Do installation of selected modules
Step 5 – Configure Asterisk 18 LTS on CentOS 7
Create separate user and group to run asterisk services
Make systemctl start asterisk by copying init script to init.d dir.
cp contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk
chmod 755 /etc/init.d/asterisk
Locate asterisk by
$ which asterisk
Then open the file /etc/init.d/asterisk by
sudo vim /etc/init.d/asterisk
Replace AST_SBIN=, with your location of asterisk binary, for my case it’s /sbin/. See below image.
sed -i 's/(^SELINUX=).*/SELINUX=disabled/' /etc/selinux/config
Setup Asterisk Database
[[email protected] ~]# mysql -u root -p
create user 'asterisk'@'localhost' identified by 'password';
create database cdrdb;
create database asterisk;
GRANT ALL PRIVILEGES ON asterisk.* TO [email protected] IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON cdrdb.* TO [email protected] IDENTIFIED BY 'password';
Make all asterisk PBX ports accessible by adding the following rules
About Me:I'm the digital marketing specialist, competent in SEO (Google, Yahoo & Bing), Google Adwords (Search, Display, Google Shopping etc.), Facebook & Instagram Advertising etc. I can work in all platforms of digital marketing & advertise the legitimate products/services in a specific country, city or all over the world.
Digital marketing can be defined by SEO XOOM is as marketing your product and service on any digital platform including Google Search, Social Media and Whats-app. Remember, online success comes from partnering with an experienced digital marketing company and choosing a mix of digital platforms that best suit your marketing goals.