(2/5)How to setup an Asterisk server (using OpenPBX)

(2/5)How to setup an Asterisk server (using OpenPBX)

April 8th, 2015 // 7:05 pm @

After posting my first article on VoIP, now I am going to start doing some hands on. I am sure you are as excited as I am.

The purpose of this article is to guide you through setting up an Asterisk server. You won’t be able to do anything yet, however, it will familiarizes you with some key components, commands and basic functionalities.

Choosing an environment
Asterisk is a very low profile, low-overhead application. It runs on Linux and won’t require a lot of attention and resource. Most of the servers that i have deployed where installed on a VMWare machine. It performs as good as a physical server, also, backup is managed as well. But again it’s your call, and I will leave the rest to you.

The Operating System
You can download the latest FreePBX from https://www.freepbx.org/downloads/ . I prefer deploying FreePBX as opposed to installing Asterisk on top of a separate Linux, because it save a lot of hassle, debugging the system. Most importantly the iptables and Linux services. So go ahead, download FreePBX, and do the installation as default

After finalizing the installation go to

#cd ../etc/asterisk/

Use the “ls” to see the list of files under asterisk folder.

There are few files that we will be working with constantly:

  • sip.conf
  • extensions.conf
  • IAX.conf
  • iax_additional.conf
  • extensions_additional.conf
  • sip_general_additional.conf

first thing first, make a copy of

  • sip.conf
  • extensions.conf

cp sip.conf sip.BACKUP.conf

cp extensions.conf extensions.BACKUP.conf

Now we can easily mess things up, and if need to recover just copy the backups to the original

use ‘cat’ to view sip.conf and extensions.conf

cat sip.conf

Observe the file, don’t be intimidated, both files are huge but there is a good reason they are there. Now, if you go back to our list on top you notice that we have two files that named similarly to these two

  • extensions_additional.conf
  • sip_general_additional.conf

these two files are basically the same as sip and extensions, the difference is, when you are trying to make a change to your SIP or extensions, you won’t be playing with the main files, rather add them into these two, and once compiled they will append to the primary file.

SO, in conclusion DO NOT edit

  • sip.conf
  • extensions.conf

rather use

  • extensions_additional.conf
  • sip_general_additional.conf

to add/remove functionalities

now open

  • sip.conf
  • extensions.conf

seprately and look for lines

  • #include sip_general_additional.conf
  • #include extensions_additional.conf

Just make sure they are there, as you may have guessed these are the parameters that appends the external sheets to your main config files.

Usin Asterisk CLI

In the command line type

asterisk -vcr

This should take you into the asterisk command line/CLI

Here are some basic commands to get you rolling

core show help Echos valid CLI command
core restart now Force to restart asterisk
core stop now Force to stop asterisk

If you could do the steps above with no errors, that means you have built the essentials for your Asterisk, and it’s running as a service on your Linux successfully. In the next tutorial, we will discuss how to actually setup the environment, networks, and finally create some accounts for testing the voice comm.

Category : VoIP - telephony

Comments are closed.

On LinkedIn



"I have no special talent.
I am only passionately
Albert Einstein

Subscribe Now