Note: The following 2 tutorials were originally sourced from http://www.voip-info.org, these have been substantially modified, however all kudos to the original author(s)
Configuring Asterisk
- The first thing you need to do is contact FaktorTel support and ask to have your account changed to IAX. Once this is done continue on.
- Login to your server as user "root"
- Right-click on the background and select Open Terminal
- Run the following commands to backup your current/sample configurations:
cd /etc/asterisk
mv iax.conf iax.backup
mv extensions.conf extensions.backup
Here comes the fun part, connecting your copy of Asterisk to the FaktorTel network.
The first thing we need to do is connect your phone to your asterisk server. This tutorial
assumes that you are using X-Ten softphone from
www.xten.com. Please
download the phone and have it installed on your PC before continuing. (Note: We will be configuring the phone
later in the tutorial, so just have it installed and nothing else).
There are two things we need to know when we want to connect
your software phone to your asterisk server. These are the
codec
and your connection details. For the purpose of this tutorial we are going to select ILBC as your
codec choice. This is because ILBC is a low bandwidth protocol which is nice and easy to setup
for the FaktorTel network.
Lets get started:
- Login to your server as user "root"
- Right-click on the background and select Open Terminal
- Run the following command:
rm /etc/asterisk/sip.conf
- Answer yes if prompted to remove.
- Run the following command:
nano -w /etc/asterisk/sip.conf
You should now be in a window which allows you to edit a file. Please copy and paste the following
into that file. To paste press
CTRL+V in the editor.
[general]
port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
;context = voipmenu ; Send SIP callers that we don't know about here
; sets the codecs you can use. First disallow all defaults, then set our own individually.
disallow = all
allow=ilbc
allow=gsm
allow=ulaw
; Setup a user with the phone number 1000 on our network.
[1000]
tos=reliability
disallow=all
allow=ulaw
allow=ilbc
allow=gsm
type=friend
username=1000
host=dynamic
context=default
reinvite=no
canreinvite=no
secret=abc123
nat=yes
qualify=yes
Once you have this copied and pasted into your file, to save press
CTRL+O then press enter. Then
to exit press
CTRL+X and you will be put back to the command prompt ready to edit our next
configuration file.
What we have just done here, is we have setup a user in Asterisk using the "SIP" protocol so that your
software phone can connect to your server. At the end of the tutorial we'll get to setting up the
software phone.
The next file we need to edit is the IAX.CONF file. This file controls the connection from your server
to the FaktorTel server and allows you to place a call out of our network.
- Run the following command:
nano -w /etc/asterisk/iax.conf
You should now be in a window which allows you to edit a file. Please copy and paste the following
into that file. To paste press
CTRL+V in the editor.
; Setup the general options, including our default port for use with IAX
; the amount of bandwidth we have on our connection to the server (best left as low)
; jitterbuffer, this isn't enabled at the moment in the latest CVS but we don't want it
; to suddenly come on when it is enabled.
[general]
bandwidth=low
jitterbuffer=no
tos=lowdelay
; This line registers your server with the FaktorTel main server, what this means is that
; it tells us where you are on the internet so you can receive incoming calls from our network
; don't forget to replace "YOUR-USERNAME" and "YOUR-PASSWORD" with the ones supplied to you.
register => YOUR-USERNAME:YOUR-PASSWORD@iax.faktortel.com.au
; The following section sets up an IAX user called "faktortel", this is the user which will place
; the call from your server to our network. First we tell it not to use any other codec by setting
; our "Disallow" and "allow" settings. Then we set the type to "friend", then set our password and
; username for the faktortel network (don't forget to change these to the ones supplied to you).
; using the "host" command we tell the user which server to connect to, then using "auth" we tell
; it the type of password to look for, and finally using "qualify" we tell it to keep in touch
; with the server ever 3 seconds. (This is fast enough).
[faktortel]
disallow=all
allow=ilbc
type=friend
username=YOUR-USERNAME
secret=YOUR-PASSWORD
host=iax.faktortel.com.au
auth=md5
context=incoming
qualify=3000
Once you have this copied and pasted into your file, to save press CTRL+O then press enter. Then to exit press CTRL+X and you will be put back to the command prompt ready to edit our next configuration file.
What we have now successfully done is created a connection between your server and the main FaktorTel
IAX server. This is the connection that will allow you to make calls out and receive calls in from
the network.
The last configuration file we need to edit is our EXTENSIONS.CONF file, because of the complexity
of this file we are going to make a
very simple one. Basically we are going to make all calls
which start with a 0 go out through the FaktorTel network and all calls which come in from the
FaktorTel network ring your SIP or software phone.
- Run the following command:
nano -w /etc/asterisk/extensions.conf
You should now be in a window which allows you to edit a file. Please copy and paste the following
into that file. To paste press
CTRL+V in the editor.
; First we setup a context called "Default" this is our "Encapsulation" context. The only point of this
; context is to point to all our other groups in order. We only have one other outgoing context at the
; moment so we are just including one "faktortel-outgoing" however this will allow you to make a much
; more sturdy network later if you use it as a full PBX. This is also the context we use to place calls out of.
[default]
include => faktortel-outgoing
; FaktorTel-Outgoing is another context, this tells anyone who is trying to make a call out from the PBX
; which starts with a "0" to put that call out to the PSTN via FaktorTel. The format here is best
; described at "www.voip-info.org" under "configuration files" "extensions.conf".
[faktortel-outgoing]
exten => _0.,1,DIAL(IAX2/YOURUSERNAME@faktortel/${EXTEN:0})
exten => _0.,2,Congestion
; Adding an extension for the number 1234 which will give you the Time.
exten => 1234,1,SayUnixTime
exten => 1234,2,Hangup
; This is our "incoming" context, when a call comes in from the faktortel network it is sent here
; because we set "context=incoming" in our IAX.CONF file under [faktortel]. This then tells it
; that ANY call that comes in should ring the SIP based phone at extension "1000" which we setup
; earlier.
[incoming]
exten => s,1,DIAL(SIP/1000,60,tr)
exten => s,2,Hangup
Once you have this copied and pasted into your file, to save press CTRL+O then press enter. Then to exit press CTRL+X and you will be put back to the command prompt.
Now, you will need to start Asterisk for the first time with your new configuration files. Here is how
to do it, at the command prompt type the following:
/usr/sbin/asterisk -vvc
This opens up Asterisk with "Verbose" mode on and puts you into the Console. You should now be sitting
inside the Asterisk console. If you aren't please check your previous steps above.
Now go to your Windows based PC which you installed "X-Ten" (the softphone) on and load X-Ten. We now
need to set your softphone up to connect to your Asterisk server.
Configuring your new softphone for to work with Asterisk.
Step 1:
Load up your now installed softphone by going to your Start Menu, then across to All Programs and then
X-Lite. Click on the Yellow icon in here and you should be presented with your softphone.
Step 2:
Now we need to get into the SIP Setting Menu for your Asterisk account, here is how to do it:
* Click on the "Menu" button in your softphone located here:
You will now be presented with a menu, you will need to click on the
"System Settings" option
inside this menu. You can find it here:
You should now see another menu. In this menu you will need to click on the
"Sip Proxy" menu
option, this is located here:
You should now be at a menu which has an option similar to
"Sip.faktortel.com.au" in it. Double
click on this menu option to select it. Here is what it should look like:
You will now be at another menu, this one has some information we need to fill in on it. We will make
this step 3 for ease of reading.
Step 3:
In the menu you should now be in we need to fill in the required values:
The following are what you need to put in each field:
- Enabled: Please make sure this is set to "Yes".
- Display Name: Enter in your real name in here. E.g. "Chris". (without the quotes).
- Username: When we setup your account in Asterisk we gave it the username of "1000" (Without the quotes), please put that in here.
- Authorization User: Please enter your username in this box as well. (Same as above).
- Password: When we setup your account we set the password as "abc123" (without the quotes) please put that in here.
- Domain / Realm: Please set this to The Asterisk Servers I.P. address
- SIP Proxy: Please set this to The Asterisk Servers I.P. address
Now, Press the "Enter Key" and then hit the "Cross" (close) up the top of the menu.
Step 5:
Thats It, simply close down the softphone and restart it. Your screen SHOULD say "Logged In" if everything is correct.
Placing your first call
If you have successfully logged in to your Asterisk server using your software phone we can now try
to make a call. Since we added 1234 as an extension in your Asterisk server you should be able to
dial this and hear the time. If you can do this then your Asterisk server is setup correctly.
Once you are happy with your setup if you haven't already you can enable PSTN calling in the "signup"
section of our website for you account, once you have done this try calling a local number. Don't forget
to put the 02 or 03 etc, in front of the number otherwise it won't be passed through to the network.
Thats it for now - If you require more assistance getting your Asterisk server to work don't
hesitate to contact FaktorTel, however be prepared to give root SSH access and provide us with as many
details as possible about your setup and the error thats occuring when you first email us.