---
title: Installing Elastix VOIP PBX Phone System
description: Installing Elastix VOIP PBX Phone System
---

[![Exxa Managed IT Services Brisbane](https://blog.exxa.tech/hubfs/Exxa_June2019%20/Images/logo_Png_small_1.png)](https://exxa.tech)

- [Home](https://exxa.tech/)
- [Services](https://exxa.tech/services/it-services-inforgraphic) 
    - [All Services](https://exxa.tech/services/services)
    - [Managed IT Services](https://exxa.tech/services/it-managed-services)
    - [Compute and Email to Cloud Migrations](https://exxa.tech/services/compute-and-email-to-cloud-migrations)
    - [Automated Backups](https://exxa.tech/services/automated-backups)
    - [IT Security Services](https://exxa.tech/services/it-security-services)
    - [VOIP Hosted Phone Service](https://exxa.tech/services/pbx-voip-hosted-phone-service)
    - [Microsoft 365 Business & Office 365 Discounts](https://exxa.tech/services/office365-discounts)
    - [Surface Pro 6 for Business Tax Time offer!](https://exxa.tech/services/surface-pro-6-for-business-tax-time)
- [Insights](https://exxa.tech/insights/managed-it-services-insights) 
    - [News](https://exxa.tech/news)
    - [Articles](https://exxa.tech/table/articles/)
    - [LinkedIn](https://www.linkedin.com/company/exxa-tech)
- [Partners](https://exxa.tech/partners/partners)
- [STORE](https://store.exxa.tech/find/computer-systems)
- [FREE AUDIT](https://info.exxa.tech/audit)
- [CONTACT](https://exxa.tech/about/contact-us)

![Managed IT Services Brisbane Articles](https://blog.exxa.tech/hubfs/Exxa_June2019%20/Images/server_racks_blue.png "Managed IT Services Brisbane Articles")

# Exxa Articles

# Installing Elastix VOIP PBX Phone System

# INSTALLING ELASTIX VOIP PBX PHONE SYSTEM

 

Download Elastix from [elastix.org](http://elastix.org/) website - 

Install Elastix like any normal CentOS iso (which is what it is derived from) and follow the prompts.

 

## Prerequisites

##### Elastix Server 

I created a virtual machine with two NICS one 192.168.16.60 and one for new VLAN - 192.168.18.253

##### New VLAN

Create a new VLAN for phones - in my case, 192.168.18.0.

On our Core Cisco switch:

Create VLAN 6 and assign to gigabit port 3. This is where our POE switch will go into. POE is needed to power the phones and the whole switch's VLAN is set to be 6.

**interface GigabitEthernet0/3**  
**switchport access vlan 6**  
**switchport mode access**  
**priority-queue out**  
**mls qos trust cos**  
**macro description cisco-desktop | cisco-switch | cisco-switch | cisco-desktop**  
**auto qos voip trust**  
**spanning-tree portfast**

Normal ports have:

**spanning-tree bpduguard enable**

You must remove this line from the config (and make sure spanning tree is enabled on the POE switch and the root ID is higher than the core switch) or it will disable the port as it thinks it is a looped NIC rather than a switch.

**interface Vlan6**  
**ip address 192.168.18.250 255.255.255.0**  
**spanning-tree link-type point-to-point**

##### New DHCP server and scope based on VLAN

You can and should do this on the Elastix server as it is very easy.

GUI > System > Network > DHCP Server

### Install Codec g729

We use g729 codec for lower bandwidth to avoid jittering so you need to install the correct codec from here

wget [http://asterisk.hosting.lv/bin/codec\_g729-ast110-gcc4-glibc-x86\_64-core2.so](http://asterisk.hosting.lv/bin/codec_g729-ast110-gcc4-glibc-x86_64-core2.so)

Find out by **rpm -q asterisk**

We are asterisk-11.14.1-0

Download to /usr/lib64/asterisk/modules/

chmod 755 [codec\_g729-ast110-gcc4-glibc-x86\_64-core2.so](http://codec_g729-ast110-gcc4-glibc-x86_64-core2.so/)

add 

**allow=g729**  
**allow=alaw**  
**allow=ulaw**

to /etc/asterisk/sip\_general\_custom.conf

Then do the same for the trunks (see below for config). You need to keep ulaw and alaw so Faxing continues to work as IAX2 faxes DO NOT FUNCTION with g729 only. 

Specify g729 as the top line or first to force g729 over the other codes.

**service asterisk stop**

**amportal stop**

**amportal start**

### Access the GUI:

[https://192.168.30.60](https://192.168.16.60/)

[And login with the username and password you used during setup](https://192.168.16.60/)

 

Read and follow Elastix without Tears - this is great for most of the setup. 

[http://elx.ec/ewt](http://elx.ec/ewt)

I will deal with specifics to our setup below.

 

### Stuff specific to our Engin installation:

**GUI > PBX > PBX Configuration > Trunks > Add SIP Trunk**

Trunk Details - VERY Important:

Trunk Name: **CMCRC** (not important)

Outbound Caller ID: **"CMCRC" <0285663301>** (can be left blank)

Maximum Channels - leave blank

Dialed Number Manipulation Rules - leave blank.

 

##### Outgoing Settings:

Trunk Name - Engin (can be called anything)

Peer Details - username and password will be provided by VOIP supplier - nat=auto as it is behind firewall. allow=ulaw,alaw - the most popular type of codecs. Check with your host as to what they accept. If the codecs are wrong it will disconnect the call when you answer it.

Host and outgoing (fromdomain) proxy can be different - check with host.

**username=0285663301**  
**secret=yourpassword\***  
**type=peer**  
**disallow=all**  
**insecure=very**  
**nat=auto**  
**allow=g729&ulaw&alaw**  
**canreinvite=no**  
**dtmfmode=auto**  
**host=[apollo.engin.com.au](http://apollo.engin.com.au/)**  
**fromdomain=[apollo.engin.com.au](http://apollo.engin.com.au/)**

\* the actual password I have not listed

##### Incoming Settings:

User Context: Same as username

**host=[apollo.engin.com.au](http://apollo.engin.com.au/)**  
**secret=yourpassword\***  
**username=0285663301**  
**dtmfmode=rfc2833**  
**disallow=all**  
**allow=g729&ulaw&alaw**  
**context=from-trunk-sip-engin**

Apparently there is sometimes an issue with DNS resolution hence the ip address instead of [apollo.engin.com.au](http://apollo.engin.com.au/).

context=from-trunk-sip-engin specifies that the total maximum calls out must be balanced by incoming calls (total simultaneous calls) as per what you have bought from your supplier.

 

### Outbound Routes:

I setup separate ones for Local / National / Mobile and International.

##### Local:

prepend - 02

prefix - nothing

match pattern - NXXXXXXX

Caller ID - nothing

Trunk sequence - 0 = CMCRC as we only have one trunk.

You can setup different outgoing trunks to save money - ie some may have cheaper international calls so you would force all international calls through this trunk.

##### National:

prepend - nothing

prefix - nothing

match pattern - XXXXXXXXXX

Caller ID - nothing

Trunk sequence - 0 = CMCRC

##### Mobile:

prepend - 04

prefix - nothing

match pattern - XXXXXXXX

Caller ID - nothing

Trunk sequence - 0 = CMCRC

##### International:

prepend - 0011

prefix - nothing

match pattern - XXXXXXXXX

Caller ID - nothing

Trunk sequence - 0 = CMCRC

 

### Extensions and Inbound Routes:

For Inbound routes and Extensions you can follow the Guide as it is quite concise and helpful. I won't be going into more details in this guide.

 

### Nat rules for server:

##### Cisco ASA Rules;

Add to the config for ASA - ASDM doesn't support a range of protocols.

**access-list outside\_access\_in remark Elastix SIP Access Rule**  
**access-list outside\_access\_in extended permit udp any host 220.245.207.66 eq sip**

**access-list outside\_access\_in remark Elastix 10000 to 20000 Access Rule**  
**access-list outside\_access\_in extended permit udp any host 220.245.207.66 range 10000 20000**

**static (inside,outside) 220.245.207.66 192.168.30.60 netmask 255.255.255.255**

This is a direct NAT for the whole IP address not just Ports (PAT).

##### Elastix / Asterisk Configuration:

Edit /etc/asterisk/sip\_nat.conf (or from the website GUI > PBX > Tools > Asterisk File Editor

192.168.18.0 being Phones VLAN and 192.168.30.0 being VLAN that has Elastix server on.

**externip=220.245.207.66**  
**localnet=192.168.30.0/255.255.255.0,192.168.18.0/255.255.255.0**

 

### Create DNS for internal and External Resolution:

Internally sip.cmcrc,com = 192.168.30.60

Externally [sip.cmcrc.com](http://sip.cmcrc.com/) = 220.245.207.66

 

### Registering a new Phone with an Extension:

**GUI > PBX > Batch Configurations > Select 192.168.18.0/24** as the network to discover. Then enter.

The new phone's MAC address should now appear, then select it with the checkbox, assign the extension to it from the drop down box and then press Set.

 

### Installing Digium Fax Module:

First get a free fax license here:

[https://www.digium.com/products/software/fax-for-asterisk](https://www.digium.com/products/software/fax-for-asterisk)

1) Download and execute the 'register' utility to generate a valid  
license.

2) Download and execute the 'benchfax' utility to determine the optimum  
build.

3) Use the 'Fax Selector' web utility to determine the recommended  
Fax For Asterisk download packages.

4) Download and install the 'res\_fax\_digium' module for your platform.

The steps to complete these tasks are described in the Installation  
Procedures section.

The register utility may be downloaded from:  
[http://downloads.digium.com/pub/register](http://downloads.digium.com/pub/register)

The benchfax utility may be downloaded from:  
[http://downloads.digium.com/pub/telephony/fax/benchfax](http://downloads.digium.com/pub/telephony/fax/benchfax)

The Fax Selector may be viewed from:  
[http://www.digium.com/en/docs/FAX/faa-download.php](http://www.digium.com/en/docs/FAX/faa-download.php)

The Fax For Asterisk binaries may be downloaded from:  
[http://downloads.digium.com/pub/telephony/fax](http://downloads.digium.com/pub/telephony/fax)

 

1) 

Command-line Example:

# chmod 500 /root/register

1.3) Run the register utility and follow the interactive instructions.  
Internet access is required from your Asterisk server in order to  
register your Fax For Asterisk key for licensed use. Outgoing network  
traffic to TCP port 443 (SSL) must be allowed in order for the register  
utility to successfully communicate with Digium's license server and  
complete the registration process. The registration utility will  
prompt you for your Fax For Asterisk license key.

Command-line Example:

# /root/register

2) Download Benchfax in the same way as register and repeat the instructions copying register.

3) Use the 'Fax Selector' web utility to determine your required components.

Depending upon your version of Asterisk and processor architecture,  
different components are required for the use of Fax For Asterisk. Digium  
provides a Fax Selector web utility in order to assist with choosing the  
correct components. The Fax Selector web utility should be viewed with a  
standard web browser and may be accessed via the following URL:

[http://www.digium.com/en/docs/FAX/faa-download.php](http://www.digium.com/en/docs/FAX/faa-download.php)

The files that the Fax Selector utility informs you are required for your  
platform should be the files that you use in place of the examples  
provided in steps 4 and 5 of this section.

4) Download res\_fax\_digium to the root home directory of your  
Asterisk server, Command-line Example:

# wget http://downloads.digium.com/pub/telephony/fax/res\_fax\_digium/

We need: res\_fax\_digium-11.0\_1.3.1-generic\_64

4.1) Expand the res\_fax\_digium archive and copy the res\_fax\_digium.so file  
to the /usr/lib64/asterisk/modules directory

4.2) change res\_fax\_digium.conf to say:

\[general\]  
#include res\_fax\_digium\_custom.conf  
ecm=yes

Copy to /etc/asterisk

4.3) Asterisk must be restarted in order to load your new Fax For Asterisk  
licensed channels. (See General Notes to use multiple licenses on one  
server.)

# asterisk -rx "restart when convenient"

 

### **Configure Jitter Buffer:**

This helps with static / poor call quality and can be fixed or adaptive - add these directives into /etc/asterisk/sip\_general\_custom.conf

**;Enable Jitter Settings**  
**jbenable=yes**  
**jbforce=yes**  
**jbimpl=fixed**  
**jbmaxsize=200**  
**jbresyncthreshold=1000**  
**jblog=yes**

You can also use:

**jbimpl=adaptive**

In this case you don't need 

**jbmaxsize=200**  
**jbresyncthreshold=1000**

### Details for X-Lite soft phone:

Account Name - whatever you like

User ID - whatever is setup on Elastix for the extension you are using

Password - whatever is setup on Elastix for the extension you are using

Domain - [sip.cmcrc.com](http://sip.cmcrc.com/)

Domain Proxy - Send outbound via Proxy - [sip.cmcrc.com](http://sip.cmcrc.com/)

This should work inside and outside of our network.

NOTE - go to Settings > Preferences and Select "Allow VOIP Calls"

 

### Reset lost GUI admin password and Mysql Password:

**elastix-admin-passwords --change**

 

### Articles

### NEVER MISS A NEWS UPDATE

- [Legal](https://exxa.tech/about/legal)
- [Privacy Policy](https://exxa.tech/about/privacy-policy)
- [Terms & Conditions](https://exxa.tech/about/terms-and-conditions)
- [Sitemap](https://exxa.tech/sitemap)

[LinkedIn](https://www.linkedin.com/company/exxa-tech)    |    [Twitter](https://twitter.com/exxatech)     |    [Facebook](https://www.facebook.com/Exxa.tech)                                            Copyright Exxa    