- Setup Open Source SIP Asterisk VOIP Server 2022
- Steps to install SIP Asterisk VOIP Server on Ubuntu
- Step #1. Update the System
- Step #2. Download Asterisk VOIP Server
- Step #3. Untar Asterisk file
- Step #4. Asterisk Directory
- Step #5. Install Dependencies and Configure before Compiling Asterisk VOIP Server
- Step #6. Enable chan_sip.co Module
- Step #7. Compile Asterisk
- Step #8. Install Asterisk in Linux
- Step #9. Check Asterisk directory in /etc
- Step #10. Add Sample Config files
- Step #10. Verify Asterisk and connect to Console
Setup Open Source SIP Asterisk VOIP Server 2022
Asterisk is a communication server just like Apache web server is to web applications. One of the application of it its Asterisk VOIP Server. Asterisk handles all the low level details of sending and receiving data using different communication protocols. When you install Asterisk as communication server its upto you to create communications applications.
In this article we will guide you with steps on how to Setup Open Source SIP Asterisk VOIP Server under the Ubuntu Linux machine. After installing Asterisk VOIP Server in ubuntu we will also setup VOIP phones and simulated Phone calls between them.
Steps to install SIP Asterisk VOIP Server on Ubuntu
We will install Asterisk VOIP Server on Ubuntu Release 20.04 as shown below.
user@user-pc:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04 LTS Release: 20.04 Codename: focal user@user-pc:~$
Step #1. Update the System
At first updated the list of the available package’s and their Version on Ubuntu using below command
sudo apt-get update
Step #2. Download Asterisk VOIP Server
Now download the tar file of Asterisk on your Linux box. In my case I am using Ubuntu. You can get the Asterisk file from here. In this we will download asterisk-19.6.0-rc1.tar.gz. Download the Asterisk using below command
wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-19.6.0-rc1.tar.gz
OUTPUT user@user-pc:~$ wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-19.6.0-rc1.tar.gz --2022-08-07 05:37:33-- https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-19.6.0-rc1.tar.gz Resolving downloads.asterisk.org (downloads.asterisk.org). 170.249.154.172 Connecting to downloads.asterisk.org (downloads.asterisk.org)|170.249.154.172|:443. connected. HTTP request sent, awaiting response. 200 OK Length: 27938361 (27M) [application/x-gzip] Saving to: ‘asterisk-19.6.0-rc1.tar.gz’ asterisk-19.6.0-rc1.tar.gz 100%[====================================================================================================================================================>] 26.64M 11.5MB/s in 2.3s 2022-08-07 05:37:36 (11.5 MB/s) - ‘asterisk-19.6.0-rc1.tar.gz’ saved [27938361/27938361] user@user-pc:~$
Once downloaded, the tar file is under your current working directory as below
user@user-pc:~$ ls -l | grep ast -rw-rw-r-- 1 user user 27880937 Jun 23 10:50 asterisk-19.6.0-rc1.tar.gz user@user-pc:~$
Step #3. Untar Asterisk file
Now we need to untar the file asterisk-19-current.tar.gz and extract the file for it using below command
tar -zxvf asterisk-19.6.0-rc1.tar.gz
Step #4. Asterisk Directory
Once untar done you will see directory named asterisk-19.6.0-rc1.
user@user-pc:~$ ls -l | grep ast drwxr-xr-x 31 user user 4096 Jun 23 10:36 asterisk-19.6.0-rc1 -rw-rw-r-- 1 user user 27880937 Jun 23 10:50 asterisk-19.6.0-rc1.tar.gz user@user-pc:~$
Step #5. Install Dependencies and Configure before Compiling Asterisk VOIP Server
In this step we should now start compiling the asterisk program so that we can install it later on the Linux machine.
Change directory to asterisk-19.6.0-rc1 using below command
cd asterisk-19.6.0-rc1/
Asterisk VOIP Server requite below libraries before complication completes without any error , I got below errors while compiling
configure: error: *** Please install the 'libedit' development package. configure: error: *** uuid support not found (this typically means the uuid development package is missing) configure: *** Asterisk requires libjansson >= 2.11 and no system copy was found. configure: *** Please install the 'libjansson' development package or configure: *** Please install the 'libxml2' development package. configure: error: *** Asterisk now uses SQLite3 for the internal Asterisk database.
To resolve above issues we need to install all above dependencies packages using below command
sudo apt-get install libedit-dev sudo apt-get install uuid-dev sudo apt-get install libjansson-dev sudo apt-get install libxml2-dev sudo apt-get install sqlite3 sudo apt-get install libsqlite3-dev
Now configure the asterisk for is libraries which later is used to compile it using command
Once Completed you will see below output which indicate the complication is completed
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 : user@user-pc:~/asterisk-19.6.0-rc1$
Step #6. Enable chan_sip.co Module
To enable SIP functioning of Asterisk we need to enable the chan_sip.co module on the asterisk-19.6.0-rc1 as below
make menuconfig
You will get below screen, Select Channel Drivers and enter
Next Put * in front of chan_sip.so as below
Press to go one level back to menu and again to go another level back and Press S to save and exit.
Step #7. Compile Asterisk
Now we will compile the asterisk serve using below command. Move to director “/home/user/asterisk-19.6.0-rc1“
Once Compilation is completed you should se below output in the end
OUTPUT at the end 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 + +-------------------------------------------+ user@user-pc:~/asterisk-19.6.0-rc1$
Step #8. Install Asterisk in Linux
Now the asterisk is complied (means its in the directory of Linux however not installed). We will now install the asterisk from complied files using below command
sudo make install
Once completed you should see below output at the end
OUTPUT at the end +---- 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 + +-------------------------------------------+ user@user-pc:~/asterisk-19.6.0-rc1$
Step #9. Check Asterisk directory in /etc
Once installation completed, you will see asterisk directory inside the /etc. This directory will be empty and will not have any configuration files in it.
user@user-pc:/etc/asterisk$ pwd /etc/asterisk user@user-pc:/etc/asterisk$ ls -l total 0 user@user-pc:/etc/asterisk$
Step #10. Add Sample Config files
Next we need to add the sample configuration files inside the asterisk directory under the /etc by using command as shown below
cd asterisk-19.6.0-rc1/ sudo make samples
After making sample configuration you should be able to see the sample file under the /etc/asterisk
user@user-pc:~/asterisk-19.6.0-rc1$ cd /etc/asterisk/ user@user-pc:/etc/asterisk$ user@user-pc:/etc/asterisk$ ls -l total 1012 -rw-r--r-- 1 root root 2816 Aug 7 06:02 acl.conf -rw-r--r-- 1 root root 140 Aug 7 06:02 adsi.conf -rw-r--r-- 1 root root 586 Aug 7 06:02 aeap.conf -rw-r--r-- 1 root root 2097 Aug 7 06:02 agents.conf -rw-r--r-- 1 root root 2328 Aug 7 06:02 alarmreceiver.conf -rw-r--r-- 1 root root 3497 Aug 7 06:02 alsa.conf -rw-r--r-- 1 root root 1196 Aug 7 06:02 amd.conf -rw-r--r-- 1 root root 338 Aug 7 06:02 app_skel.conf -rw-r--r-- 1 root root 1521 Aug 7 06:02 ari.conf ============Output Trucated==========================
Step #10. Verify Asterisk and connect to Console
Now that we have installed the Asterisk , we need to connect to its console and and verify its running using below command