Asterisk: The Open-Source PBX Powerhouse and How to Install It on Ubuntu 22.04
Asterisk is one of the most widely used open-source platforms for building modern telephony systems. It functions as a Private Branch Exchange (PBX), enabling organizations to create, manage, and automate communication services such as VoIP, IVR, call routing, call recording, and conference calling. Backed by a strong community and extensive ecosystem, Asterisk provides high flexibility for small businesses as well as enterprise-level deployments.
This article explains the fundamentals of Asterisk, its key features, the benefits of using it in your communication infrastructure, and a complete step-by-step guide to installing Asterisk on Ubuntu 22.04.
What Is Asterisk?
Asterisk is an open-source software PBX developed by Digium (now Sangoma) that allows you to build a fully functional IP-based communication system. With Asterisk, you don’t need expensive physical PBX hardware—everything runs on a server, whether on-premise or in the cloud.
Asterisk acts as a digital phone system capable of:
- Managing inbound and outbound calls
- Providing voicemail
- Creating Interactive Voice Response (IVR) menus
- Handling call queues and call center systems
- Managing SIP trunking
- Connecting IP phones, softphones, and PSTN gateways
Because it is modular and scriptable, Asterisk is widely used in call center applications, automation systems, and enterprise telephony infrastructures.
Key Features of Asterisk
1. Complete VoIP PBX Functionality
Asterisk provides full PBX capabilities including call transfer, hold, conference calls, voicemail, and routing.
2. Multi-Protocol Support
Asterisk supports several communication protocols, such as:
- SIP
- IAX2
- RTP
- WebRTC
3. IVR and Auto-Attendant
You can build interactive and automated voice menus to direct callers efficiently.
4. Call Recording
Asterisk can record calls for compliance, auditing, or quality assurance purposes.
5. Extensibility
Asterisk supports dialplan scripting, custom modules, and integration via APIs like AMI (Asterisk Manager Interface) and ARI (Asterisk REST Interface).
6. Hardware & Software Compatibility
Asterisk works with:
- IP Phones (Yealink, Cisco, Grandstream, etc.)
- Softphones (Zoiper, Linphone, MicroSIP)
- SIP trunk providers
- PSTN/analog gateways
Benefits of Using Asterisk
1. Cost-Effective
No licensing fees, fully open-source, and easy to deploy.
2. Flexible and Scalable
Can be customized for small offices up to large call centers with thousands of extensions.
3. Strong Community Support
Asterisk has comprehensive documentation and an active global community.
4. Easily Integrates With Other Systems
Integrations with CRM, ERP, ticketing systems, bots, and analytics tools are easy via REST or socket-based APIs.
5. Production-Ready and Reliable
Trusted by thousands of enterprises, call centers, ISPs, and telecom operators.
How to Install Asterisk on Ubuntu 22.04
1. Update Your System
Run the following commands to update your Ubuntu server:
sudo apt update && sudo apt upgrade -y
sudo apt install wget curl git -y
2. Install Required Dependencies
Asterisk requires several development packages:
sudo apt install build-essential libxml2-dev libncurses5-dev uuid-dev \
libjansson-dev libssl-dev libsqlite3-dev libedit-dev pkg-config -y
3. Download the Asterisk Source Code
Navigate to /usr/src and download the latest stable version:
cd /usr/src
sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
sudo tar -zxvf asterisk-20-current.tar.gz
cd asterisk-20.*
4. Install Additional Scripts
Some modules require additional prerequisites:
sudo contrib/scripts/install_prereq install
5. Compile Asterisk
Configure
sudo ./configure
Select Modules (Optional)
sudo make menuselect
Use this menu to enable codecs (Opus, G729), add-ons, or experimental modules.
Build and Install
sudo make
sudo make install
sudo make samples
sudo make config
sudo ldconfig
6. Start Asterisk
Enable and start the service:
sudo systemctl enable asterisk
sudo systemctl start asterisk
sudo systemctl status asterisk
7. Access the Asterisk CLI
Launch the Asterisk console:
sudo asterisk -rvv
If successful, you will see:
Asterisk Ready.
Basic Asterisk Configuration
1. Configure PJSIP Endpoint (SIP User)
Edit the pjsip.conf file:
sudo nano /etc/asterisk/pjsip.conf
Add a simple SIP extension:
[1001]
type=endpoint
context=internal
disallow=all
allow=ulaw
auth=1001
aors=1001
[1001]
type=auth
auth_type=userpass
password=12345
username=1001
[1001]
type=aor
max_contacts=1
2. Configure Dialplan
Edit the dialplan:
sudo nano /etc/asterisk/extensions.conf
Add:
[internal]
exten => 1001,1,Dial(PJSIP/1001)
Reload Asterisk:
sudo asterisk -rx "core reload"
Your extension is now ready for use.
Testing With a Softphone
Install a softphone such as Zoiper or Linphone, then register with:
- Username: 1001
- Password: 12345
- Server: Your Asterisk server IP
If it registers successfully, your Asterisk installation is working.
Conclusion
Asterisk remains one of the most powerful and flexible open-source PBX solutions available today. With support for VoIP, SIP, WebRTC, and powerful automation features, it is ideal for businesses looking to build a cost-effective communication system.
By following the installation steps in this guide, you now have a fully functional Asterisk server running on Ubuntu 22.04—complete with a working SIP extension and dialplan. From here, you can expand into IVR menus, call queues, call recordings, SIP trunking, and integrations with external systems.











