asterisk | LinuxHostSupport Linux Tutorials and Guides Thu, 01 Jul 2021 08:16:04 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 How to Install Asterisk on Ubuntu 20.04 https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-20-04/ https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-20-04/#comments Wed, 30 Jun 2021 17:30:40 +0000 https://linuxhostsupport.com/blog/?p=1429 Asterisk is an open-source framework used for building communications applications including VoIP gateways, and conference servers. It is used by small businesses, enterprises, call centers, and governments worldwide. Asterisk uses a VoIP protocol that allows you to make a call using the TCP/IP without any cost. It provides very useful features including, voicemail, call recording, […]

The post How to Install Asterisk on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
Asterisk is an open-source framework used for building communications applications including VoIP gateways, and conference servers. It is used by small businesses, enterprises, call centers, and governments worldwide. Asterisk uses a VoIP protocol that allows you to make a call using the TCP/IP without any cost. It provides very useful features including, voicemail, call recording, automatic call, music on hold, messaging, and more.install asterisk on ubuntu 20.04

Asterisk can run on multiple operating systems, although it was originally created for Linux. Today, NetBSD, macOS, and Solaris users, among others, can install and use the Asterisk software with ease.

In this guide, we will show you how to install and configure Asterisk on Ubuntu 20.04.

Prerequisites

  • An Ubuntu 20.04 VPS (we’ll be using our SSD 2 VPS plan)
  • Access to the root user account (or access to an admin account with root privileges)

Log in to the Server & Update the Server OS Packages

First, log in to your Ubuntu 20.04 server via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the admin account if necessary.

Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:

apt-get update -y
apt-get upgrade -y

Install Required Dependencies

Before starting, you will need to install some dependencies required to build the Asterisk server. You can install all of them using the following command:

apt-get install build-essential git autoconf wget subversion pkg-config libjansson-dev libxml2-dev uuid-dev libsqlite3-dev libtool -y

Once all the packages are installed, you will need to install DAHDI to communicate Asterisk with analog and digital telephones.

First, download the latest version of DAHDI to the /opt directory:

cd /opt
git clone -b next git://git.asterisk.org/dahdi/linux dahdi-linux

Next, change the directory to the downloaded directory and compile it using the following command:

cd dahdi-linux
make
make install

Next, download the DAHDI tools with the following command:

cd /opt
git clone -b next git://git.asterisk.org/dahdi/tools dahdi-tools

Once the download is completed, configure and install it with the following command:

cd dahdi-tools
autoreconf -i
./configure
make install
make install-config
dahdi_genconf modules

Next, download the LibPRI to communicate Asterisk with ISDN connections.

git clone https://gerrit.asterisk.org/libpri libpri
cd libpri

Next, install it using the following command:

make
make install

Once all the necessary tools are installed, you can proceed to install Asterisk.

Install Asterisk

By default, the Asterisk package is not included in the Ubuntu 20.04 default repository. So you will need to download and compile it from the source. You can download it from the Git Hub using the following command:

git clone -b 18 https://gerrit.asterisk.org/asterisk asterisk-18

Once the download is completed, change the directory to the downloaded directory and install required dependencies with the following command:

cd asterisk-18/
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install

Next, configure the Asterisk with the following command:

./configure

You should get the following output:

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$$$$$$$$$$$$    .$$$.  
$$$        $$$   7$$$7  .$$$    .$$$.   
$$$$             $$$$7         .$$$.    
7$$$7            7$$$$        7$$$      
 $$$$$                        $$$       
  $$$$7.                       $$  (TM)     
   $$$$$$$.           .7$$$$$$  $$      
     $$$$$$$$$$$$7$$$$$$$$$.$$$$$$      
       $$$$$$$$$$$$$$$$.                

configure: Package configured for: 
configure: OS type  : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : pc : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : pc : linux-gnu :

Next, you will need to select the modules that you want to install with Asterisk. You can select it using the following command:

make menuselect

You can use the Arrow key to navigate and Enter key to select the modules.

Select and enables the Addons as shown below: how to install asterisk on ubuntu 20.04

Next, enable the Core sound modules: set up asterisk on ubuntu 20.04 Next, enable the additional MOH packages: how to set up asterisk on ubuntu 20.04 Next, enable the Extra Sound Packages: setting up asterisk on ubuntu 20.04

Now, click on the Save and Exit button.

Next, build the Asterisk using the following command:

make -j2

Next, Asterisk and its modules using the following command:

make install

You should get the following output:

 +---- 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    +
 +-------------------------------------------+

You can also install the documentation and basic PBX config files with the following command:

make samples
make basic-pbx

Next, install the Asterisk init script with the following command:

make config

Next, update the shared libraries using the following command:

ldconfig

Create Asterisk User

It is always recommended to run Asterisk as a standalone user for security reasons.

First, create a new Asterisk user with the following command:

adduser --system --group --home /var/lib/asterisk --no-create-home --gecos "Asterisk PBX" asterisk

Next, edit the Asterisk default configuration file and configure it to run as a asterisk user:

nano /etc/default/asterisk

Uncomment the following lines:

AST_USER="asterisk"
AST_GROUP="asterisk"

Save and close the file then add the asterisk user to dialout and audio group:

usermod -a -G dialout,audio asterisk

Next, set proper ownership and permissions of all Asterisk files and directories with the following command:

chown -R asterisk: /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk
chmod -R 750 /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk

Start and Verify Asterisk

At this point, Asterisk is installed and configured. Now, you can start the Asterisk service using the following command:

systemctl start asterisk

You can also enable the Asterisk service to start at system reboot with the following command:

systemctl enable asterisk

To check the status of the Asterisk service, run the following command:

systemctl status asterisk

You should get the following output:

● asterisk.service - LSB: Asterisk PBX
     Loaded: loaded (/etc/init.d/asterisk; generated)
     Active: active (running) since Sun 2021-05-16 12:24:29 UTC; 13s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 60668 ExecStart=/etc/init.d/asterisk start (code=exited, status=0/SUCCESS)
      Tasks: 46 (limit: 4691)
     Memory: 34.7M
     CGroup: /system.slice/asterisk.service
             └─60685 /usr/sbin/asterisk -U asterisk -G asterisk

May 16 12:24:29 ubuntu2004 systemd[1]: Starting LSB: Asterisk PBX...
May 16 12:24:29 ubuntu2004 asterisk[60668]:  * Starting Asterisk PBX: asterisk
May 16 12:24:29 ubuntu2004 asterisk[60668]:    ...done.
May 16 12:24:29 ubuntu2004 systemd[1]: Started LSB: Asterisk PBX.

Now, connect to the Asterisk command line utility with the following command:

asterisk -vvvr

Once connected, you should get the following output:

Asterisk GIT-18-78d7862463, Copyright (C) 1999 - 2021, Sangoma Technologies Corporation and others.
Created by Mark Spencer 
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 GIT-18-78d7862463 currently running on ubuntu2004 (pid = 60685)
ubuntu2004*CLI> 

Congratulations! You have successfully installed and configured Asterisk server on Ubuntu 20.04 VPS.

Of course, you don’t have to install and set up Asterisk if you use one of our Managed VPS Hosting services, in which case you can simply ask our expert Linux admins to install Asterisk on Ubuntu 20.04, for you. They are available 24×7 and will take care of your request immediately. If you’re looking to find something else, such as how to install Magento or Elasticsearch on Ubuntu 20.04, check out our blog.

install asterisk on ubuntu 20.04

If you liked this post on how to install Asterisk on Ubuntu 20.04, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Asterisk on Ubuntu 20.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-20-04/feed/ 9
How to Install Asterisk on Ubuntu 16.04 https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-16-04/ https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-16-04/#comments Wed, 18 Jul 2018 09:57:44 +0000 https://linuxhostsupport.com/blog/?p=617 In this tutorial, we will show you how to install Asterisk on an Ubuntu 16.04 server. Asterisk is the most popular open source software implementation of a telephone private branch exchange (PBX). It includes many features such as: voicemail, conference calling, call recorder, automatic call distribution, interactive voice response, real time monitoring, debugging console and supports most […]

The post How to Install Asterisk on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
In this tutorial, we will show you how to install Asterisk on an Ubuntu 16.04 server. Asterisk is the most popular open source software implementation of a telephone private branch exchange (PBX). It includes many features such as: voicemail, conference calling, call recorder, automatic call distribution, interactive voice response, real time monitoring, debugging console and supports most of the standard voice over IP (VOIP) protocols including SIP, d H.323 and MGCP.

Login via SSH and update the OS

Make sure your server OS is fully up-to-date:

apt-get update
apt-get upgrade

Install all required packages and dependencies

Install all required packages on your Asterisk VPS with the following commands:

apt-get install build-essential
apt-get install git-core subversion libjansson-dev sqlite autoconf automake libxml2-dev libncurses5-dev libtool

Download Asterisk

At the time of the writing of this article the latest Asterisk version is 15.5.0, switch to the /usr/src/directory with:

cd /usr/src/

and download the asterisk archive with the following wget command:

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

When the download is completed extract the asterisk-15-current.tar.gz file by typing the following command:

tar -zxvf asterisk-15-current.tar.gz

Compile Asterisk

Once the asterisk archive is extracted, switch to the asterisk-15.5.0 directory with:

cd /usr/src/asterisk-15.5.0

Install all of the missing dependencies with the help of the install_prereq script:

./contrib/scripts/install_prereq install

Depending on the number of the missing packages the installation may take some time , once it is completed the output will look like this:

Current status: 7 (-2) upgradable.
#############################################
## install completed successfully
#############################################

Next step is to run the ./configure script which will check your system for missing libraries and dependencies and prepare the Asterisk code for the build process:

./configure 

The output of the successful completion should look like this:

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$$$$$$    .$$.
$$        $$   7$$7  .$$    .$$.
$$             $$7         .$$.
7$$7            7$$        7$$
 $$$                        $$
  $$7.                       $  (TM)
   $$$$.           .7$$$  $
     $$$$$$7$$$$$.$$$
       $$$$$$$$.

configure: Package configured for:
configure: OS type  : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : pc : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : pc : linux-gnu :

Once the configuration is completed start the compilation process using the make command by typing:

make

The build process may take several minutes depending on your system speed and once it is completed you will see the following message which means that the Asterisk was successfully compiled:

+--------- Asterisk Build Complete ---------+
+ Asterisk has successfully been built, and +
+ can be installed by running:              +
+                                           +
+                make install               +
+-------------------------------------------+

The next step is to run the make install command which will install Asterisk and all compiled Asterisk modules:

make install

Upon successful Asterisk installation you will see the following message on your screen:

 +---- 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    +
 +-------------------------------------------+

As the message above says run the make samples command to install the Asterisk sample configuration files:

make samples

Install the initialization script so that you can manage your Asterisk service using the systemctl command :

make config

The command above will show no output.

You can also install the logrotation script with:

make install-logrotate

You will see the following output indicating that the logrotation configuration has been successfully created:

if [ ! -d "/etc/asterisk/../logrotate.d" ]; then \
        /usr/bin/install -c -d "/etc/asterisk/../logrotate.d" ; \
fi
sed 's#__LOGDIR__#/var/log/asterisk#g' < contrib/scripts/asterisk.logrotate | sed 's#__SBINDIR__#/usr/sbin#g' > contrib/scripts/asterisk.logrotate.tmp
/usr/bin/install -c -m 0644 contrib/scripts/asterisk.logrotate.tmp "/etc/asterisk/../logrotate.d/asterisk"
rm -f contrib/scripts/asterisk.logrotate.

Start Asterisk

Now that you have Asterisk installed on your Ubuntu 16.04 VPS you can use the systemctl to start the Asterisk service:

systemctl start asterisk

To check if the Asterisk service is started use the systemctl status command:

systemctl status asterisk

If the service is running you will see the following message:

● asterisk.service - LSB: Asterisk PBX
   Loaded: loaded (/etc/init.d/asterisk; bad; vendor preset: enabled)
   Active: active (running) since Wed 2018-07-18 03:36:23 CDT; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15427 ExecStart=/etc/init.d/asterisk start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/asterisk.service
           └─15440 /usr/sbin/asterisk

To enable the asterisk service to start on system boot type the following command:

systemctl enable asterisk

That is it. The Asterisk installation is complete.


Install Asterisk on Ubuntu 16.04Of course you don’t have to install Asterisk on Ubuntu 16.04 yourself if you use our Premium Server Support Services, in which case you can simply ask our expert Linux admins to install Asterisk on Ubuntu 16.04 for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this on how to install Asterisk on Ubuntu 16.04, post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

The post How to Install Asterisk on Ubuntu 16.04 appeared first on LinuxHostSupport.

]]>
https://linuxhostsupport.com/blog/how-to-install-asterisk-on-ubuntu-16-04/feed/ 12