Learn how to install Asterisk PBX Server on CentOS 8 with this comprehensive guide. Follow step-by-step instructions to set up and configure Asterisk for your communication needs. #centlinux #linux #asterisk
Table of Contents
What is PBX?
PBX is a telephone exchange or switching system that serves a private organization and permits sharing of central office trunks between internally installed telephones, and provides intercommunication between those internal telephones within the organization without the use of external lines. The central office lines provide connections to the public switched telephone network (PSTN) and the concentration aspect of a PBX permits the shared use of these lines between all stations in the organization. Its intercommunication ability allows two or more stations to directly connect while not using the public switched telephone network. This method reduces the number of lines needed from the organization to the public switched telephone network.
What is Asterisk PBX?
Asterisk is a software implementation of a private branch exchange (PBX). In conjunction with suitable telephony hardware interfaces and network applications, it is used to establish and control telephone calls between telecommunication endpoints, such as customary telephone sets, destinations on the public switched telephone network (PSTN), and devices or services on voice over Internet Protocol (VoIP) networks. Its name comes from the asterisk (*) symbol for a signal used in dual-tone multi-frequency (DTMF) dialing.
Asterisk PBX (Private Branch Exchange) is a powerful, open-source software developed by Digium, which enables users to build their own telephony systems. It transforms a regular computer into a communications server, capable of managing voice calls, video calls, and text messages.
Key features of Asterisk PBX include:
- Voicemail: Provides traditional voicemail services with options for forwarding messages and notifications.
- Call Routing: Manages incoming and outgoing calls, directing them to the appropriate extensions or external lines.
- Conferencing: Facilitates multi-party conference calls, allowing several participants to join a single call.
- Interactive Voice Response (IVR): Automates interactions with callers, offering menu selections and routing based on caller input.
- Call Recording: Records conversations for quality control, training, or legal purposes.
- Call Queues: Manages multiple incoming calls by placing them in a queue and distributing them to available agents.
- Integration with VoIP: Supports Voice over Internet Protocol, enabling cheaper and more flexible communication options compared to traditional phone lines.
Asterisk is highly customizable and can be integrated with other software and systems, making it suitable for various business needs, from small offices to large enterprises. With a strong community and extensive documentation, Asterisk PBX is a popular choice for those looking to implement a cost-effective and scalable telephony solution.
Asterisk PBX is available in Community and Commercial editions. Community edition is a free software and distributed under GPLv2 license. Whereas, Commercial edition provides enterprise features but have a licensing cost.
Read Also: Top 5 FreePBX Hosting Providers
3CX vs Asterisk
3CX and Asterisk are both popular solutions for building and managing telephony systems, but they have distinct differences in terms of features, ease of use, customization, and cost. Here’s a comparison:
3CX
Overview:
3CX is a commercial VoIP IP PBX system designed for Windows, Linux, and the cloud. It is known for its user-friendly interface and comprehensive features.
Features:
- Ease of Use: 3CX offers a user-friendly, web-based management console, making it easy to configure and manage.
- Unified Communications: Integrates with various communication tools, including video conferencing, chat, and email.
- WebRTC Integration: Supports web-based real-time communication without the need for additional plugins.
- Mobile Apps: Provides mobile apps for iOS and Android, enabling remote work capabilities.
- Support and Updates: Offers official support and regular updates, ensuring system reliability and security.
Customization:
- Limited Customization: Being a commercial product, 3CX has limited customization options compared to open-source solutions.
- Third-Party Integrations: Supports a range of third-party integrations, but customization may require additional licenses or professional services.
Cost:
- Licensing: 3CX operates on a subscription-based licensing model, with costs varying based on the number of simultaneous calls and features needed.
- Additional Costs: There may be additional costs for advanced features and support plans.
Asterisk
Overview:
Asterisk is an open-source framework for building communications applications. It is highly flexible and can be used to create custom telephony solutions.
Features:
- Flexibility: Highly customizable, allowing for extensive modifications and custom applications.
- Wide Range of Features: Offers comprehensive telephony features, including IVR, call queues, and conferencing.
- Community Support: Strong community support and extensive documentation available.
Customization:
- Highly Customizable: Developers can modify the source code and create custom features tailored to specific needs.
- Integration: Can be integrated with various third-party applications and systems.
Cost:
- Free and Open-Source: Asterisk itself is free to use, but there may be costs associated with hardware, professional services, and additional software.
- Support: Professional support is available through companies like Sangoma (the owner of Asterisk), but it is optional.
Comparison Summary
- Ease of Use: 3CX is generally easier to set up and manage, making it suitable for businesses looking for a straightforward telephony solution. Asterisk, while more complex, offers unparalleled flexibility and customization options.
- Features: Both systems provide robust features, but 3CX has a slight edge in terms of integrated unified communications tools and ease of use. Asterisk shines in scenarios where custom solutions are required.
- Cost: 3CX requires a subscription-based license, which can be more predictable in terms of budgeting. Asterisk is free, but costs can arise from the need for professional services and custom development.
- Support: 3CX offers official support and regular updates, ensuring a reliable system. Asterisk relies on community support, with professional support available through third-party providers.
Choosing between 3CX and Asterisk depends on your specific needs, technical expertise, and budget. 3CX is ideal for businesses seeking an easy-to-manage, feature-rich solution with official support. Asterisk is best for those who require a highly customizable system and have the technical capability to manage it.
Recommended Online Training: FreePBX Asterisk VoIP PBX Server Administration Step by Step
Environment Specification
We are using a minimal CentOS 8 virtual machine with following specifications.
- CPU – 3.4 Ghz (2 cores)
- Memory – 2 GB
- Storage – 20 GB
- Operating System – CentOS 8.2
- Hostname – asterisk-pbx.centlinux.com
- IP Address – 192.168.116.236 /24
Update your Linux Server
Connect with asterisk-pbx.centlinux.com as Linux root user by using a ssh client.
By following the best practice, update your Linux operating system before installing Asterisk VoIP software.
Use dnf command to update software packages of your Linux server.
# dnf update -y Last metadata expiration check: 0:00:30 ago on Wed 25 Nov 2020 08:24:39 PM PKT. Dependencies resolved. Nothing to do. Complete!
All packages in our Linux operating system are already up-to-date.
Check Kernel version of your Linux server.
# uname -r 4.18.0-193.28.1.el8_2.x86_64
Check Linux operating system version.
# cat /etc/redhat-release CentOS Linux release 8.2.2004 (Core)
Download Asterisk VoIP Software
Asterisk is a free software and you can download it from Asterisk official website or GitHub Repository.
Open Asterisk website in a web browser and copy the URL of the software setup. Currently version 18 is the latest version, and it is available for download.
Use wget command to download the software installer from the copied URL.
# wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz --2020-11-25 20:55:00-- http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-18-current.tar.gz Resolving downloads.asterisk.org (downloads.asterisk.org)... 76.164.171.238, 2001:470:e0d4::ee Connecting to downloads.asterisk.org (downloads.asterisk.org)|76.164.171.238|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 27886299 (27M) [application/x-gzip] Saving to: âasterisk-18-current.tar.gzâ asterisk-18-current 100%[===================>] 26.59M 949 B/s in 82s 2020-11-25 20:56:24 (331 KB/s) - âasterisk-18-current.tar.gzâ saved [27886299/27886299]
Extract the downloaded tarball by using tar command.
# tar xf asterisk-18-current.tar.gz
Install Asterisk Prerequisites
Asterisk VoIP software comes with a well written script that can be used to install prerequisite software packages on Linux servers.
Execute this script and install all prerequisite packages in one go.
# cd asterisk-18.1.0/contrib/scripts/ # ./install_prereq install
To enable mp3 support for playing music while the client is on hold, you are required to install a few more dependencies. Luckily, the installer provides a script for the same. Execute it now.
# ./get_mp3_source.sh
Asterisk VoIP server also required libedit and libedit-devel packages, that are not available in standard yum repositories. Therefore, you have to install these packages from rpmfind website as follows.
# cd ~/asterisk-18.1.0 # dnf install -y / > https://www.rpmfind.net/linux/centos/8-stream/PowerTools/x86_64/os/Packages/libedit-devel-3.1-23.20170329cvs.el8.x86_64.rpm / > https://www.rpmfind.net/linux/centos/8-stream/BaseOS/x86_64/os/Packages/libedit-3.1-23.20170329cvs.el8.x86_64.rpm
All prerequisites have been installed successfully.
Install Asterisk PBX Server on CentOS 8
Now, you can start setup of PBX software from extracted directory.
# ./configure --libdir=/usr/lib64 --with-jansson-bundled
The next step in the build process is to tell Asterisk installer, which modules to compile and install, as well as set various compiler options. These settings are all controlled via a menu-driven system called menuselect. To access the menuselect system, execute the following command.
# make menuselect
Select the required addons/modules that you want to install with the PBX server.
Compile and build the Asterisk VoIP software based on the above configurations.
# make ... Building Documentation For: third-party 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 + +-------------------------------------------+
Install the Asterisk VoIP software on your Linux server.
# make install ... +---- 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 + +-------------------------------------------+
Install Asterisk sample configuration files as follows.
# make samples
Install Asterisk sample files to configure basic PBX.
# make basic-pbx
Create OS User for VoIP Software
Create OS user and group to own VoIP software directory.
# groupadd asterisk # useradd -r -d /var/lib/asterisk -g asterisk asterisk # usermod -aG audio,dialout asterisk
Change owner to asterisk user of following directories.
# chown -R asterisk.asterisk /etc/asterisk /var/{lib,log,spool}/asterisk /usr/lib64/asterisk
Edit following configuration file by using vim text editor.
# vi /etc/sysconfig/asterisk
And add following configurations therein to set default user for VoIP software.
AST_USER="asterisk" AST_GROUP="asterisk"
Edit asterisk.conf file in vim text editor.
# vi /etc/asterisk/asterisk.conf
And add following directives to set default user to own Asterisk processes.
runuser = asterisk ; The user to run as. rungroup = asterisk ; The group to run as.
Enable and start Asterisk service.
# systemctl enable --now asterisk
Check the status of asterisk.service.
# systemctl status asterisk.service
Accessing Asterisk CLI
Connect to Asterisk CLI by using following command.
# asterisk -r Asterisk 18.1.0, Copyright (C) 1999 - 2018, Digium, Inc. and others. Created by Mark Spencer <markster@digium.com> 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. ========================================================================= Running as user 'asterisk' Running under group 'asterisk' Connected to Asterisk 18.1.0 currently running on asterisk-pbx (pid = 2350) asterisk-pbx*CLI>
Let’s execute some common commands on Asterisk CLI.
asterisk-pbx*CLI> core show channels Channel Location State Application(Data) 0 active channels 0 active calls 0 calls processed asterisk-pbx*CLI> core show uptime System uptime: 1 hour, 29 minutes, 59 seconds Last reload: 1 hour, 29 minutes, 59 seconds asterisk-pbx*CLI> quit Asterisk cleanly ending (0). Executing last minute cleanups
Asterisk VoIP server has been installed on Linux operating system and working fine.
To configure Asterisk as a PBX for your corporate environment, you might read Asterisk: The Definitive Guide: Open Source Telephony for the Enterprise (PAID LINK) by O’Reilly Media.
Final Thoughts
Installing Asterisk PBX Server on CentOS 8 can significantly enhance your organization’s communication capabilities by providing a flexible and cost-effective telephony solution. Whether you’re setting up a small office phone system or a complex enterprise-grade communication network, Asterisk offers the versatility and features you need.
If you need expert assistance with installing and configuring Asterisk PBX Server on Linux, consider hiring a professional. Check out my Fiverr gig for Linux Admin services, where I can help you with the entire installation process, ensuring your Asterisk PBX system is set up correctly and efficiently.