How To Set up Asterisk on Ubuntu 18.04

Please assist us proceed to offer you free, high quality tutorials by turning off your advert blocker on our website.

Asterisk is the preferred and broadly adopted open supply PBX platform that powers IP PBX programs, convention servers and VoIP gateways. It’s utilized by people, small companies, giant enterprises and governments worldwide.

Asterisk options embrace voicemail, music on maintain, convention calling, name queuing, name recording, interactive voice response and rather more.

This tutorial will information you thru the steps required to put in Asterisk 15 on Ubuntu 18.04.

An older model of Asterisk (model 13) is on the market within the Ubuntu software program repository and will be simply put in with apt set up asterisk.

Conditions

Earlier than persevering with with this tutorial, be sure to are logged in as a person with sudo privileges.

Replace your Ubuntu system and set up the next packages that are essential to obtain and construct Asterisk:

sudo apt replace && sudo apt improve
sudo apt set up wget build-essential subversion

Downloading Asterisk

We’re going to obtain Asterisk supply within the /usr/src listing which is the frequent location to position supply recordsdata, change to the listing with:

cd /usr/src/

Obtain the newest model of Asterisk 15 utilizing the next wget command:

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

As soon as the obtain is accomplished extract the tarball with:

sudo tar zxf asterisk-15-current.tar.gz

Earlier than persevering with with the subsequent steps, be sure to change to the Asterisk supply listing by typing:

cd asterisk-15.*/

Putting in Asterisk Dependencies

The next script will obtain the MP3 sources that are required to construct the MP3 module and use MP3 recordsdata on Asterisk:

sudo contrib/scripts/get_mp3_source.sh

Use the install_prereq script to resolve the entire dependencies in your Ubuntu system:

sudo contrib/scripts/install_prereq set up

The script will set up all needed packages and upon profitable completion, it should print the next message:

#############################################
## set up accomplished efficiently
#############################################

Putting in Asterisk

The configure script will carry out a variety of checks to ensure the entire dependencies in your system are current, begin the script by typing:

sudo ./configure

Upon profitable completion, you will notice the next output:

The following step is to pick out the modules you wish to compile and set up. Entry the Menuselect system, by typing:

sudo make menuselect

We now have already downloaded the MP3 supply recordsdata and now we have to inform Asterisk to construct the MP3 module by deciding on format_mp3:

As soon as you’re completed, press F12 to avoid wasting and exit, or swap to the Save and Exit button and press Enter.

Now we will begin the compilation course of utilizing the make command:

sudo make -j2

The compilation could take a while, relying in your system. You’ll be able to modify the -j flag in accordance the variety of cores your processor.

As soon as the construct course of is accomplished, you may be introduced with the next message:

Because the message above says, the subsequent step is to put in Asterisk and its modules by typing:

sudo make set up

As soon as the set up is completed the script will show the next message:

Now that we now have Asterisk put in we have to set up the pattern configuration recordsdata.

Set up both the generic configuration recordsdata with reference documentation by typing:

sudo make samples

Or set up the essential PBX configuration recordsdata:

sudo make basic-pbx

The final step is to put in the Asterisk init script by typing:

sudo make config

It is usually a good suggestion to run ldconfig to replace the shared libraries cache:

sudo ldconfig

Creating Asterisk Consumer

By default Asterisk runs as a root person. For safety causes we are going to create a brand new system person and configure Asterisk to run because the newly created person.

To create a brand new system person named asterisk run the next command:

sudo adduser –system –group –home /var/lib/asterisk –no-create-home –gecos “Asterisk PBX” asterisk

To configure Asterisk to run as asterisk person, open the /and so on/default/asterisk file and uncomment the next two strains:

/and so on/default/asterisk

AST_USER=”asterisk”
AST_GROUP=”asterisk”

Add the asterisk person to the dialout and audio teams:

sudo usermod -a -G dialout,audio asterisk

We additionally have to change the possession and permissions of all asterisk recordsdata and directories so the person asterisk can entry these recordsdata:

sudo chown -R asterisk: /var//asterisk /usr/lib/asterisk /and so on/asterisk
sudo chmod -R 750 /var//asterisk /usr/lib/asterisk /and so on/asterisk

Beginning Asterisk

Now that we’re all arrange, we will begin the Asterisk service with the next command:

sudo systemctl begin asterisk

To confirm that Asterisk is operating, hook up with the Asterisk command line interface (CLI) by typing:

sudo asterisk -vvvr

You will see the default Asterisk CLI immediate:

The final step is to allow Asterisk service to begin on boot with:

sudo systemctl allow asterisk

Configuring Firewall

The firewall will safe your server towards undesirable visitors.

If you do not have a firewall configured in your server, you’ll be able to test our information about the best way to setup a firewall with ufw on ubuntu

By default, SIP makes use of the UDP port 5060, to open the port run:

sudo ufw permit 5060/udp

When you enabled the Actual Time Protocol (RTP) then you definately additionally have to open the next port vary:

sudo ufw permit 10000:20000/udp

Be at liberty to regulate the firewall based on your want.

Conclusion

On this information we now have proven you the best way to set up the newest Asterisk model from supply in your Ubuntu system.

It’s best to now test the Asterisk Documentation and study extra about the best way to configure and use Asterisk.

When you hit an issue or have suggestions, go away a remark beneath.

Supply

Germany Devoted Server

Leave a Reply