How to Install Asterisk on CentOS 7
0

Asterisk is an open supply framework used for constructing communication functions. You should use it to show a neighborhood laptop or server to communication server. It’s used to energy IP PBX techniques, VoIP gateways, convention servers and different options. It’s utilized by all sort of organizations worldwide and at last, however not final it’s free and open supply.

On this tutorial, we’re going to present you easy methods to set up Asterisk on CentOS 7 (directions additionally works on RHEL 7), however earlier than we begin, we might want to make some preparations so Asterisk can run easily after the set up.

Step 1: Disable SELinux on CentOS 7

To do that, first SSH to your system and utilizing your favourite command line textual content editor, open /and many others/selinux/config and disable SELINUX.

# vim /and many others/selinux/config
 

SELinux line ought to appear to be this:

SELINUX=disabled
 

Now reboot your system. As soon as it comes again SSH once more to that system.

Step 2: Set up Required Packages

Asterisk has fairly a couple of necessities that must be put in. You should use the next yum command to put in required packages as proven.

# yum set up -y epel-release dmidecode gcc-c++ ncurses-devel libxml2-devel make wget openssl-devel newt-devel kernel-devel sqlite-devel libuuid-devel gtk2-devel jansson-devel binutils-devel
 

Subsequent, set up PJSIP, is a free open supply multimedia communication library that implements normal primarily based protocols corresponding to SIP,SDP,RTP,STUN,TURN and ICE. It’s the Asterisk SIP channel driver that ought to enhance the readability of the calls.

To get the most recent model, first let’s create a short lived listing the place we’ll construct the package deal from supply.

# mkdir ~/construct && cd ~/construct
 

Now go the PJSIP obtain web page and seize the package deal or use the next wget command to obtain the package deal immediately in terminal.

Notice that by the writing of this text the most recent model is 2.8, this will change in future, thus be sure to make use of the most recent model:

# wget https://www.pjsip.org/release/2.8/pjproject-2.8.tar.bz2
 

As soon as the obtain is full, extract the file and alter to that listing.

# tar xvjf pjproject-2.8.tar.bz2
 # cd pjproject-2.8
 

The following step is to arrange the package deal to be compiled. You should use the next command:

./configure CFLAGS="-DNDEBUG -DPJ_HAS_IPV6=1" --prefix=/usr --libdir=/usr/lib64 --enable-shared --disable-video --disable-sound --disable-opencore-amr
 

You shouldn’t see any errors or warnings. Make sure that all dependencies are met:

# make dep
 

And now we are able to full the set up and hyperlink libraries with:

# make && make set up && ldconfig
 

Lastly be sure that all libraries are put in and current:

# ldconfig -p | grep pj
 

It is best to get the next output:

        libpjsua2.so.2 (libc6,x86-64) => /lib64/libpjsua2.so.2
         libpjsua2.so (libc6,x86-64) => /lib64/libpjsua2.so
         libpjsua.so.2 (libc6,x86-64) => /lib64/libpjsua.so.2
         libpjsua.so (libc6,x86-64) => /lib64/libpjsua.so
         libpjsip.so.2 (libc6,x86-64) => /lib64/libpjsip.so.2
         libpjsip.so (libc6,x86-64) => /lib64/libpjsip.so
         libpjsip-ua.so.2 (libc6,x86-64) => /lib64/libpjsip-ua.so.2
         libpjsip-ua.so (libc6,x86-64) => /lib64/libpjsip-ua.so
         libpjsip-simple.so.2 (libc6,x86-64) => /lib64/libpjsip-simple.so.2
         libpjsip-simple.so (libc6,x86-64) => /lib64/libpjsip-simple.so
         libpjnath.so.2 (libc6,x86-64) => /lib64/libpjnath.so.2
         libpjnath.so (libc6,x86-64) => /lib64/libpjnath.so
         libpjmedia.so.2 (libc6,x86-64) => /lib64/libpjmedia.so.2
         libpjmedia.so (libc6,x86-64) => /lib64/libpjmedia.so
         libpjmedia-videodev.so.2 (libc6,x86-64) => /lib64/libpjmedia-videodev.so.2
         libpjmedia-videodev.so (libc6,x86-64) => /lib64/libpjmedia-videodev.so
         libpjmedia-codec.so.2 (libc6,x86-64) => /lib64/libpjmedia-codec.so.2
         libpjmedia-codec.so (libc6,x86-64) => /lib64/libpjmedia-codec.so
         libpjmedia-audiodev.so.2 (libc6,x86-64) => /lib64/libpjmedia-audiodev.so.2
         libpjmedia-audiodev.so (libc6,x86-64) => /lib64/libpjmedia-audiodev.so
         libpjlib-util.so.2 (libc6,x86-64) => /lib64/libpjlib-util.so.2
         libpjlib-util.so (libc6,x86-64) => /lib64/libpjlib-util.so
         libpj.so.2 (libc6,x86-64) => /lib64/libpj.so.2
         libpj.so (libc6,x86-64) => /lib64/libpj.so
 

Step 3: Set up Asterisk in CentOS 7

We are actually able to provoke the set up of Asterisk. Navigate again to our ~/construct listing:

# cd ~/construct
 

Go to Asterisk obtain web page and seize the the most recent model or you should use the next wget command to obtain the file in terminal.

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

By the writing of this tutorial, the most recent Asterisk model is 16. Just remember to are downloading the most recent model of Asterisk, if you find yourself following the steps.

Now extract the archive and navigate to the newly created listing:

# tar -zxvf asterisk-16-current.tar.gz
 # cd asterisk-16.0.0
 

That is the time to say, that in the event you want to allow mp3 assist to play music whereas shopper is on maintain, you will have to put in few extra dependencies. These steps are optionally available:

# yum set up svn
 # ./contrib/scripts/get_mp3_source.sh
 

After the second step, it’s best to get output much like these:

A    addons/mp3
 A    addons/mp3/MPGLIB_README
 A    addons/mp3/frequent.c
 A    addons/mp3/huffman.h
 A    addons/mp3/tabinit.c
 A    addons/mp3/Makefile
 A    addons/mp3/README
 A    addons/mp3/decode_i386.c
 A    addons/mp3/dct64_i386.c
 A    addons/mp3/MPGLIB_TODO
 A    addons/mp3/mpg123.h
 A    addons/mp3/layer3.c
 A    addons/mp3/mpglib.h
 A    addons/mp3/decode_ntom.c
 A    addons/mp3/interface.c
 

Begin by working the configure script to arrange the package deal for compiling:

# ./configure --libdir=/usr/lib64
 

If you happen to get any lacking dependencies set up them. In my case, I obtained the next error:

configure: error: patch is required to configure bundled pjproject
 

To go round this merely run:

# yum set up patch 
 

And re-run the configure script. Now lets begin the construct course of:

# make menuselect
 

After few seconds, it’s best to get a listing of options to allow:

Asterisk Modules

Asterisk Modules

If you happen to try to make use of music on maintain function, you will have to allow the “format_mp3” function from “Add-ons” part. Save your checklist and run the next command:

# make set up
 

To put in the pattern configuration information, use the command under:

# make samples
 

To start out Asterisk on boot, use:

# make config
 

Lastly let’s check our set up with:

# service asterisk begin
 # asterisk -rvv
 

It is best to see output much like this one:

Asterisk 16.0.0, Copyright (C) 1999 - 2018, Digium, Inc. and others.
 Created by Mark Spencer <[email protected]>
 Asterisk comes with ABSOLUTELY NO WARRANTY; sort 'core present guarantee' for particulars.
 That is free software program, with parts licensed beneath the GNU Common Public
 License model 2 and different licenses; you might be welcome to redistribute it beneath
 sure situations. Sort 'core present license' for particulars.
 =========================================================================
 Related to Asterisk 16.0.Zero at the moment working on asterisk (pid = 3985)
 asterisk*CLI>
 

If you wish to see a listing of obtainable instructions sort:

asterisk*CLI> core present assist
 

To exit the Asterisk immediate, merely sort:

asterisk*CLI> exit
 

Asterisk will nonetheless be working within the background.

Conclusion

Now you’ve gotten a working Asterisk server and you can begin connecting telephones and extensions and modify your configuration per your wants. For extra particulars easy methods to obtain this, it is strongly recommended to make use of the Asterisk Wiki web page. If in case you have any questions or feedback, please tell us within the remark part under.

Methods to Begin a E-newsletter for Your Website

Previous article

Add a Highly effective LMS to WordPress with Masterstudy Theme

Next article

You may also like

Comments

Leave a Reply

More in centos