How To Install Asterisk on Fedora 43

Asterisk stands as one of the most powerful open-source communication platforms available today, transforming how businesses and individuals manage voice over IP (VoIP) telephony systems. This comprehensive guide walks through every step needed to successfully install and configure Asterisk on Fedora 43, empowering you to build a fully functional private branch exchange (PBX) system. Whether running a small business, setting up a home lab, or deploying enterprise-grade communications infrastructure, this tutorial provides the foundation for creating a robust VoIP solution tailored to specific needs.
Understanding Asterisk and Its Use Cases
Asterisk represents far more than simple telephony software—it’s a complete framework for building communications applications. Created by Mark Spencer in 1999, this open-source project has evolved into the backbone of countless business phone systems worldwide. The platform handles everything from basic call routing to sophisticated interactive voice response (IVR) systems, call recording, voicemail, and conference bridges.
Organizations leverage Asterisk for diverse purposes. Small businesses replace expensive proprietary PBX systems with customized solutions that cost a fraction of commercial alternatives. Call centers utilize Asterisk’s queue management and distribution features. Enterprises integrate Asterisk with existing infrastructure, creating hybrid systems that bridge traditional PSTN networks with modern SIP trunks. The software’s modular architecture allows administrators to enable only needed features, keeping systems lean and efficient.
The flexibility extends to protocol support. Asterisk handles SIP, IAX, H.323, and numerous other VoIP protocols, ensuring compatibility with virtually any endpoint device. This versatility makes it ideal for environments with mixed equipment or when migrating from legacy systems.
System Requirements and Prerequisites
Before diving into installation, ensure the server meets minimum specifications. Asterisk runs on modest hardware, but adequate resources prevent performance issues. A dual-core processor with at least 2 GHz speed provides sufficient processing power for small deployments handling 10-15 concurrent calls. RAM requirements start at 2 GB, though 4 GB or more is recommended for production environments with multiple users.
Storage needs depend on call recording and voicemail usage. A base installation occupies approximately 500 MB, but allocate at least 20 GB to accommodate logs, recordings, and future growth. Network connectivity must be stable and reliable—VoIP quality suffers tremendously from packet loss or high latency.
Fedora 43 should be freshly installed and fully updated before proceeding. Root access or sudo privileges are mandatory for installing system packages and modifying configuration files. Basic familiarity with Linux command-line operations helps tremendously, though this guide explains each command’s purpose.
Network administrators must consider firewall rules and port forwarding. Asterisk requires several ports open: UDP 5060 for SIP signaling, UDP 10000-20000 for RTP media streams, and TCP 5060 if using TCP transport. Systems behind NAT routers need additional configuration, which we’ll address later.
Preparing Your Fedora 43 System
Updating System Packages
Start by ensuring all system packages reflect the latest versions. This step patches security vulnerabilities and resolves potential dependency conflicts:
sudo dnf update -y
sudo dnf upgrade -y
The update process may take several minutes depending on connection speed and how many packages need refreshing. Reboot the system if kernel updates were installed to ensure all changes take effect.
Set a meaningful hostname that identifies the server’s purpose:
sudo hostnamectl set-hostname asterisk-voip.yourdomain.com
Installing Development Tools and Dependencies
Asterisk compilation requires numerous development libraries and tools. Fedora’s package manager simplifies this process through group installations:
sudo dnf groupinstall "Development Tools" -y
sudo dnf install wget vim net-tools git -y
Install specific libraries that Asterisk depends on for various features:
sudo dnf install openssl-devel ncurses-devel libuuid-devel \
newt-devel libxml2-devel sqlite-devel libedit-devel \
jansson-devel gcc-c++ libtool-ltdl-devel libsrtp-devel \
speex-devel gmime30-devel libtiff-devel unixODBC-devel -y
Each library serves specific purposes. OpenSSL enables encrypted TLS connections. Ncurses provides the menu interface during module selection. Jansson handles JSON parsing for modern APIs. SRTP libraries allow encrypted media streams, enhancing call privacy.
Configuring SELinux
Security-Enhanced Linux (SELinux) provides mandatory access controls that enhance system security. However, properly configuring SELinux policies for Asterisk requires advanced knowledge. For testing environments, set SELinux to permissive mode:
sudo setenforce 0
sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config
Production systems should maintain SELinux in enforcing mode with proper policies configured. The Asterisk community provides SELinux modules specifically designed for this purpose, available in their documentation.
Downloading and Preparing Asterisk
Navigate to the source directory where compilation occurs:
cd /usr/src
Download the latest Asterisk 20 LTS (Long Term Support) release. LTS versions receive security updates and bug fixes for extended periods, making them ideal for production:
sudo wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
Extract the downloaded archive:
sudo tar -xvzf asterisk-20-current.tar.gz
cd asterisk-20*/
Run the prerequisite installation script that automatically identifies and installs additional required dependencies:
sudo contrib/scripts/install_prereq install
This script analyzes the system and installs packages specific to Fedora distributions. Accept any prompts that appear during installation.
Execute the configure script, which checks for all required libraries and prepares the build environment:
sudo ./configure --libdir=/usr/lib64
The --libdir=/usr/lib64 flag ensures proper library placement on 64-bit systems. The configure script outputs a summary showing enabled and disabled features. Review this output to verify all desired capabilities are available.
Optionally install MP3 format support for music on hold:
sudo contrib/scripts/get_mp3_source.sh
Compiling and Installing Asterisk
Selecting Modules
Asterisk’s modular architecture allows administrators to choose exactly which features to compile. Launch the module selection menu:
sudo make menuselect
A text-based interface appears showing categories of modules. Navigate using arrow keys, select items with Enter, and mark selections with asterisks. Essential modules include:
- Channel Drivers: Select chan_pjsip for modern SIP support
- PBX Modules: Enable pbx_config for dialplan functionality
- Resource Modules: Include res_pjsip and related modules
- Codecs: Select g711, gsm, and speex at minimum
For basic installations, the default selections work well. Press F12 or select Save and Exit when finished.
Compilation Process
Compile Asterisk using all available CPU cores for faster processing:
sudo make -j$(nproc)
Compilation time varies based on hardware, typically requiring 10-30 minutes. The process displays extensive output as it builds hundreds of modules. Watch for error messages—successful compilation ends with a “BUILD COMPLETE” message.
Install the compiled binaries and modules:
sudo make install
Install sample configuration files that provide templates for customization:
sudo make samples
Install systemd service files enabling Asterisk to run as a system service:
sudo make config
Update the library cache so the system recognizes newly installed libraries:
sudo ldconfig
Verify installation by checking the Asterisk version:
asterisk -V
The output displays the installed version number, confirming successful compilation.
Configuring Asterisk User and Permissions
Running Asterisk as root poses unnecessary security risks. Create a dedicated user account with limited privileges:
sudo groupadd asterisk
sudo useradd -r -d /var/lib/asterisk -g asterisk asterisk
The -r flag creates a system account without a home directory login, and -d specifies the Asterisk home directory.
Set proper ownership for all Asterisk directories:
sudo chown -R asterisk:asterisk /etc/asterisk
sudo chown -R asterisk:asterisk /var/lib/asterisk
sudo chown -R asterisk:asterisk /var/log/asterisk
sudo chown -R asterisk:asterisk /var/spool/asterisk
sudo chown -R asterisk:asterisk /usr/lib64/asterisk
Edit the main Asterisk configuration file to specify the runtime user:
sudo vim /etc/asterisk/asterisk.conf
Locate and uncomment these lines, ensuring they read:
runuser = asterisk
rungroup = asterisk
If using systemd, also configure the service file:
sudo vim /usr/lib/systemd/system/asterisk.service
Add these lines in the [Service] section:
User=asterisk
Group=asterisk
Reload systemd to recognize the changes:
sudo systemctl daemon-reload
Basic Asterisk Configuration
Understanding Configuration Files
Asterisk uses plain text files located in /etc/asterisk/ for all configuration. Key files include:
- asterisk.conf: General settings and paths
- pjsip.conf: Modern SIP channel driver configuration
- extensions.conf: Dialplan defining call routing logic
- modules.conf: Controls which modules load at startup
- rtp.conf: RTP media stream settings
Changes to configuration files require reloading Asterisk to take effect.
Configuring SIP Endpoints
Modern Asterisk installations use the PJSIP stack, which offers better performance and flexibility than the legacy chan_sip driver. Edit the PJSIP configuration:
sudo vim /etc/asterisk/pjsip.conf
Add transport and endpoint definitions. Here’s a basic configuration for two extensions:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
[6001]
type=endpoint
context=internal
disallow=all
allow=ulaw
allow=alaw
auth=6001
aors=6001
[6001]
type=auth
auth_type=userpass
password=SecurePassword123
username=6001
[6001]
type=aor
max_contacts=1
[6002]
type=endpoint
context=internal
disallow=all
allow=ulaw
allow=alaw
auth=6002
aors=6002
[6002]
type=auth
auth_type=userpass
password=SecurePassword456
username=6002
[6002]
type=aor
max_contacts=1
This configuration creates two extensions (6001 and 6002) with secure authentication. The disallow=all followed by specific allow statements ensures only preferred codecs are negotiated, improving call quality and compatibility.
Configuring the Dialplan
The dialplan defines how Asterisk handles calls. Edit the extensions configuration:
sudo vim /etc/asterisk/extensions.conf
Add a basic dialplan allowing internal calling:
[general]
static=yes
writeprotect=no
[internal]
exten => 6001,1,NoOp(Call to 6001)
same => n,Dial(PJSIP/6001,30)
same => n,Hangup()
exten => 6002,1,NoOp(Call to 6002)
same => n,Dial(PJSIP/6002,30)
same => n,Hangup()
exten => 100,1,Answer()
same => n,Playback(hello-world)
same => n,Hangup()
Extension 100 provides a test extension playing a sound file when called. The number 30 in Dial commands specifies ring timeout in seconds.
Starting and Enabling Asterisk Service
Start the Asterisk service using systemd:
sudo systemctl start asterisk
Enable automatic startup on boot:
sudo systemctl enable asterisk
Verify the service is running correctly:
sudo systemctl status asterisk
A green “active (running)” status indicates success. Access the Asterisk command-line interface (CLI) for real-time monitoring:
sudo asterisk -rvvv
The -r connects to the running instance, and -vvv sets verbosity level. The CLI provides powerful diagnostic capabilities. Try these commands:
core show version
pjsip show endpoints
dialplan show
Exit the CLI by typing exit or pressing Ctrl+D.
Firewall Configuration
Fedora 43 ships with firewalld enabled by default. Open necessary ports for SIP and RTP traffic:
sudo firewall-cmd --permanent --add-port=5060/udp
sudo firewall-cmd --permanent --add-port=5060/tcp
sudo firewall-cmd --permanent --add-port=10000-20000/udp
Reload firewall rules to activate changes:
sudo firewall-cmd --reload
Verify the rules are active:
sudo firewall-cmd --list-all
For enhanced security, restrict access to specific IP addresses or networks instead of opening ports to the world:
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="192.168.1.0/24" port protocol="udp" port="5060" accept'
This example limits SIP access to the 192.168.1.0/24 subnet.
Testing Your Asterisk Installation
Install a SIP softphone application on a computer or mobile device. Popular free options include:
- Linphone: Available for Windows, Mac, Linux, iOS, and Android
- Zoiper: Feature-rich with free and paid versions
- MicroSIP: Lightweight Windows client
- Bria: Professional option with excellent reliability
Configure the softphone with these settings:
- Username: 6001
- Password: SecurePassword123 (or your chosen password)
- Domain/Server: Your Asterisk server’s IP address
- Port: 5060
- Transport: UDP
The softphone should register successfully within seconds. Check registration in Asterisk CLI:
sudo asterisk -rx "pjsip show endpoints"
Registered endpoints show “Avail” in the status column. Configure a second device with extension 6002 credentials. Call between extensions by dialing the extension number. Both devices should ring, and calls should connect with clear two-way audio.
Test the sample extension by dialing 100. The system answers and plays a welcome message, confirming dialplan functionality.
Security Best Practices
VoIP systems face constant attack attempts. Implement these security measures immediately:
Strong Authentication: Use complex passwords with mixed characters, numbers, and symbols. Avoid dictionary words or predictable patterns.
Fail2ban Integration: Install and configure fail2ban to automatically block IPs making repeated failed authentication attempts:
sudo dnf install fail2ban -y
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
Create an Asterisk jail configuration in /etc/fail2ban/jail.local:
[asterisk-iptables]
enabled = true
filter = asterisk
action = iptables-allports[name=ASTERISK]
logpath = /var/log/asterisk/messages
maxretry = 5
bantime = 86400
Network Segmentation: Place Asterisk servers on isolated network segments with strict firewall rules between segments.
Regular Updates: Apply security patches promptly. Subscribe to Asterisk security announcements through their mailing list.
TLS Encryption: Enable TLS for SIP signaling to prevent eavesdropping on authentication credentials.
Disable Root Login: Never allow remote root SSH access to the server hosting Asterisk.
Common Issues and Troubleshooting
SIP Registration Failures
Registration problems typically stem from incorrect credentials or network issues. Verify configuration file syntax:
sudo asterisk -rx "pjsip show endpoints"
If endpoints don’t appear, check for configuration errors:
sudo asterisk -rx "pjsip show endpoint 6001"
Increase Asterisk verbosity to see detailed registration attempts:
sudo asterisk -rvvvv
Watch for authentication failures or network connectivity problems in the output.
One-Way or No Audio Problems
Audio issues usually relate to NAT configuration or firewall rules blocking RTP packets. Verify RTP port configuration in /etc/asterisk/rtp.conf:
rtpstart=10000
rtpend=20000
Check firewall rules allow the full RTP port range. For systems behind NAT, configure external IP addresses in pjsip.conf:
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
external_media_address=YOUR.PUBLIC.IP
external_signaling_address=YOUR.PUBLIC.IP
Service Won’t Start
Check system logs for error messages:
sudo journalctl -u asterisk -n 50
Common causes include permission problems, port conflicts, or configuration syntax errors. Validate configuration files:
sudo asterisk -rx "core show config"
Test configuration changes without restarting:
sudo asterisk -rx "module reload"
Congratulations! You have successfully installed Asterisk. Thanks for using this tutorial for installing Asterisk on your Fedora 43 Linux system. For additional help or useful information, we recommend you check the official Asterisk website.