In this guide, we are looking at how to install Asterisk 22 LTS on Oracle Linux 10 | AlmaLinux 10 | Rocky Linux 10. Asterisk is an open-source framework for building communications applications. Additionally, Asterisk transforms the ordinary computer into a communications server, and it runs IP PBX systems and VoIP gateways and conference servers and other custom applications. Small and large business companies, call centers, carriers and government agencies worldwide utilize it.
Keep in mind that this is a guide that asks the administrator to do quite a bit of legwork on his or her own. It is not that hard to install a communications server, but it is somewhat complex to maintain one. While this guide will put your server into operation, it will not be in a condition that you’re ready to put it into production with at the completion of the steps.
Features of Asterisk PBX
- Conference calling
- Call Monitoring
- Call Recording
- Distributed Universal Number Discovery
- SMS Messaging
- Trunking
- Transcoding
- Voicemail
- Caller ID on Call Waiting
- Direct Inward System Access
- Call Parking
Install Asterisk 22 LTS on Oracle Linux 10 | AlmaLinux 10 | Rocky Linux 10
Follow the below steps to install Asterisk 22 LTS on Oracle Linux 10 | AlmaLinux 10 | Rocky Linux 10:
Update System packages
Ensure that your system packages are up to date before beginning installations. Run the below commands:
sudo dnf -y update
Disable SElinux
I am going to disable SElinux so as not to prevent any installations.
sudo sed -i -e "s/^SELINUX=.*/SELINUX=disabled/" /etc/selinux/config
After that, reboot your server.
sudo reboot
Install EPEL and required Packages
There are a number of packages that Asterisk requires to be installed. Run the below commands to install them:
Oracle Linux 10:
sudo dnf install -y oracle-epel-release-el10
sudo dnf install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
AmaLinux 10 | Rocky Linux 10:
sudo dnf config-manager --set-enabled crb
sudo dnf install epel-release
##OR
sudo dnf install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
Install the other required packages as below:
sudo yum -y install git wget vim net-tools sqlite-devel psmisc ncurses-devel newt-devel libxml2-devel libtiff-devel gtk2-devel libtool libuuid-devel subversion kernel-devel crontabs cronie-anacron libedit libedit-devel
Also install Development Tools group packages with the below command:
sudo dnf group -y install "Development Tools"
Install Jansson
Jansson is a C library for encoding, decoding, and manipulating JSON data. Clone from Github and install as below:
cd /usr/src/
sudo git clone https://github.com/akheron/jansson.git
cd jansson
sudo autoreconf -i
sudo ./configure --prefix=/usr/
sudo make
sudo make install
Install PJSIP
PJSIP is a free and open source multimedia communication library. It implements standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE. Download the latest version from the official website using wget, extract and install as below:
cd ~
git clone https://github.com/pjsip/pjproject.git
cd pjproject
./configure CFLAGS="-DNDEBUG -DPJ_HAS_IPV6=1" --prefix=/usr --libdir=/usr/lib64 --enable-shared --disable-video --disable-sound --disable-opencore-amr
make dep
make
sudo make install
sudo ldconfig
Install Asterisk 22 LTS
Visit Asterisk official website and download the latest version or use wget to get it directly to your terminal and extract.
cd /usr/src
sudo wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-22-current.tar.gz
sudo tar xvf asterisk-22-current.tar.gz
cd asterisk-22*/
Install Asterisk dependencies using install_prereq
script:
sudo ./contrib/scripts/install_prereq install
To enable MP3 music to play when on hold, run the following commands to install the required dependencies.
sudo dnf install svn
sudo ./contrib/scripts/get_mp3_source.sh

Then configure Asterisk as below:
sudo ./configure --libdir=/usr/lib64

Set Asterisk Menu options by running the below command:
sudo make menuselect
You should get a list of features to enable. Use arrow keys to navigate and ‘ENTER’ key to select On Add-ons select chan_ooh323 and format_mp3 as shown below:

On Core Sound Packages, select the formats of Audio packets like below.

For Music on Hold,select the shown packages.

On Extra Sound Packages select as shown below.

Once done, click on ‘Save & Exit’.

Then run the command below to build Asterisk.
sudo make

Then install Asterisk with the following command.
sudo make install

Asterisk has been successfully installed. You can run the following commands for generic reference documentation, and sample basic PBX.
sudo make samples
sudo make config
Now create a separate user to run Asterisk services and update ownership of directories.
sudo groupadd asterisk
sudo useradd -r -d /var/lib/asterisk -g asterisk asterisk
sudo usermod -aG audio,dialout asterisk
sudo chown -R asterisk.asterisk /etc/asterisk /var/{lib,log,spool}/asterisk /usr/lib64/asterisk
Set Asterisk default user to asterisk:
$ sudo vim /etc/sysconfig/asterisk
###Uncomment these lines
AST_USER="asterisk"
AST_GROUP="asterisk"
$ sudo vim /etc/asterisk/asterisk.conf
###Uncomment these lines
runuser = asterisk ; The user to run as.
rungroup = asterisk ; The group to run as.
Configure Asterisk Systemd Service
Now, the Asterisk make install
command drops in an old SysV init script, (/etc/rc.d/init.d/asterisk
). Keep in mind that Oracle/Alma/Rocky 10 are systemd-only, and they no longer ship with /etc/rc.d/init.d/functions
. That being said, if you try running the asterisk service, you will run into errors.
To solve this, you need to replace the legacy init script with a native systemd service unit (`/etc/systemd/system/asterisk.service`) as follows:
[Unit]
Description=Asterisk PBX and telephony daemon.
After=network.target
[Service]
Type=simple
Environment=HOME=/var/lib/asterisk
#if systemd do not provide hostname and you need to use ${ENV(HOSTNAME)}
#Environment=HOSTNAME=%H
WorkingDirectory=/var/lib/asterisk
User=asterisk
Group=asterisk
ExecStart=/usr/sbin/asterisk -f -C /etc/asterisk/asterisk.conf
ExecStop=/usr/sbin/asterisk -rx 'core stop now'
ExecReload=/usr/sbin/asterisk -rx 'core reload'
#if /var/run is a tmpfs, this will create /var/run/asterisk on start
RuntimeDirectory=asterisk
#Nice=0
#UMask=0002
LimitCORE=infinity
#LimitNOFILE=
Restart=always
RestartSec=4
# Prevent duplication of logs with color codes to /var/log/messages
StandardOutput=null
PrivateTmp=false
[Install]
WantedBy=multi-user.target
Restart asterisk after making the above changes.
sudo systemctl enable --now asterisk
Confirm status
sudo systemctl status asterisk

Use the below command to test if you can connect to Asterisk CLI.
sudo asterisk -rvvv
Successful connection gives the below output:

That’s it. You have successfully installed Asterisk 22 LTS on Oracle Linux 10 | AlmaLinux 10 | Rocky Linux 10. I hope the guide has been helpful. Check more interesting guides below: