Tutorial on Setting up Asterisk

0 Comments 14 January 2015

We will now focus more on tutorials about VoIP setup and hosted IP PBX setup such as Asterisk. Asterisk in an open source telephony switch developed by Digium. It is widely used in office, residential and commercial situations. One can create systems that incorporate hundreds of office phones to a simple residential setup for families.

Asterisk has the capabilities for various applications if one knows how to develop under it. The issue mainly is that it is not simple to code in Asterisk. Once you understand the platform things can simpler but for a beginner it requires vast knowledge.

 

Hosted IP PBX Components

A hosted PBX is Asterisk. Asterisk requires a server either hosted in your own home or a provider such as Hostgator. We recommend Hostgator as it is 100% reliable with quick customer support. It is perfect for any beginner. One will require a VPS Linux system that is manageable.

Hosted IP PBX consists of Asterisk installed on a IP server. A typical server will do for residential purposes but if it is for office use then a stronger server with backups will be needed. We will cover office use in a another post.

Components of Asterisk

Asterisk is a complete phone system. It has various components such as caller ID, call forwarding, IVR, voicemail, fax and much more.

For residential use, one wants to capture the phone number that enters the system and redirect it to a phone accordingly. Technically, with Asterisk you do not need a VoIP provider as it is a system in itself. We will cover how to redirect a incoming call to a SIP enabled device connected to the network.

 

PBX Tutorial

In a Asterisk server (once Asterisk is installed), the extensions.conf file must be located. To do this go to:

cd /etc/asterisk/
nano extensions.conf

Running these two pieces of code should open up extensions.conf file for editing purposes. Note: every server is different but a common area where this file is save is under etc/asterisk.. Once opening this file, one will be presented with alot of confusing information but we will break it down. Scroll down towards the botton and you see CONTEXTS.

Context in Asterisk are surrounding by square brackets ([]) that signify an extension. A extension can be seen as a individual system where one can write commands that tell the system what to do

[context1]
–>extension 1, priority 1, application
–>extension 1, priority 2, application

The above code represents how the code is setup. The first thing is the extension the call is coming from, next is the priority which should be linear as in (1, 2, 3…). The third part is the application which in our case is Dial for outgoing. [context1] represents the name of the code.

For example:

[CheapestVoIPCalls.net]
exten => 3000,1,Dial(SIP/3000,30,Ttm)
exten => 3000,2,Hangup

The above code is a simple dial out to a SIP enabled device. When a call comes in the extensions CheapestVoIPCalls.net is run and the commands are sent out. Dial(SIP/3000,30,Ttm) represents the application to run once the call comes in. SIP/3000 represents forwarding the call to account 3000 SIP that is connected to the server, 30 represents timeout until call picked up, and Ttm are extra options.

After the call is complete, one must tell it to hangup as well.

 

Who is SIP/3000?
This is a significant part that also needs to be setup. Since the extensions are set, the SIP settings need to be set as well. locate the file /etc/asterisk/sip.conf and open it. Scroll to the bottom and input the following code:

[3000]
type=peer
host=dynamic
secret=PASSWORD
context=CheapestVoIPCalls.net

Once again the [3000] represents the USER being called. ‘Type’ represents the type of system which in this case is a peer because it is an individual SIP softphone or device. ‘Host’ is the IP address of the end system which in this case is dynamic so it can change. ‘Secret’ is the SIP password. When one register their device or softphone, username will be 3000 and password will be PASSWORD. These are changeable. Context must be the same as the extension from previously.

 

Last steps!
Almost there! Now setup your SIP softphone such as Xlite with the new information.

Username: 3000
Password: PASSWORD
Host: your server IP

Now whenever a call comes into the server, it will automatically be routed to the SIP enabled device with username 3000. That is how simple it is. Now all one needs to do is setup a phone number that can be bought from various sites which are called DID numbers. Forward that DID number to the IP of the server and you can send that out to friends as your personal home number.

When someone calls that it will forward to your SIP enabled device. You can potentially eliminate any third part VoIP providers and just use Asterisk. The Hosted IP PBX is the only cost for this setup!

We hope you found this tutorial useful. Stay tuned for much more!

Resources:
Asterisk Information from Voip-Info.org

Originally posted 2011-08-07 03:04:52.

More VoIP information
  1. SIP Trunking
  2. IP PBX Benefits
  3. Wholesale VoIP
  4. VirtualPhoneLine – Free DID

Categorized under Reviews, VOIP News

Share your thoughts

© 2017 CheapestVoIPCalls.net.