openSUSE

How To Install Asterisk on openSUSE

Install Asterisk on openSUSE

Installing Asterisk on openSUSE transforms your Linux system into a powerful communication platform capable of handling voice calls, video conferencing, and advanced telephony features. This comprehensive guide walks you through every step of the installation process, ensuring you achieve a successful deployment.

Asterisk stands as one of the most robust open-source communication platforms available today. It powers everything from small office phone systems to enterprise-grade call centers. When combined with openSUSE’s stability and security features, you create an exceptional foundation for business communications.

This tutorial targets system administrators, Linux enthusiasts, and IT professionals seeking to implement a reliable VoIP solution. You’ll learn not only how to install Asterisk but also how to configure, secure, and optimize your deployment for maximum performance.

By following this guide, you’ll establish a fully functional Asterisk system ready for customization and expansion. The entire process typically takes 2-3 hours, depending on your system specifications and network connectivity.

Prerequisites and System Requirements

Hardware Requirements

Your openSUSE system needs adequate resources to run Asterisk effectively. A minimum of 2 GB RAM ensures smooth operation, though 4 GB or more provides better performance for high-traffic environments. CPU requirements vary based on concurrent call volume, but a dual-core processor handles most small to medium deployments.

Storage requirements include at least 10 GB of free disk space for the base installation, with additional space needed for call recordings and logs. Network connectivity proves essential, as Asterisk relies heavily on network communication protocols.

Consider your intended usage when evaluating hardware needs. Simple internal communications require minimal resources, while complex call center operations demand more robust specifications.

Software Prerequisites

OpenSUSE Leap 15.4 or newer versions provide optimal compatibility with current Asterisk releases. The system requires specific development tools and libraries for successful compilation from source code.

Essential packages include GCC compiler suite, development headers, and various libraries supporting audio processing and network communications. Package management familiarity with zypper simplifies the installation process significantly.

Kernel modules supporting sound and network devices must be loaded and functioning properly. Most modern openSUSE installations include these components by default.

Pre-Installation Checklist

Verify your system’s current update status before beginning the installation process. Outdated packages can cause compilation errors or compatibility issues during setup.

Ensure you possess administrative privileges through sudo access or direct root permissions. The installation process requires system-level changes that standard users cannot perform.

Configure firewall settings to allow necessary network traffic. Asterisk uses multiple ports for different protocols, requiring careful firewall planning for proper operation.

Create system backups of critical data before proceeding. While Asterisk installation rarely causes system issues, maintaining current backups represents good administrative practice.

Preparing the openSUSE System

System Updates and Package Management

Begin by updating your openSUSE system to ensure all packages reflect their latest versions. This step prevents potential conflicts during the installation process.

sudo zypper refresh
sudo zypper update

The refresh command updates repository metadata, while the update command installs available package upgrades. Allow this process to complete fully before proceeding to the next steps.

Add the necessary repositories for telephony-related packages. OpenSUSE maintains specialized repositories containing VoIP and telecommunications software.

sudo zypper addrepo https://download.opensuse.org/repositories/network:/telephony/openSUSE_Leap_15.4/ telephony
sudo zypper refresh

Repository priority settings ensure proper package resolution when multiple sources provide similar packages. Configure priorities to favor official openSUSE repositories over third-party sources.

Installing Development Dependencies

Asterisk compilation requires numerous development packages and libraries. Install these dependencies using zypper’s pattern-based installation for comprehensive coverage.

sudo zypper install -t pattern devel_basis
sudo zypper install gcc gcc-c++ make cmake

Additional dependencies support specific Asterisk features and modules. Install these packages to ensure full functionality during compilation and runtime operations.

sudo zypper install ncurses-devel libxml2-devel sqlite3-devel
sudo zypper install openssl-devel libcurl-devel speex-devel
sudo zypper install libedit-devel uuid-devel jansson-devel

Verify dependency installation by checking package status. Missing dependencies cause compilation failures that can be difficult to diagnose later in the process.

zypper se -i gcc ncurses-devel libxml2-devel

Audio support requires additional packages for codec functionality and sound device interaction. Install these components for complete audio processing capabilities.

sudo zypper install alsa-devel libogg-devel libvorbis-devel
sudo zypper install gsm-devel libsrtp-devel

Downloading and Preparing Asterisk Source Code

Obtaining Asterisk Source Code

Navigate to the official Asterisk website or use direct download links to obtain the latest stable release. Long Term Support (LTS) versions provide enhanced stability for production environments.

cd /usr/src
sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz

Asterisk 20 represents the current LTS branch, offering five years of maintenance and security updates. This version balances new features with long-term stability requirements.

Verify download integrity using checksums provided by the Asterisk project. This step ensures your downloaded file hasn’t been corrupted during transmission.

sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz.sha256
sha256sum -c asterisk-20-current.tar.gz.sha256

Alternative download methods include using curl or accessing mirror sites for improved download speeds. Choose the method that works best for your network configuration.

Extracting and Preparing Source Files

Extract the downloaded archive using tar with appropriate flags for handling gzip compression. The extraction process creates a new directory containing all source files.

sudo tar -xzf asterisk-20-current.tar.gz
cd asterisk-20.*

Examine the directory structure to familiarize yourself with Asterisk’s organization. Key directories include main source code, modules, and configuration templates.

Review the README and INSTALL files for version-specific installation notes. These documents contain important information about changes and requirements for your particular version.

less README
less INSTALL

Set appropriate permissions for the build process. Some installations require specific ownership or permission settings for successful compilation.

sudo chown -R root:root .
sudo chmod -R 755 .

Configuring and Compiling Asterisk

Running the Configuration Script

Execute the configure script to check system compatibility and prepare the build environment. This script detects available libraries and configures compilation options accordingly.

sudo ./configure --libdir=/usr/lib64

The libdir parameter ensures proper library placement on 64-bit openSUSE systems. This prevents potential runtime issues related to library loading paths.

Configuration output displays detected features and any missing dependencies. Review this information carefully to identify potential issues before compilation begins.

Monitor configuration warnings about missing optional dependencies. While not required for basic operation, these components enable advanced Asterisk features.

./configure --with-pjproject-bundled --with-jansson-bundled

Bundled options include specific libraries directly in the Asterisk build, reducing external dependency requirements and potential version conflicts.

Using install_prereq Script

Asterisk includes a convenience script for installing distribution-specific prerequisites. This script automates much of the dependency installation process.

sudo contrib/scripts/install_prereq install

The install_prereq script detects your Linux distribution and installs appropriate packages automatically. This approach simplifies dependency management significantly.

Test mode allows you to preview planned installations without making system changes. Use this option to verify the script’s actions before committing to installation.

sudo contrib/scripts/install_prereq test

Some distributions require manual intervention for certain packages. Follow any prompts or instructions provided by the script during execution.

Compilation Process

Begin compilation using the make command with appropriate flags for parallel processing. This step transforms source code into executable binaries.

sudo make -j$(nproc)

The -j flag enables parallel compilation using all available CPU cores, significantly reducing build time on multi-core systems. Monitor system resources during compilation to ensure adequate performance.

Compilation progress displays module names and compilation status. Errors during this phase typically indicate missing dependencies or configuration issues.

Expected compilation time varies based on system specifications, typically ranging from 15 minutes to over an hour for older hardware. Be patient and allow the process to complete fully.

Monitor for compilation warnings that might indicate potential runtime issues. While warnings don’t prevent installation, they may affect specific features or modules.

make menuselect

The menuselect interface allows customization of included modules and features. Use this tool to enable or disable specific functionality based on your requirements.

Install Asterisk on openSUSE

Installing Asterisk on openSUSE

Standard Installation Process

Install compiled binaries to their designated system locations using the make install command. This process copies files to appropriate directories throughout the filesystem.

sudo make install

Installation creates directories under /usr/sbin for executables, /usr/lib64 for modules, and /var/lib/asterisk for runtime data. These locations follow standard Linux filesystem hierarchy conventions.

Monitor installation output for any error messages or warnings. Most issues at this stage relate to permission problems or insufficient disk space.

Verify installation success by checking for key files in their expected locations. This step confirms that all components installed correctly.

ls -la /usr/sbin/asterisk
ls -la /usr/lib64/asterisk/modules/

Binary installation includes the main Asterisk daemon, management utilities, and loadable modules supporting various protocols and features.

Sample Configuration Installation

Install sample configuration files to provide starting templates for customization. These files demonstrate proper syntax and common configuration patterns.

sudo make samples

Sample configurations install to /etc/asterisk/ with .sample extensions to prevent overwriting existing configurations. Copy and modify these files as needed for your environment.

Basic sample files include asterisk.conf for global settings, sip.conf for SIP protocol configuration, and extensions.conf for dialplan definitions. These represent the minimum configuration requirements.

Advanced samples demonstrate features like voicemail, call queues, and conference bridges. Review these files to understand Asterisk’s capabilities and configuration options.

sudo ls /etc/asterisk/*.sample
sudo cp /etc/asterisk/asterisk.conf.sample /etc/asterisk/asterisk.conf

System Integration Setup

Configure systemd integration for proper service management and automatic startup capabilities. This step enables standard Linux service control commands.

sudo make config

System integration creates service files and startup scripts compatible with openSUSE’s init system. These files enable service management through systemctl commands.

Enable Asterisk service for automatic startup during system boot. This ensures communication services remain available after system restarts.

sudo systemctl enable asterisk

Test service configuration by starting and stopping Asterisk through systemctl. This verifies proper integration with the service management system.

sudo systemctl start asterisk
sudo systemctl status asterisk

Post-Installation Configuration

User and Group Configuration

Create a dedicated system user and group for running Asterisk services. This approach improves security by limiting process privileges and filesystem access.

sudo groupadd asterisk
sudo useradd -r -d /var/lib/asterisk -g asterisk asterisk

The -r flag creates a system user without login capabilities, while -d specifies the home directory location. This configuration follows security best practices for service accounts.

Modify file ownership throughout Asterisk directories to match the service user. This ensures proper access permissions for configuration files and runtime data.

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

Configure sudoers permissions if administrative access is required for Asterisk management. Limit permissions to specific commands and directories as needed.

Update systemd service configuration to run Asterisk under the dedicated user account. Edit the service file to include appropriate User and Group directives.

sudo systemctl edit asterisk

Basic Asterisk Configuration

Configure the main asterisk.conf file with essential system settings. This file controls global behavior, directory paths, and basic operational parameters.

sudo nano /etc/asterisk/asterisk.conf

Key configuration sections include [directories] for path specifications, [options] for behavioral settings, and [files] for file-related parameters. Adjust these settings based on your system requirements.

Set up basic SIP configuration for voice over IP communications. The sip.conf file defines peer relationships, authentication methods, and protocol parameters.

sudo nano /etc/asterisk/sip.conf

Essential SIP settings include bindport for listening configuration, context for call routing, and allowguest for security policies. Configure these parameters according to your network environment.

Create a basic dialplan in extensions.conf to handle call routing and feature access. This file defines how Asterisk processes incoming and outgoing calls.

sudo nano /etc/asterisk/extensions.conf

Dialplan contexts organize call handling rules and provide security boundaries between different user groups or services. Start with simple contexts for testing and expand as needed.

Configure audio codecs and media handling parameters. These settings affect call quality, bandwidth usage, and compatibility with various devices and services.

sudo nano /etc/asterisk/modules.conf

System Service Configuration

Update systemd service files with appropriate configuration for your environment. These files control service startup behavior, dependencies, and resource limits.

sudo nano /etc/systemd/system/asterisk.service

Service configuration includes environment variables, working directories, and restart policies. Adjust these settings to match your operational requirements.

Configure logging parameters for troubleshooting and monitoring purposes. Proper log configuration provides valuable information for maintenance and problem resolution.

sudo nano /etc/asterisk/logger.conf

Log levels range from error messages only to verbose debugging information. Balance logging detail with disk space and performance considerations.

Set up automatic service restart policies to maintain high availability. Configure systemd to restart Asterisk automatically after failures or system events.

sudo systemctl daemon-reload
sudo systemctl enable asterisk

Testing and Verification

Initial System Testing

Start Asterisk in console mode to monitor initialization and identify any configuration errors. This approach provides immediate feedback about system status and problems.

sudo asterisk -cvvvvv

Console mode displays detailed loading information including module status, configuration parsing results, and any error messages. Use this output to verify successful startup.

Monitor module loading to ensure all required components initialize properly. Failed modules often indicate missing dependencies or configuration errors.

Key initialization messages include database connections, network bindings, and protocol registrations. Verify that all expected services start successfully.

Use the CLI command interface to check system status and perform basic tests. The Asterisk CLI provides extensive diagnostic and management capabilities.

core show channels
sip show peers
dialplan show

Basic Functionality Testing

Test SIP peer registration to verify network connectivity and authentication. This step confirms that Asterisk can communicate with SIP devices and services.

Configure a simple SIP phone or softphone application to register with your Asterisk server. Use the SIP peers configuration from your sip.conf file.

Verify network port availability and firewall configuration. Asterisk requires access to specific UDP and TCP ports for proper operation.

sudo netstat -unlp | grep asterisk
sudo ss -tulpn | grep asterisk

Standard SIP ports include 5060 for signaling and 10000-20000 for RTP media streams. Ensure these ports are accessible and properly configured.

Test basic call routing using the dialplan configuration. Place test calls between registered devices or use the originate command from the CLI.

channel originate SIP/1001 extension 1002@default

Monitor call progress and audio quality during test calls. Issues at this stage often relate to codec configuration, firewall settings, or network connectivity.

Verify audio codec negotiation and media stream establishment. Use CLI commands to monitor call details and troubleshoot any audio problems.

core show channels verbose
sip show channelstats

Troubleshooting Common Issues

Installation Problems

Dependency resolution failures often occur when required packages are unavailable or conflict with existing installations. Review error messages carefully to identify specific missing components.

Install missing packages individually if automatic dependency resolution fails. Use zypper search commands to find appropriate package names for your openSUSE version.

zypper se libxml2-devel
sudo zypper install libxml2-devel

Compilation errors typically indicate missing development headers or incompatible library versions. Check configure output for specific requirements and install accordingly.

Permission problems during installation require proper sudo access or root privileges. Verify user permissions and consider using root account for system-level operations.

Repository configuration issues can prevent package installation or updates. Verify repository URLs and refresh repository metadata to resolve access problems.

Runtime Issues

Service startup failures often result from configuration syntax errors or missing files. Use systemctl status commands to identify specific error messages and log entries.

sudo systemctl status asterisk -l
sudo journalctl -u asterisk

Configuration file syntax errors prevent proper Asterisk initialization. Use asterisk -T command to test configuration without starting the service.

sudo asterisk -T

Network connectivity problems affect SIP registration and call establishment. Verify firewall rules, network interfaces, and routing configuration.

Module loading failures indicate dependency problems or version incompatibilities. Check module dependencies and ensure all required libraries are available.

Audio codec issues cause call quality problems or connection failures. Verify codec support and configuration in both Asterisk and connected devices.

Security and Best Practices

Security Hardening

Configure firewall rules to restrict access to Asterisk ports. Use iptables or firewalld to limit connections to trusted networks and IP addresses only.

sudo firewall-cmd --permanent --add-port=5060/udp
sudo firewall-cmd --permanent --add-port=10000-20000/udp
sudo firewall-cmd --reload

Implement strong authentication for SIP peers and administrative access. Use complex passwords, digest authentication, and IP-based access controls where appropriate.

Disable unnecessary modules and services to reduce attack surface. Review loaded modules regularly and remove components not required for your deployment.

Configure fail2ban or similar intrusion detection systems to monitor authentication attempts and block suspicious activity automatically.

Regular security updates maintain protection against newly discovered vulnerabilities. Establish update procedures for both Asterisk and underlying system components.

Performance Optimization

Tune memory allocation and CPU usage settings based on expected call volume and system resources. Adjust these parameters in asterisk.conf for optimal performance.

Configure log rotation to prevent disk space exhaustion from extensive logging. Use logrotate or similar tools to manage log file sizes automatically.

Monitor system performance regularly using tools like top, htop, and iotop. Track CPU usage, memory consumption, and disk I/O to identify potential bottlenecks.

Optimize database connections and query performance if using external databases for configuration or call detail records.

Next Steps and Advanced Configuration

Advanced Features Setup

Configure SIP trunks for connectivity to external voice providers or other Asterisk systems. Trunk configuration enables outbound calling and connection to the public switched telephone network.

sudo nano /etc/asterisk/sip.conf

Advanced dialplan features include call forwarding, voicemail, conference bridges, and automated attendants. These features transform basic phone service into comprehensive communication solutions.

Database integration allows dynamic configuration management and call detail record storage. Configure ODBC connections for external database access and real-time configuration updates.

Web-based management interfaces like FreePBX provide graphical administration tools. These interfaces simplify ongoing management and configuration tasks for less technical users.

Congratulations! You have successfully installed Asterisk. Thanks for using this tutorial for installing Asterisk on your openSUSE Linux system. For additional help or useful information, we recommend you check the official Asterisk website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button