IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
Transcript of IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
1/31
Practical Guide
How to setup VoIP
Infrastructure using
AsteriskNOW
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
2/31
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
3/31
Table of Contents
1. Background...........................................................................................................................1
2. The VoIP scenarios...............................................................................................................2
3. Before getting started...........................................................................................................3
3.1 Training Kits...................................................................................................................33.2 Software requirements.....................................................................................................3
3.3 Conventions....................................................................................................................4
3.4 Known issues...................................................................................................................4
4. Virtualization versus dedicated hardware..............................................................................5
5. Installing AsteriskNOW........................................................................................................5
5.1 Installation Screenshots discussed...................................................................................7
6. Configuring AsteriskNOW for Scenario 1 - 2 - 3.................................................................10
6.1 Configuration though the Asterisk GUI Setup Wizard ................................................11
6.1.1 Step 1: Hardware detection...................................................................................11
6.1.2 Step 2: Local extensions settings...........................................................................136.1.3 Step 3: Configuring service providers....................................................................14
6.1.4 Step 4: Outbound calling rules..............................................................................17
6.1.5 Step 5: Voicemail settings.....................................................................................19
6.1.6 Step 6: User extensions.........................................................................................20
6.1.7 Step 7: Incoming calls rules...................................................................................23
6.1.8 Advanced options: Asterisk GUI...........................................................................24
7. Configuration of ATAs........................................................................................................24
8. Quick Installation Guide.....................................................................................................26
8.1 Scenario 1......................................................................................................................26
8.2 Scenario 2......................................................................................................................278.3 Scenario 3......................................................................................................................28
9. Verify your results...............................................................................................................29
9.1 Scenario 1......................................................................................................................29
9.2 Scenario 2......................................................................................................................29
9.3 Scenario 3......................................................................................................................29
1. Background
The first edition of the VoIP-4D Primer, Building voice infrastructure in developing regionsreleased in December 2006 covered the basic aspects of IP Telephony and provided
configuration guidelines for the Asterisk PBX for three basic scenarios. This document aims
to make the installation of such scenarios even easier. While in the first version of the Guide
we configured Asterisk by editing the configuration files, in this guide we are going to use a
graphical user interface (GUI). We have reviewed several initiatives that provide a graphical
interface to Asterisk and decided to prepare this practical tutorial based on the AsteriskGUI
available in Asterisk 1.4.x series.
A new distribution known as AsteriskNOW, includes a straightforward installer and all the
software packages for Asterisk production and development. Although the distribution is still
in beta stage (beta5 in November 2007), it has been designed with a very clean interface anda very intuitive wizard.
1
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
4/31
An analysis of other initiatives is available in the document: Making IP telephony knowledge
accessible (prestudy1).
2. The VoIP scenarios
The three scenarios described in this document are similar to the ones described in detailed in
the VoIP-4D Primer.
Scenario 1
Creating a local private telephony network
in a rural community
This scenario consists of a single PBX with
a set of clients. Clients can be either
softphones, VoIP phones or ATAs.
Scenario 2
Interconnecting communities
In this scenario we interconnect two PBXs.
Local extensions of one PBX are made
available to the other and vice versa.
Scenario 3
Connecting communities to the PSTN
In this final scenario, we have
interconnected two PBXs and allow the
possibility of reaching the PSTN from any
of them.
1 Can be downloaded from www.voip4d.org, under Documentation
2
http://www.voip4d.org/http://www.voip4d.org/ -
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
5/31
3. Before getting started
If you have not read the VoIP-4D Primer(www.voip4d.org) have a look to the first chapter
as it will provide you with the necessary background to understand the basic concepts of IP
Telephony.
The very minimum hardware requirements for Scenario 1 and 2 is a single PC running
Windows and hosting two virtualized installations of Asterisk. You can test the calls using asoftphone and the voicemail service.
For Scenario 3, you will need two computers, one of them with a dedicated communicationcard TDM400p. Alternatively, you can use two Asterisk appliances such as the IP04s2.
3.1 Training Kits
If you want to run a VoIP training session based on this material, consider at least having
one training kit per group as follows:
2 PCs with network cards 2-4 ATAs or (2-4 VoIP Phones)
2-4 analogue phones (if using ATAs)
1 TDM400p card with 1 FXS and 1 FXO ports
1 4-port switch (better a hub, if you can find one!)
Access to a PSTN line
Alternatively you can use the following training kit 2 IP04 (3 FXS, 1 FX0)
2-4 analogue phones
1 4-port switch
Access to a PSTN line
3.2 Software requirements
ISO Image of AsteriskNOW
VMware Image of Asterisk NOW
http://www.asterisknow.org/downloads
VMware Player
http://www.vmware.com/products/player/
Softphones ; X-Lite, Kiax, etc
http://www.voip-info.org/wiki-Asterisk+IAX+clients
Wireshark (for debugging, advance users)
DHCP Server
2 http://www.rowetel.com/ucasterisk/
3
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
6/31
Latest Firefox version >= 2.0.0.9
Documentation
AsteriskNOW quickstart guide
VoIP-4D Primer
This document (Setting up VoIP Infrastructure using AsteriskNOW)
3.3 Conventions
This documentation has used the IP address 192.168.46.135 for the majority of the
screenshots. Be aware that you need to use your own IP addresses for your setup.
1. We will create four local extensions in each PBX, with the names 1000, 2000, 3000,
4000.
2. We will use the same number as username, callerid and password, i.e. username =
callerid = password = 1000 (or 2000, 3000, 4000) ).
3. The voicemail extension is 8500.
4. Scenario 2 and 3 include two different PBXs that should have different IP addresses.
5. Each of the PBXs sees the other PBX as a VoIP Service Provider.
6. The account username: 4646 password: 4646 is created in each of the PBXs for thepurpose of routing calls between them
3.4 Known issues
These are some of the issues found during the preparation of this tutorial:1. If you have problems during authentication, consider using the latest Firefox version
and/or removing the cache and the cookies of your browser.
2. VMplayer can not boot your image if you have a Windows machine with FAT16
filesystem with a size bigger than 2 GB.
Include the line diskLib.sparseMaxFileSizeCheck= "false"at the end of the VMX fileto overcome the problem.
3. AsteriskNOW is still in beta stage. In some cases it is not possible to edit entries after
running the wizard. Consider deleting and recreating the entry instead of editing it.
4
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
7/31
4. Virtualization versus dedicated hardware
There are several ways to install AsteriskNOW on a
computer. The method to use depends on your
answers to the following two questions:
1. Does you VoIP setup need to be connected
to the PSTN (TDM support)?
2. Do you have a dedicated machine for the
VoIP setup?
If you answer is Yes to the first question, you need
to install AsteriskNOW in a dedicated machine.
If you do not need to be connected to the PSTN,
you have two options depending on if you have a
machine available for the implementation
(Dedicated machine).
If you do not have a dedicated machine you need to
install VMware player in your machine and the
boot the VMware AsteriskNOW ISO. Thereafter
you can install AsteriskNOW virtually, using your
VMware installation.
If you have a dedicated machine, boot from a CD
that contains the AsteriskNOW ISO.
5. Installing AsteriskNOW Install AsteriskNOW
The distribution is available in three main flavours:
1. A version that runs on the x86, 32-bit/64 bit processors such as Intel P4 and AMD
Athlon XP.
2. A version that runs on the Xen virtual machine.
3. A version that runs on the VMware Player.
If you do not have a dedicated machine available or you want to test the software
distribution, you should consider using the VMware ISO image. Please note that using
the VMware image will not allow you to use any specialized hardware as the PCI
TDM400p card.
Although, it is not mandatory, consider having a DHCP server available on the
network.
Log into the web interface
Open a browser and go to:
https://192.168.46.135
5
https://192.168.46.135/https://192.168.46.135/ -
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
8/31
The web interface provides you access to three main configuration areas:
1. Asterisk GUI configuration wizard
A step-by-step configuration wizard that guide you through 7 steps to get your PBX
up and running
https://192.168.46.135/static/config/setup/install.html
2. The AsteriskGUI
Once you have run the wizard for the first time you can edit and modify the
parameters using the URL
https://192.168.46.135
https://192.168.46.135/static/config/cfgbasic.html
3. The Appliance Platform Configuration Wizard
This wizard allows to configure parameters that are not Asterisk specific, for example
the root password of the system, the IP address, backup schedule, etc.
https://192.168.46.135 :8003/rAA/
Important notice! This tutorial covers only how to use the Asterisk GUI configuration
wizard to set up the scenarios presented. For a complete description of all options available
in the other graphical interfaces, consult the Asterisk Quickstart Guide3.
3 http://www.asterisknow.com/files/downloads/quickstart_asterisknow.pdf
6
https://192.168.46.135/static/config/setup/install.htmlhttps://192.168.46.135/https://192.168.46.135/static/config/cfgbasic.htmlhttps://192.168.46.135:8003/rAA/https://192.168.46.135/static/config/setup/install.htmlhttps://192.168.46.135/https://192.168.46.135/static/config/cfgbasic.htmlhttps://192.168.46.135:8003/rAA/ -
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
9/31
5.1 Installation Screenshots discussed
Areas with a grey background are advanced tips. If you are not familiar with Asterisk, simplyignore them.
GETTING STARTED - Installing a VMware image
DESCRIPTION
If you install AsteriskNOW using a
ISO image:
Install VMware player and makesure that your Ethernet is in
bridge mode.
By putting the interface in Bridge
Mode, your AsteriskNOW will fetchand IP address via DHCP after
booting.
Important: You need to have a
DHCP server available in your
network.
asterisk-0.9.6.5-x86.vmx
If during the process of booting theVMware player complains about the
size of your FAT filesystem (> 2
GB):
Locate the configuration file of the
guest application, a file that finishes
with VMX.
Use a text editor like Wordpad, and
append an extra line.
CONFIGURATION FILES
Configuration file starts by#!/usr/bin/vmplayer
Append this line:
diskLib.sparseMaxFileSizeCheck= "false"
7
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
10/31
GETTING STARTED Make sure AsteriskNOW has an IP address
DESCRIPTION
If your DHCP is working, your
AsteriskNOW will inform you of the
IP address that your box hasobtained.
The AsteriskNOW Console allows
you to update, restart and
shutdown the system.
Using the Console you can also
operate a command line interface
(the asterisk CLI>).
Accessing the box via SSH
You can access the AsteriskNOW
box at any time via SSH.
The account is admin with the
default password password.
You can get admin privileges using
sudo.
CONFIGURATION FILES
If you log into the box using SSH, please have a look
at the /etc/password and /etc/sudores files.You
can see that the user admin can get administrativeprivileges. Consider changing the default password of
the user admin.
It is important to notice that there are 3 different
admin users in each installation:
(1) The admin user that let you log into the box via
SSH.
(2) The admin user that have access to the
AsteriskGUI via HTTPS and
(3) The admin user that can configure the appliance
settings (rPath).
Yes, three different passwords!
8
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
11/31
GETTING STARTED Log into AsteriskNOW web interface
DESCRIPTION
Open a browser and go to the IP
address that AsteriskNOW has
obtained.
In our example
http://192.168.46.134
Log into the interface using the user
admin and the default password
password.
/etc/asterisk/manager.conf
AsteriskGUI uses Asterisk manager
commands (Asterisk Manager API)
to communicate with Asterisk.
The user and password of the
AsteriskGUI is available in the
manager.confconfiguration file
CONFIGURATION FILES
[general]displaysystemname = yesenabled = yes
webenabled = yesport = 5038bindaddr = 0.0.0.0[admin]secret = password
read = system,call,log,verbose,command,agent,user,configwrite = system,call,log,verbose,command,
agent,user,config
9
http://192.168.46.134/http://192.168.46.134/ -
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
12/31
6. Configuring AsteriskNOW for Scenario 1 - 2 - 3
In a nutshell, the process of configuring each of the PBXs can be summarized in 7 basic steps:
(Step 1) Verify if any zaptel cardhas been detected.
Any zaptel compatible card should be detected. Cards supported by zaptel include:
Digium, Sangoma, Xorcom Astribank (in beta 6.5), Rhino and Openvox cards.
This step will report no hardware detected if you are configuring a PBX without
zapata compatible hardware or running the VMware version of AsteriskNOW.
Only Scenario 3 will use and detect a zaptel card.
(Step 2) Indicate the first extension number and the length of the localextensions.Here you indicate the number of digits that your local extensions have and what the
first extension number is. In our scenario we will use 4 digits and extension 1000 asthe first one.
(Step 3) Create Service ProvidersIn this step we specify who the service providers of outgoing calls are.
Scenario 1: the PBX is standalone and has no external service providers.
Scenario 2: each PBX sees the other PBX as VoIP service provider.
Scenario 3: the PBX with a TDM card needs to be configured with two different
service providers. The first provider is the other PBX (VoIP) and the second
provider is the Analogue Port of the TDM Card.
(Step 4) Configure (Outbound) Calling Rules
In this step we specify what the calling rules are to reach the different serviceproviders.
Scenario 1: does not need any outbound calling rules.
Scenario 2: need to indicate that to reach the other PBX's local extensions we need
to dial 9 + .
Scenario 3: Same calling rule as in Scenario 2 to reach the other PBX. Also, we
need to add an outgoing calling rule that indicates how to reach the PSTN. To
reach the PSTN, we need to append a 0 to the PSTN number ( 0 + ).
(Step 5) Voicemail extension
In this step we will configure the extension number used to reach the voicemail. Thedefault number for all three scenarios is 8500.
(Step 6) Users extensionsHere we configure all local extensions associated to each of the PBXs. We need to
create four local extensions in all three scenarios (1000, 2000, 3000 and 4000).
The local extensions can be either VoIP clients running IAX or SIP, or analogue ports
if available.
For scenario 2 and 3, we will add the special extension 4646 that is used to route calls
between the PBXs.
10
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
13/31
(Step 7) Configure (Inbound) Calling RulesIn Scenario 1 and 2, we do not need to create any special rules for incoming calls as all
calls will be generated locally.
In Scenario 3, we will need to indicate which local extension will ring when there is an
incoming call from the PSTN.
6.1 Configuration though the Asterisk GUI Setup Wizard
This section guides you though the graphical configuration setup wizard provided by
AsteriskNOW. If it is the first time that you log into the AsteriskGUI, you will be redirected
straight to the setup wizard. The setup wizard will guide you through seven (7) steps to
configure your VoIP setup.
This guide includes both basic and advanced configuration tips. Areas with grey background
are advanced tips. If you are not familiar with Asterisk, please ignore them.
6.1.1 Step 1: Hardware detection
STEP 1 HARDWARE DETECTION
(Scenario 1 and 2)
DESCRIPTION
This screenshoot shows Step 1 of
the wizard for Scenario 1 and 2,
where our PBX does not include
any PCI expansion cards.
It is possible to run the wizardagain by accessing the following
URL:
http:///static/config/setup/install.html
CONFIGURATION FILES
All the static web pages of the wizard are available in
the following path:
/var/lib/asterisk/static-http
11
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
14/31
STEP 1 HARDWARE DETECTION (2/2)(Scenario 3)
DESCRIPTION
If you have a PCI card as the
TDM400, the wizard will detect the
modules automatically.
In the example, we have 1 FXO and
1 FXS port with the following
functionality:
FXO port: we can attach an external
PSTN line.
FXS port: we can attach a phone.
/sbin/zapscan
The zapscan utility detects the ports
and generates the /etc/zaptel.conf
configuration file.
The configuration files shows the
type of signalling needed for each of
the ports.
fxsks=1 means that port #1 is aFXO that needs FXS Kewlstart
signalling.
CONFIGURATION FILES
#grep -v "#" /etc/zaptel.conf
loadzone = usdefaultzone=usfxsks=1fxoks=2
12
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
15/31
6.1.2 Step 2: Local extensions settings
STEP 2 LOCAL EXTENSIONS SETTINGS(Scenario 1, 2 and 3)
DESCRIPTION
In the second step of the
configuration we indicate the lengthof the local extensions. In our setupwe are going to use four digits and
the extension number 1000 as the
first extension.
This configuration is common to all
three Scenarios.
/etc/asterisk/users.conf
This parameter that we set up in
the wizard can be found in the
users.conf with the name userbaseinside of the section [general]
CONFIGURATION FILES
[general]
userbase = 1000localextenlength = 4
13
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
16/31
6.1.3 Step 3: Configuring service providers
STEP 3 CONFIGURING SERVICE PROVIDERS (1/3)(Scenario 2 and 3)
DESCRIPTION
In Scenario 2 and 3, we want our
PBX to be able to communicate
with another PBX and vice versa.
To do that, we need to create a new
Service Provider.In this example, we add a new
service provider that is reachable at
the IP address 192.168.46.136.
We indicate that we want tocommunicate using the protocol
IAX using an account with
username 4646and password 4646.This account will be used between
the PBXs for authentication and
routing calls.
/etc/asterisk/users.conf
/etc/asterisk/extensions.con f
The creation of new service provider
involves:
(1) A new section in the users.conf
file and
(2)A new entry point in the
extensions.conf (dialplan)
In our example we are creating a
service provider [trunk_1] reachable
at 192.168.46.136.
We are using the account user: 4646
password: 4646.
Incoming calls from this provider
fall in the section [DID_trunk_1] of
the dialplan
CONFIGURATION FILES
/etc/asterisk/users.conf
[trunk_1]disallow =allow = allcallerid =contact =context = DID_trunk_1dialformat = ${EXTEN:1}fromdomain =fromuser =group =hasexten = nohasiax = yeshassip = nohost = 192.168.46.136insecure =port = 4569provider =registeriax = yesregistersip = nosecret = 4646trunkname = Custom - InterIAX Callstrunkstyle = customvoipusername = 4646
/etc/asterisk/extensions.conf[DID_trunk_1]include = default
14
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
17/31
STEP 3 CONFIGURING SERVICE PROVIDERS (2/3)(Scenario 3)
DESCRIPTION
If your PBX contains a TDM card
with a FXO port (Scenario 3) we
can communicate with thetelephone network (PSTN).
In the third scenario, you need to
create a new Service Provider
associated to the Analog Port.
In our example, the TDM card
contains a FXO port in slot #1.
/etc/asterisk/users.conf
/etc/asterisk/extensions.conf
The creation of new service provider
via the PSTN also modifies two
files:
(1) a new section in the users.conffile and
(2) a new entry point in the
dialplan.
In our example the AsteriskGUI
creates a new service provider with
the name [trunk_2] reachable viathe analog port #1
Incoming calls from this provider
fall in the section [DID_trunk_2] of
the dialplan
CONFIGURATION FILES
/etc/asterisk/users.conf[trunk_2]disallow =allow =callerid = asreceivedcontact =context = DID_trunk_2dialformat =fromdomain =fromuser =group = 1
hasexten = nohasiax = nohassip = nohost = dynamicinsecure =port =provider =registeriax =registersip =secret =trunkname = Port 1trunkstyle = analogusername =
zapchan = 1
/etc/asterisk/extensions.conf[DID_trunk_2]include = default
15
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
18/31
STEP 3 CONFIGURING SERVICE PROVIDERS (3/3)(Scenario 3)
DESCRIPTION
You can create as many service
providers as you wish.
One of the PBX of the Scenario 3,
has two different Service Providers.
One provider is the other PBX that
can be reached via a VoIP
connection (Custom VoIP) and the
second provider is reachable via the
Analog (TDM400) expansion card.
/etc/asterisk/users.conf
The configuration file users.confwas introduced in the Asterisk 1.4
series.
In the 1.2.x series, each user or peer
was defined in sip.conf or iax.conf.The entity was classified depending
on the protocol. The users.conf
merges iax.conf, sip.conf and someof the options of zapata.conf intoone single file.
CONFIGURATION FILES
The users.confcontains three types of sections
[general]
This section includes default values.
[trunk_#]
These sections include the configuration of the
different service providers.
[XXXX]These sections include the configuration of the local
extensions (1000, 2000, 3000, 4000). They can be
analog ports or IAX or SIP users.
16
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
19/31
6.1.4 Step 4: Outbound calling rules
STEP 4 OUTBOUND CALLING RULES (1/2)(Scenario 2 and 3)
DESCRIPTION
Once we have configured the service
providers we can configure our
dialplan.
In Scenario 2 and 3, we need to create a
rule to be able route calls between the
PBXs. In the example, we create a
calling rule with the name InterIAX
Calls. In this menu, we describe thedialing rules that need to be applied
when we want to reach the extensions of
the VoIP provider (the other PBX) that
we peer with.
We indicate that to reach the other
PBX, we need to dial 9 before the
extension number. To reach the
extension 1000 in the other PBX, we
need to dial 9+1000.
/etc/asterisk/extensions.conf
AsteriskNOW allows you to create
different dialplans. The default DialPlan
associated to the context of local
extensions is
numberplan-custom-1.
Outgoing calls between the PBX are
routed using the trundial Macro, that
places a call using:
Dial(IAX2/4646:[email protected]/${EXTEN:1})
and uses the account 4646 data for
authentication.
CONFIGURATION FILES
/etc/asterisk/extensions.conf
[numberplan-custom-1]plancomment = DialPlan1include = defaultexten=_9XXXX.,1,Macro(trunkdial,${trunk_1}/${EXTEN:1})comment =_9XXXX.,1,InterIAX Calls,standard
17
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
20/31
STEP 4 OUTBOUND CALLING RULES (2/2)(Scenario 3)
DESCRIPTION
In Scenario 3, we need to create
another calling rule that indicatesthat any local extensions can reach
the PSTN by Port #1 (the analog
service provider).
Select Define a custom patternandfill in your outbound calling rule
according to the screenshot to the
right.
In the example, a call is placed by
appending a 0 to a valid PSTN
number, which is defined to be 6or moredigits.
/etc/asterisk/extensions.conf
In this example we have two service
providers. The first service provider
is a VoIP provider (another PBX)
and the second provider is the
analog PSTN line.
To reach the VoIP provider: 9 +
extension #
To reach the PSTN via analogue
port: 0 + PSTN #
CONFIGURATION FILES
[numberplan-custom-1]plancomment = DialPlan1include = default;Calls between PBXs. 9 + exten =
_9XXXX!,1,Macro(trunkdial,${trunk_1}/${EXTEN:1})comment = _9XXXX!,1,InterIAX Calls,standard
;Calls to the PSTN. 0 + exten =
_0XXXXXX.,1,Macro(trunkdial,${trunk_2}/${EXTEN:1})comment = _0XXXXXX.,1,outgoing PSTN,standard
18
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
21/31
6.1.5 Step 5: Voicemail settings
STEP 5 VOICEMAIL SETTINGS(Scenario 1, 2 and 3)
DESCRIPTION
The default extension for voicemail
is 8500.
The default password for voicemail
is the password of the extension it is
associated with.
When the configuration wizard is
completed, you can change the
password of your voicemail to any
sequence of digits. You will find theoption VW passwordunder Usersin
the main menu.
/etc/asterisk/voicemail.conf/etc/asterisk/users.conf
When voicemail is activated in a
local extension the setting
hasvoicemailis set to yes.
By settings the voicemail we also
modified the way that extensions
are called. Instead of a normal
Dial(), Asterisk 1.4.x will call macro
the [macro-stdexten].
If not other value is specified the
default the Voicemail password is
the same that your account secret.
The vmsecret option allows you to
set a different password for your
voicemail.
In the example extension 3000 uses
the secret 3000 for authentication of
calls and the password 1234 to
reach the mailbox.
CONFIGURATION FILES
[3000]callwaiting = yescid_number = 3000context = numberplan-custom-1email =
fullname = 3000group =hasagent = yeshasdirectory = nohasiax = yeshasmanager = nohassip = yeshasvoicemail = yeshost = dynamicmailbox = 3000secret = 3000threewaycalling = yesvmsecret = 1234
zapchan =registeriax = yesregistersip = yescanreinvite = nonat = nodtmfmode = rfc2833disallow =allow =
19
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
22/31
6.1.6 Step 6: User extensions
STEP 6 USER EXTENSIONS (1/3)(Scenario 1, 2 and 3)
DESCRIPTION
In this step we will create the four local
user extensions. The extensions can be
associated to an IAX or SIP device such
as an ATA or VoIP Phone, or associated
to a analogue port available in the PBX.
/etc/asterisk/users.conf
Each of the new extensions will have
entry of the type [1000], [2000], [3000],
etc.
If the local extension is a SIP or IAX
device it will be indicated with the
values:
hassip = yeshasiax = yes
CONFIGURATION FILES
20
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
23/31
STEP 6 USER EXTENSIONS (2/3)(Scenario 2 and 3)
DESCRIPTION
In Scenario 2 and 3 we need to create
extension 4646, which needs to beavailable in both PBXs.
This extension is created to accept
incoming calls from the other PBX.
/etc/asterisk/users.conf
This extension is not visible to the
users and it is used for the purpose of
routing and authenticating calls between
the PBXs.
In Scenario 3 we are using IAX as the
protocol for interconnecting the PBXs.
IAX is more NAT friendly and efficient
in terms of bandwidth.
CONFIGURATION FILES
[4646]callwaiting = yescid_number = 4646context = numberplan-custom-1email =fullname = 4646group =hasagent = yeshasdirectory = nohasiax = yeshasmanager = nohassip = yeshasvoicemail = yeshost = dynamicmailbox = 4646secret = 4646threewaycalling = yesvmsecret =zapchan =registeriax = yesregistersip = yescanreinvite = nonat = no
dtmfmode = rfc2833disallow =allow =
21
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
24/31
STEP 6 USER EXTENSIONS (3/3)
(Scenario 3)
DESCRIPTION
In Scenario 3, we need to define
which local extension that should beassociated with the Analog Port #2
(the phone). In this example, we
have chosen Extension 1000 for that
task.
We define the association by editing
the existing User Extension for
Extension 1000 and select Analog
Port #2 as Analog Phone.
/etc/asterisk/users.conf
Although it might look surprising, it
is possible to have an extension
associated to more than one
communication technology.
In the example, extension 1000 is
reachable in the Analogue Port #2
andvia SIP and IAX.
hasiax = yeshassip = yeszapchan = 2
This allows us to have as many as
three devices associated to the same
extension number. The three
devices will ring simultaneously.
CONFIGURATION FILES
[1000]callwaiting = yescid_number = 1000context = numberplan-custom-1email =fullname = 1000group =hasagent = nohasdirectory = no
hasiax = yeshasmanager = nohassip = yeshasvoicemail = yeshost = dynamicmailbox = 1000secret = 1000threewaycalling = yeszapchan = 2registeriax = yesregistersip = yescanreinvite = nonat = no
dtmfmode = rfc2833
22
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
25/31
6.1.7 Step 7: Incoming calls rules
STEP 7 - INCOMING CALLS RULES(Scenario 3)
DESCRIPTION
In Scenario 3, we need to decide
what to do with the calls originated
in the PSTN.
In the example, we indicate that all
calls from the PSTN should be
forward to the local extension 1000.
/etc/asterisk/users.conf
/etc/asterisk/extensions.conf
Port #1 is a FXO port connected to
the PSTN (zapchan = 1).
Incoming calls fall in the context
DID_trunk_2.
In the dialplan, under the context
[DID_trunk_2] we see that by
default all calls (_X.,s) are forward
to extension 1000
Goto(default|1000|1)
CONFIGURATION FILES
[trunk_2]disallow =allow =callerid = asreceivedcontact =context = DID_trunk_2
dialformat =fromdomain =fromuser =group = 1hasexten = nohasiax = nohassip = nohost = dynamicinsecure =port =provider =registeriax =registersip =
secret =trunkname = Port 1trunkstyle = analogusername =zapchan = 1
[DID_trunk_2]include = defaultexten = _X.,1,Goto(default|1000|1)exten = s,1,Goto(default|1000|1)
23
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
26/31
6.1.8 Advanced options: Asterisk GUI
ADVANCED OPTIONS ASTERISK GUI
DESCRIPTION
After completing the seven steps you
can have a look to the AsteriskGUI
interface.
This interface allows to modify your
entries via the wizard and create
more advance services.
When you have made changes to the
configuration, do not forget to press
the button Active Changes, in order
apply the changes.
7. Configuration of ATAs
No matter which ATA or IP Phone you need to configure, you will find that they can beconfigured in a similar manner. This example shows the configuration process of a Linksys
PAP2 Internet Phone Adapter. The configuration is the same for a Sipura (SPA-3000).
IP settingsThe ATA needs to have an IP address in order to be able to communicate with other devices
on the LAN or the Internet. The IP address can be static or dynamic. In this example, we
have chosen to obtain an IP address through DHCP.
All IP settings of the ATA are configured using the handset.
1. Attach an analog phone to the ATA
2. Connect the ATA to the LAN where the DHCP is running
3. Enter the configuration menu of the ATA by pressing **** on the phone.
4. Enable DHCP by pressing 101# followed by 1.
5. Make sure that the ATA has obtained an IP address by pressing 110#.
Extension numberThe extension number of the ATA is configured through its web interface. Direct your browser
to http:///admin/advanced
Go to the tab Line 1, and fill in the following fields:
24
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
27/31
Proxy and RegistrationProxy: 192.168.46.135 (the IP address of the PBX you want to register)
Register: Yes
Subscriber InformationDisplay Name: 1000
User ID: 1000
Password: 1000Use Auth ID:yes
Auth ID: 1000
You can verify from the web based Asterisk Configuration Panel that the ATA is registered in
the PBX.
1. Go to Asterisk CLI in the left menu
2. On the bottom of the page (in the pink text field), writesip show peers
3. All registered phones and ATAs will be listed with IP address and extension number.
25
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
28/31
8. Quick Installation Guide
This section includes a 7-step quick installation guide for Scenario 1, 2 and 3. Please note that
the red crosses in the table indicate steps in the configuration procedure that are not needed
for that specific scenario.
8.1 Scenario 1
26
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
29/31
8.2 Scenario 2
27
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
30/31
8.3 Scenario 3
28
-
7/29/2019 IT46 en VoIP4D Laboratory Tutorial AsteriskNOW
31/31
9. Verify your results
This section includes a set of Checkpoints for each Scenario that you should be able to do
with your current VoIP setup. If you successfully manage all checkpoints listed for your
Scenario, your Asterisk based VoIP setup has been configured correctly.
9.1 Scenario 1
Checkpoint 1: Place local phone calls from one extension to another within the same PBX.
Checkpoint 2: Call a local extension and leave a voice messages (don't pick up the phone!).Use the voicemail to fetch the voice message you just left.
9.2 Scenario 2
Checkpoint 1: Place local phone calls from one extension to another within the same PBX.
Checkpoint 2: Place phone calls between the two PBX's by using the prefix 9 before theextension number.
Checkpoint 3: Call a local extension and leave a voice messages (don't pick up the phone!).Use the voicemail to fetch the voice message you just left.
9.3 Scenario 3
Checkpoint 1: Place local phone calls from one extension to another within the same PBX.Checkpoint 2: Place phone calls between the two PBX's by using the prefix 9 before theextension number.
Checkpoint 3: Call a local extension and leave a voice messages (don't pick up the phone!).Use the voicemail to fetch the voice message you just left.
Checkpoint 4: Call to the PSTN from any of the PBXs (try both).
Checkpoint 5: Call in to the PBX from the PSTN.