Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8. Schedule a Connect

Our Leadership team is attending CloudFest 2026, from Mar 22 - April 8.

Discuss MSP growth, DevOps excellence, and Cloud Transformation. Available for 1:1 meetings, Schedule a Connect

  • DevOps
    Case Study

    How we helped a development company rebuild DevOps for efficiency and scale.

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How a US hosting leader scaled with us!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    Enabling financial grade platforms through strategic cloud modernisation.

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Managed Services Overview
  • Kubernetes Consulting
  • DevOps as a Service
  • Infrastructure Monitoring
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Services
  • Managed Services

aws partneraws advanced partner
LinkedInFacebookXInstagramYouTube
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

All you want to know about Asterisk – Asterisk PBX – Part 3

Author Profile
Scott S
  • 8 min read
All you want to know about Asterisk – Asterisk PBX – Part 3

Generating audio, please wait...

Asterisk is an OpenSource framework for building communication applications. By installing Asterisk you turn an ordinary computer into an VoIP server or communication server. An asterisk server holds the database of the users telephone number, IP address and other mapping information.

Lets learn the Asterisk server on the go with the installation and configuration procedures.

System Requirements

Hardware : Asterisk can run on all general purpose computers as well as on embedded systems. There are no strict requirements regarding memory size and the speed of the CPU.

Operating System :  The officially supported OS is LINUX with a kernel version higher than 2.6.25. But Asterisk can run on many other operating systems including Windows.

The recommended OS for Asterisk configuration/installation is Redhat based CentOS or Debian based Ubuntu.

The below are the system configuration that I use in this tutorial:

Screenshot from 2016-02-06 12:50:09

 

Asterisk Installation

Asterisk installation  can be done using two common methods

Using Ubuntu Repository

The easiest method for installing Asterisk on Ubuntu 12.04 or later is using the Ubuntu repositories. The default Ubuntu repository has the package for Asterisk. So we install it using the below commands.


root@asterisk:~# apt-get update

root@asterisk:~# apt-get upgrade

root@asterisk:~# apt-get install asterisk libpri1.4 dahdi

The DAHDI library allows Asterisk to communicate with analog/digital telephones and telephone lines, including connections to PSTN. The libpri library allows Asterisk to communicate with ISDN connections.

Note: If you are using any traditional analog telephones with VOIP and integrating with PSTN network you need to have dahdi and libpri. For the basic peer to peer SIP configuration using IP phones, the installation of asterisk package is enough.

Once the packages are installed, you can check the installation using the below command:


root@asterisk:~# asterisk -rvvv

You should get the Asterisk command line interface as shown in the screenshot below: It shows the version of Asterisk installed.

Here its Asterisk 1.8.10.1.

By default, Asterisk will be started and running after installation, so use the -r switch with asterisk command to reconnect to asterisk which is already running and -vvv represents the verbosity.

Screenshot from 2016-02-06 12:59:44

 

From Source

1) Download the Asterisk package from their official site as shown below.


root@asterisk:~# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-<version>-current.tar.gz

Replace <version> with the Asterisk version you prefer.

2) Untar the Asterisk source file as shown below;


root@asterisk:~# tar -zxvf asterisk-&lt;version&gt;-current.tar.gz

3) Change directory to the extracted Asterisk Directory


root@asterisk:~# cd asterisk*

4) Run the Make file to compile Asterisk


root@asterisk:~# make

5) Now install the compiled Asterisk program and modules using the below command


root@asterisk:~# make install

6) Make the sample configuration files used by Asterisk using the below command


root@asterisk:~# make sample

7) Install the init scripts so that Asterisk runs when the system starts.


root@asterisk:~# make config

8) make sure that Asterisk is installed correctly using the below Asterisk init script command


root@asterisk:~# /etc/init.d/asterisk status

The output should show the status of Asterisk as Running.

Configuring Asterisk PBX.

Once Asterisk is installed, we get the main configuration file for Asterisk located at /etc/asterisk/asterisk.conf.

We are configuring Asterisk using SIP protocol. The SIP configuration file for Asterisk is located at /etc/asterisk/sip.conf.

Another configuration file located at /etc/asterisk/extensions.conf is used for configuring the database for Asterisk. The database here means the information on mapping numbers, SIP accounts and other dialing options.

First edit /etc/asterisk/sip.conf with the following entries.

====================================

[general]
transport=udp

[this_context]
type=friend
host=dynamic
context=this_context
disallow=all
allow=ulaw

[sip_name1](this_context) //SIP account 1
secret=your_pass_for_sipaccount1

[sip_name2](this_context) //SIP account 2
secret=your_pass_for_sipaccount2

========================================

The [general] options is set to use UDP as the transport protocol. All the sip accounts inherit the settings defined in the [general] section.

Then a context section is defined with a desired name, and then set the context variable under that section to that name. The type variable is friend in this tutorial. Most of the peer to peer SIP connections use friend as the type. Some other general variables are also defined.

The [sip_name1] and [sip_name2] defines two SIP account name/id’s respectively. The secret in sip section defines the respective sip account’s password. Also make sure to define the context to be used by the SIP accounts as shown in the conf.

You can choose your desired context name.

Now we edit /etc/asterisk/extensions.conf with the following entries:

===========================================

[this_context]
exten=>100,1,Dial(SIP/sip_name1)

exten=>200,1,Dial(SIP/sip_name2)

===========================================

The extensions.conf file has all the details regarding the SIP extensions. Configuring extensions.conf is also known as Dialplan Configuration.

Here, first we define that the context to be used is [this_context]. Then we use dialplan commands for further configurations. “exten” is a dialplan command to specify an extension number. The exten command format is :

exten=><extensionnumber>,<priority>,<commandoptions>(Protocol/id)

So, exten=>100,1,Dial(SIP/sip_name1) means, if the number/extension request is 100, Dial the SIP account named sip_name1 as the first priority. Similarly for extension 200, Dial the SIP account named sip_name2.

Configuring SIP Clients

For both Soft and Hard IP phones, the SIP account creation and registration is the foremost thing to accomplish. Different phones have different methods to register the SIP account.

Zoiper is one among several soft IP phones that are available for Linux OS. You can install and configure Zoiper as the SIP client with the instructions given below.

1) Download and install the Zoiper soft phone from their official website http://www.zoiper.com/en/voip-softphone/download/zoiper3

2) Run the Zoiper soft phone.

3) Click Settings and select “Create a new account”

Screenshot from 2016-02-06 18:01:47

4) Select SIP as the account type.

Screenshot from 2016-02-06 18:03:35

 

5) Enter the SIP account credentials which is already specified in the /etc/asterisk/sip.conf file.

The SIP account name and password should match the values specified in the sip.conf file. The Server IP should be the hostname or the IP address of the Asterisk server.

Screenshot from 2016-02-06 18:13:42

6) Set a desired name for the Account Name.

Screenshot from 2016-02-06 18:12:59

 

7) The new SIP account will be setup after doing above mentioned steps correctly. Then Click on settings as mentioned in step 3 and click “preferences“.

8) Click the register button to make sure that the SIP account is registered to be used with Asterisk. And you are done.

Follow the same steps and install Zoiper on an another system on the same network. But this time make sure to add the SIP account2 (sip_name2)  in the /etc/asterisk/sip.conf file.

Now you can communicate over VoIP using both the Zoiper soft IP phones. Once this is done, the Zoiper phone registered with SIP account sip_name1 will have extension 100 and the phone with SIP account registered as sip_name2 will have its extension as 200. From sip_name1 phone dial 200 to reach the other phone and vice versa.

This is the very basics of VoIP configuration, ie; you enable VoIP call between the two soft phones registered.

Similarly you can add SIP accounts in the /etc/asterisk/sip.conf file and add the corresponding extensions in /etc/asterisk/extensions.conf file. Then register soft phones with the new credentials, now all the phones are in the private branch network.This is the very basic working of a PBX running Asterisk as the PBX server.

In the next blog, we will get a little deeper and see how to use dialplan commands to build an IVR(Interactive Voice Response) menu for use in the PBX and also how to configure the Grandstream GPX1625 IP phone to be used with Asterisk.

Recommended Readings

VoIP Fundamentals

VoIP System Architecture

Asterisk IVR

Get 24/7 expert server management

  • Linux

All you want to know about Asterisk – VoIP system architecture – Part 2

All you want to know about Asterisk – VoIP system architecture – Part 2
  • Howtos
  • Linux
logo

All you want to know about Asterisk – VoIP Fundamentals – Part 1

All you want to know about Asterisk – VoIP Fundamentals – Part 1
  • Howtos
  • Linux
logo

Asterisk Setup – Frequently Asked Questions and Answers

Asterisk Setup – Frequently Asked Questions and Answers
  • Linux
logo

CEPH -Part 5 – Ceph Configuration on Ubuntu

CEPH -Part 5 – Ceph Configuration on Ubuntu
  • Howtos
  • Linux
logo
All you want to know about Asterisk – Asterisk PBX – Part 3

Posts by Scott S

Scott follows his heart and enjoys design and implementation of advanced, sophisticated enterprise solutions. His never ending passion towards technological advancements, unyielding affinity to perfection and excitement in exploration of new areas, helps him to be on the top of everything he is involved with. This amateur bike stunting expert probably loves cars and bikes much more than his family. He currently spearheads the Enterprise Solutions and Infrastructure Consultancy wing of SupportSages.