Installing Asterisk 13+ on CentOS 6+ (x86_64)

Installing Asterisk 13+ on CentOS 6+ (x86_64)

January 16th, 2016 // 12:58 pm @

  1. Download/Install CentOS
    • https://wiki.centos.org/Download
  2. (Optional) Install the GUI Firewall
    • yum install system-config-firewall system-config-firewall-tui
    • sudo system-firewall-config-tui
    • Now you can ensure that your console PC has SSH access to your server (Open SSH, and we will use this later to open access for Asterisk
  3. Apply changes and reset firewalls (local linux CMD)
    • service iptables restart
  4. Now you should be able to SSH into your CentOS from a console ( the rest is assuming you are SSH ing into the OS
  5. Now we download Asterisk and extract the content
    wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13.7.2.tar.gz
    tar -zxvf asterisk-13.7.2.tar.gz

    Now let’s download and install DAHDI & LibPRI (do this ONLY if you are planning to interface with PSTN and other analog lines )

    • # wget http://downloads.asterisk.org/pub/telephony/dahdi-linux/dahdi-linux-current.tar.gz
    • # wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4-current.tar.gz
    • # tar -zxvf libpri-1.4-current.tar.gz
    • # tar -zxvf dahdi-linux-current.tar.gz
    • Now if you issue an “ls” command you should see a list of extracted tarballs
  1. Is your system pre-packed with dev-tools? if not go ahead and install them all, in case!
    • # yum groupinstall "Development Tools"
  2. Now let’s install pjsip SIP library ( pjproject-2.4.5 )
      • Now let’s install PJSIP
        # cd /usr/src
        # wget http://www.pjsip.org/release/2.4.5/pjproject-2.4.5.tar.bz2
        # tar -jxvf pjproject-2.4.5.tar.bz2# cd pjproject-2.4.5.tar.bz
        # ./configure CFLAGS="-DNDEBUG -DPJ_HAS_IPV6=1" --prefix=/usr --libdir=/usr/lib64 --enable-shared --disable-video --disable-sound --disable-opencore-amr
        # make dep
        # make
  3. Installing Asterisk
    • # cd asterisk-13.7.2.tar.gz
    • # ./configure
      • This will give you a list of all the dependent libraries. You are probably missing a bunch and the test will fail, no worries you can just install the
    • # cd contrib/scripts
    • # ./install_prereq install
    • ./install_prereq install-unpackaged
  4. Now invoke ./configure again and it should have fixed all the issues with the pre-req
    • In my case I got an erroe message
      # configure: error: *** JSON support not found (this typically means the libjansson development package is missing)
    • You can fix this by:
    • # cd /usr/src/
      # wget http://www.digip.org/jansson/releases/jansson-2.5.tar.gz
      # tar -zxf jansson-2.5.tar.gz
      # cd jansson*
      # ./configure
      # make clean
      # make
      # make install
    • Now go back to Asterisk folder and issue ./configure again. If you encounter more issues, which is likely, just find the missing dependency and install it. At the end you should see something like this (Those $ and 7s are supposed to be an Asterisk Logo, HTML messed up the output, it looks MUCH cooler! trust me! )
      
      configure: Menuselect build configuration successfully completed
                               .$$$$$$$$$$$$$$$=..
                              .$7$7.. .7$$7:.
                             .$$:. ,$7.7
                           .$7. 7$$$$ .$$77
                           ..$$. $$$$$ .$$$7
                         ..7$ .?. $$$$$ .?. 7$$$.
                        $.$. .$$$7. $$$$7 .7$$$. .$$$.
       .777. .$$$$$$77$$$77$$$$$7. $$$,
                    $$$~ .7$$$$$$$$$$$$$7. .$$$.
      .$$7 .7$$$$$$$7: ?$$$.
      $$$ ?7$$$$$$$$$$I .$$$7
      $$$ .7$$$$$$$$$$$$$$$$ :$$$.
      $$$ $$$$$$7$$$$$$$$$$$$ .$$$.
      
      configure: Package configured for:
      configure: OS type : linux-gnu
      configure: Host CPU : x86_64
      configure: build-cpu:vendor:os: x86_64 : unknown : linux-gnu :
      configure: host-cpu:vendor:os: x86_64 : unknown : linux-gnu :
      [root@localhost asterisk-13.7.2]# ./configure
  5. Now we are ready to install Asterisk. Right after ./configure invoke
    • # make menuselect
    • Here you can play around with the function you want Asterisk to fetch and install. Most probably you won’t be needing anything extra, unless you want some extra voice packages. Save your settings and exit
    • If you like to see the list in the CLI format use this
    • # menuselect/menuselect --list-options
    • or this for the categories ONLY
    • # menuselect/menuselect --category-list
  6. Building and Installing Asterisk
    • simply invoke make
      # make
    • Depending on what extra features you have chosen, the Asterisk will take it its time to download the package. Once done, you should something like this
    • Building Documentation For: 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 +
       +-------------------------------------------+
      [root@localhost asterisk-13.7.2]#
    • We are clear to install the package
      # make install
  7. Done & Done!
    • We just finished the Asterisk Installation. You should expect an output similar to this
    • make[1]: Leaving directory `/usr/src/asterisk-13.7.2/sounds'
      find rest-api -name "*.json" | while read x; do \
       /usr/bin/install -c -m 644 $x "/var/lib/asterisk/rest-api" ; \
       done
       +---- Asterisk Installation Complete -------+
       + +
       + YOU MUST READ THE SECURITY DOCUMENT +
       + +
       + Asterisk has successfully been installed. +
       + If you would like to install the sample +
       + configuration files (overwriting any +
       + existing config files), run: +
       + +
       + For generic reference documentation: +
       + make samples +
       + +
       + For a sample basic PBX: +
       + make basic-pbx +
       + +
       + +
       +----------------- or ---------------------+
       + +
       + You can go ahead and install the asterisk +
       + program documentation now or later run: +
       + +
       + make progdocs +
       + +
       + **Note** This requires that you have +
       + doxygen installed on your local system +
       +-------------------------------------------+
      [root@localhost asterisk-13.7.2]#

      WARNING

      Your Asterisk is now Live! if it’s on DMZ, you get flooded by brute-force attacks in about an hour once the public DNS starts announcing your IP. So, before going live take the following recommendation in to consideration

      1. Do not go public until your server is secured
      2. make sure you have the minimums in place for your SIP security
      3. Do NOT go public with sample config, use sample to test behind firewall on LAN
      4. Do NOT use basic SIP / Password combination
      5. if possible use static IP locking with your device

Using Sample Data

If you wish to use Asterisk sample config use the following. NOTE: This will override all the config file present on your system. Before Doing so make a copy of sip.conf and extensions.conf and then run the sample

 


# mv sip.conf sip.conf.BACKUP
# mv extensions.conf extensions.conf.BACKUP

 

# make samples

You are all set now, you can check my article on how to Setup the Asterisk from here on you can find the article here


Category : VoIP - telephony

Comments are closed.

On LinkedIn

LinkedIn

.

"I have no special talent.
I am only passionately
curious.
"
Albert Einstein

Subscribe Now