Wednesday, 11 February 2015

Setting up a basic SIP trunk with Elastix MT (3.0)

The following tutorial will show you how to setup a basic PBX using Elastix MT (which is a front-end of a product called Asterix and test it with a SIP enabled device. The main reason I wanted to do this tutorial was due to the severe lack of information available to a newcomer to this field (although I found plenty in Spanish!)

Prerequisites for this lab:
- VM with 512MB RAM and 15GB Disk.
- SIP Enabled Device (any Android, IOS etc. device should do the trick)
- SIP trunk from a VOIP provider for connectivity with the PSTN

We will firstly install Elastix on a newly provisioned VM, fortunately Elastix comes with an easy to use installer - simply boot from the ISO which can be found below (make sure you download the MT version!):
 After installing Elastix do an "ifconfig" to confirm the IP address and head over to it's web interface:

Proceed by logging in with the username "admin" and the password you supplied during the setup.

The first thing we will do is create a "New Organization" as this is required prior to adding any groups or users. Proceed by going to:

"Manager" >> Organization >> Organization >> New Organization

Filling out all of the relevant details:

We will now create our first user by going to:

Manager >> User / Group >> User >> Create new User

** Make sure that you enter a valid email address during this stage as the password associated with this user account will be sent to the email defined! ***

We will now test this users login against a SIP enabled device - for the lab I have used an Android mobile phone with Zoiper. I simply entered the IP address of the Elastix server, the username (admin@<your-sip-domain>) and then the password that was emailed to me. At the moment you won't be able to make any calls obviously - but rather this process is there to ensure you can register successfully with the Elastix server.

We will now configure a SIP trunk on the Elastix server - for this I chose a provider called Voipfone (simply because they were offering a free trial at the time!) To configure a SIP trunk we will go to:

PBX > PBX > Trunks > Create new Trunk

We can verify the SIP registration with the trunk by doing the following at the shell:
asterisk -r
sip show registry
I hit some initial problems with getting the SIP trunk registering, so within the same console you can use the following commands to debug SIP negotiation:

asterisk -r
sip set debug on
If successful you should see a 200 return code - the best way to generate some authentication traffic is to edit the SIP trunk (don't make any changes) and then hit apply while monitoring:

Dial plan vs dial patterns


Post a Comment