The last version of Rocky Linux that this procedure was tested on was version 8.5. Because the bulk of this procedure relies on source builds directly from Asterisk and a simple set of Development Tools from Rocky Linux, it should work on all versions. If you run into a problem, please let us know!
Asterisk is an open-source framework for building communications applications. Additionally, Asterisk turns an ordinary computer into a communications server, powers IP PBX systems, VoIP gateways, conference servers, and other custom solutions. It is used by small businesses, large businesses, call centers, carriers, and government agencies worldwide.
Asterisk is free and open source and is sponsored by Sangoma. Sangoma also offers commercial products that use Asterisk under the hood, and depending on your experience and budget, using these products might be more beneficial than rolling your own. Only you and your organization know that answer.
It should be noted that this guide requires the administrator to do a fair amount of research on their own. Installing a communications server is not difficult, but running one can be quite complicated. While this guide will get your server up and running, it will not be ready for you to use in production.
At minimum, you will need the following skills and tools to complete this guide:
A machine running Rocky Linux
A comfort level with modifying configuration files and issuing commands from the command-line
Knowledge of how to use a command line editor (we use vi here, but feel free to substitute it with your favorite editor.)
You will need root access and ideally be signed in as the root user in your terminal
The EPEL repositories from Fedora
The ability to log in as root or run root commands with sudo. All commands here assume a user with sudo rights. However, the configuration and build processes run with sudo -s.
To grab the latest build of Asterisk, you must either use curl or wget. This guide uses wget, but feel free to substitute the appropriate curl string if you prefer.
Before you download this script, ensure you have the latest version. To do so, navigate to the Asterisk download link here and look for the latest build of Asterisk. Then copy the link location. As of the writing of this document, the following was the latest build:
Before running the install_prereq below (and the remaining commands), you are going to need to be the superuser or root. It is much easier at this point to get into sudo permanently for a while. You will exit out of sudo later in the process:
sudo-s
contrib/scripts/install_prereqinstall
You should see the following when the script completes:
This is one of the steps where the administrator will need to do his homework. Many menu options exist that you might not need. Running the following command:
makemenuselect
will bring you to a menu select screen:
Look through these options carefully and make selections based on your requirements. As stated earlier, this will take some additional homework.
To build, you want to run the following commands in succession:
make
makeinstall
Installing the documentation is not required, but unless you are a communications server expert, you will want them installed:
makeprogdocs
Next, install the basic PBX and configure it. The basic PBX is just that, very basic! You will probably need to make changes going forward to get your PBX to function as you want it to.
Since most of the build work is complete, go ahead and exit out of the sudo -s command. This will require that most of the remaining commands use sudo again:
This example uses firewalld for the firewall, which is the default in Rocky Linux. The goal here is to open SIP ports to the world and to open RTP (Realtime Transport Protocol) to the world on ports 10000-20000 as recommended by the Asterisk documentation.
You will almost certainly need other firewall rules for other forward-facing services (HTTP/HTTPS), which you will probably want to limit to your IP addresses. That is beyond the scope of this document:
The above will get you up and running with the server, but you are responsible for finishing out the configuration, connecting devices, and further troubleshooting.
Running an Asterisk communications server takes time and effort and will require research by an administrator. For more information configuring and using Asterisk, see the Asterisk Wiki here.