After a successful centos installation type the following: 1.
Updated by LinodeContributed by Nick Rahl
Report an Issue | View File | Edit File
Dedicated CPU instances are available!What is Asterisk?
Asterisk is an open source private branch exchange (PBX) server that uses Session Initiation Protocol (SIP) to route and manage telephone calls. Notable features include customer service queues, music on hold, conference calling, and call recording, among others.
This guide covers the steps necessary to provision a new CentOS 7 Linode as a dedicated Asterisk server for your home or office.
Notesudo
. If you’re not familiar with the sudo
command, you can check our Users and Groups guide.Before You Begin
Create a CentOS 7 Linode in your closest data center (barring Atlanta (us-southeast), which does not currently support SIP servers). A 2GB Linode is enough to handle 10-20 concurrent calls using a non-compressed codec, depending on the processing required on each channel.
Ensure you have followed the Getting Started and Securing Your Server guides to prepare your Linode. Do not complete the steps to set up a firewall.
Update your system:
Disable SELinux and reboot your Linode. If you have Lassie enabled, your Linode will be back up and running in a few minutes.
Configure firewalld
CentOS 7 enables firewalld’s
public
zone for the default interface (eth0
). SSH and DHCPv6 services are also enabled by default. To verify your current firewalld zone:That should return:
And:
Add the SIP services.
Note
All the following firewalld rules contain the--permanent
flag to ensure the rules persist after a system reboot.Depending on your needs, you may want to add other related ports:
MGCP - If you use media gateway control protocol in your configuration.
RTP - The media stream - you can change this in
/etc/asterisk/rtp.conf
.If you plan to use FreePBX to manage Asterisk, add the following rule:
IAX - If you need IAX, add the following rule. IAX is “Inter-Asterisk Exchange” and was meant to allow multiple Asterisk servers to communicate with one another. Some VOIP trunking providers use this, but most use SIP. Unless your VOIP provider requires it or you are running multiple Asterisk servers, you probably won’t need IAX or IAX2.
Verify your new configuration with:
You should see the services and ports you just added in addition to default SSH and DCHPv6 services:
Install PJPROJECT
PJPROJECT is Asterisk’s SIP channel driver. It should improve call clarity and performance over older drivers.
Install build dependencies:
As a non-root user, create a working directory for the build:
Change to that directory:
Use
wget
to download the PJSIP driver source code:Extract it:
Change to the newly created directory:
Specify the compiling flags and options:
Ensure that all dependencies are in place:
If
make dep
completes successfully, then build the plugin. It should only take a few minutes.Install the packages:
Ensure the libraries have been properly installed:
You should see:
Install Asterisk
Return to your build directory:
Download the latest version of Asterisk 16:
Untar the file:
Switch to the new Asterisk directory, replacing
16.1.1
if needed:
Enable MP3 Support
To use MP3 files for Music on Hold, install Subversion:
Run the configuration script:
Configure and Build Asterisk
In your build directory for Asterisk, run the
configure
script to prepare the Asterisk source code for compiling:Start the build process. After a short while, you should see a menu on screen allowing you to configure the features you want to build.
If you want to use the MP3 format with Music on Hold, you should select
Add-Ons
, then use the right arrow to move to the right-hand list. Navigate toformat_mp3
and press Enter to select it.Select additional core sound packages and Music on Hold packages in the left menu, and enable
.wav
format for your desired language (ie. use theEN
package for English.).Press F12 to save and exit.
Compile Asterisk. When finished, you should see a message which says Asterisk has successfully been built.
Install Asterisk:
Install sample configuration files:
Configure Asterisk to start itself automatically on boot:
Test Connection
You now have a working Asterisk phone server. Fire up Asterisk and make sure it runs.
Start Asterisk:
Connect to Asterisk:
You should see an output similar to the following:
To see a list of possible commands:
To disconnect type:
Once disconnected, Asterisk continues to run in the background.
Next Steps
Now that you have an Asterisk server running on your Linode, it’s time to connect some phones, add extensions, and configure the various options that are available with Asterisk. For detailed instructions, check out the Asterisk Project’s guide to Configuring Asterisk.
CautionJoin our Community
This guide is published under a CC BY-ND 4.0 license.
(Last Updated On: November 27, 2018)In this post, we will cover how to Install FreePBX 15 on CentOS 7. FreePBX is an open source GUI tool for administering Asterisk PBX systems. FreePBX is written in PHP and available for both Red Hat and Debian Linux family.
This setup assumes you already have a working Asterisk Server. We have a guide for installing Asterisk 16 LTS on CentOS 7 below:
Step 1: Prerequisites
Disable SELinux
Update CentOS system and Install Development Tools.
Install other required dependencies:
Step 2: Install MariaDB Database server:
FreePBX requires a database server. Use the guide on the link below to install and configure MariaDB Database server on CentOS 7.
Step 3: Installing Node.js 10 LTS
FreePBX has Node.js as a dependency, install it on your system by using our guide below:
Once installed, confirm version using:
Step 4: Install and configure Apache Web Server
Install httpd
package using yum package manager:
Then change Apache user to asterisk
and turn on AllowOverride
option :
Remove default index.html
page
Step 5: Install PHP and required extensions
FreePBX is dependent on PHP, run the following commands to install php and required extensions.
Change php maximum file upload size:
![Elastix on centos 7 install windows 10 Elastix on centos 7 install windows 10](https://i.ytimg.com/vi/95kp6GmFyog/maxresdefault.jpg)
Step 6: Download and Install FreePBX 15 on Ubuntu 18.04 / 16.04 / Debian 9
Download the latest version of FreePBX 15:
Extract the file:
Install FreePBX 15 on CentOS 7
If you have a root password for database server, use:
Replace password with the root database password.
Sample installation output:
Start and enable httpd service.
If you have an active firewalld firewall service, open http & https ports
You have successfully installed FreePBX 15 on CentOS 7.
Step 7: Access FreePBX 15 Web Interface
Open your web browser and connect to the IP address or hostname of your new FreePBX server.
1.
Create the first admin account
When done providing admin user details, click “Create Account” to create the account. On the next page, you’ll get a login console.
You’ll get to FreePBX dashboard where you can manage your Asterisk PBX.
You should now have FreePBX 15 running on your CentOS 7 server. Visit our VOIP pae