Elastix Without Tears
Elastix Without Tears
If you find this book helpful, a PayPal donation of $5 to $10 (US equiv) made to [email protected] would be
very highly appreciated. If you are in Australia and don’t have Paypal, you may forward a cheque made to:
Ben Sharif, PO Box 70 Kingswood NSW 2747, Australia.
by
Ben Sharif
(The same author who brought you Asterisk@Home without tears and Trixbox without tears)
mailto:[email protected]
This document is released under the Creative Commons By-Attrib Non-Commercial Share-Alike 2.1 licence.
This work is dedicated to my wife, who has been very patient with me, The Elastix Development
Team and Rob Thomas and his freePBX Team whose devotions to freePBX made it all possible.
My gratitude also goes to Bob Fryer of VOICEINTEGRITY who provided me with many valuable
materials for this document and hardware to play with.
*
Stay tuned for our next episode – Elastix version X
As always, this guide is not meant to be a detailed manual; instead it is just a quick and
dirty guide and as a resource to assist you get started with minimum pain. Use this
document only as a guide, not as a Gospel. It does not cover every detail and every
function found in Elastix and neither will it provide you with a complete solution or spiritual
guidance.
Only a competent VoIP consultant such as VoiceIntegrity can provide you with the
necessary know-how for a complete solution, and as for spiritual guidance, I will
leave that entirely to you.
This document was compiled mainly based on Australian condition (because Australia is
where I live in – those kind enough to fly me around the world are most welcomed send me an
air ticket) through my experience going through the pain and gain, supplemented by
inputs from dozens of participants in the various Elastix and Asterisk related forums.
These people are mentioned in the bibliography at the end of the document. They have
helped me whenever I get into difficulties, and I still seek guidance (the non-divine type)
from them.
I take no primary credit for this document (I am only the compiler of the not so divine
revelation). I invite others to participate in improving this document. Please send me your
feedbacks; so together we can make this document a valuable resource for our peers in
the Elastix community, experienced and new alike.
The usual disclaimer: (Don’t you just hate it, having to say this.)
In its Basic form, all that I have outlined worked for me but it may contain many
errors – typographical, omissions and even misguidance that may require a lot of
extra corrections. While I have taken due care, however, it may not necessarily be
100% accurate and suitable for your individual configuration. I do not take; neither
will I accept any responsibility for any losses incurred due to actions or inaction
conducted as a result of methods or advice found in this document.
I am not an expert and therefore I do not have most if not all the answers. I ask those
requiring assistance to post their questions in Elastixconnection, Whirlpool, Digium,
freePBX or Elastix Forum (forum participants may not answer any question if the
solution is already in this guide) where there are many knowledgeable Asterisk and
Linux savvy participants who will be able to assist.
Within this document, Elastix and Asterisk will be referred to frequently and they are
interchangeable as Elastix is in essence a superset of the Asterisk.
If you already have a spare computer to dedicate to this task, then the cost is almost
nothing unless you need to buy an audio headset ($15.00 from your local electronic
store) for the softphone. If you do not have a spare PC with the above specification,
then you may be able to buy one from your local swap meets for under $200.00,
which may include a monitor. Ensure that the PC has an Ethernet NIC for connecting
to your home network.
Your only other initial cost will be the $20.00 or so activation fee to Oztell (or other
VSP of your choice). In fact many VSPs, the like of Pennytel, Primus etc., will
register you for free if you want to restrict your calls to VoIP only within the same
VSPs. If you want the ability to make to PSTN or between different VSPs, you may
have to pay for the calls.
All these “Major Expenses” will be recovered when you receive your monthly
Telephony bills from your local Telcos.
VoIP transport via the Public Internet is very much dependant on a number of factors
– available bandwidth not withstanding, your usage habit of the internet and LAN
traffic and equipment quality, amongst others, also play very important roles.
http://forums.whirlpool.net.au/index.cfm?a=wiki&tag=VOIP_Quality
Elastix developers have written a Web Interface that allows you to access these
programs, so that they, in general, look like one complete product. Elastix have also
written certain software such as reporting programs, Hardware detection, Network
Configuration, Software Update Module, Backup Restore module, User Management and
many more modules themselves.
I will attempt to describe the set-up of each of these. In most cases it does not matter if
you are behind a firewall provided that you have all the appropriate ports forwarded
correctly. You are not required to do anything special like running the IP PBX outside the
NAT or in the DMZ. However, it is important to ensure that you have enough bandwidth
(upstream and downstream) to carry voice traffic.
Naturally if you are running Elastix in a heavy environment, you will need heavier duty
and better specification system.
If you are using Telstra Alcatel SpeedTouch 510/530 ADSL Router, you will need
to unbind port 5060. To do this, please refer to this link (or see Appendix D).
http://www.sipgate.co.uk/faq/index.php?aktion=artikel&type=faq&rubrik=024&id=398&lang=de
When you install Elastix on this “old” computer, it will take it over – it starts by
formatting all the hard disks (if you happen to have more than one), so make sure
there is nothing on the machine that you want to keep.
I.III.II Phones
You can buy SIP phones from Grandstream, SNOM, and Cisco etc. Or you can buy
an ATA (Analogue Telephone Adapter) produced by Linksys, Netcomm or Sipura and
a few others, which enables you to use an analogue phone (the Linksys PAP2 will
allow you to hang two analogue phones to it).
Register with a VSP such as Faktortel, Oztell, Pennytel and several other VOIP
Service Providers (VSPs). The choice is yours.
To get started, it is easiest to get a softphone and run it on another computer. See
the section on installation of Softphone later in this document.
You will need to pick a static IP address for your IP PBX that is on your home network
e.g. 192.168.0.100. To keep it simple, please ensure that the Asterisk box is in the
same network segment of your existing LAN.
Compare the requirements with what facility you already have. You may find that you
may need to provide extra facilities that you do not already have e.g. Network switches,
router, ATAs or IP Phones and needless to say a suitable broadband service.
For the purpose of this guide, I have determined that we will start with the following:
Once the above are set-up, I will customise it further with the following;
• Time conditions
• Ring groups
• Follow me
• Conference facility
• DISA etc
In this exercise we will cover all of the above (not necessarily in the stated sequence) and
we may also look at other possibilities as we go along, if time and/or resources permit.
Once you are clear on what you want, you can start the installation in earnest but before
that, here is a brief course on Elastix Network design.
One of the most common issues that appears on the forums, are issues that users are
having with Asterisk based distributions, which includes Elastix.
Elastix have done a great job of improving how this is setup on your system, but it still
needs some thought put into the process.
This chapter is by no means the “be all and end all” in Network theory, and in fact many
network aficionados would probably cringe with some terminology and explanations in
this chapter, but the purpose is for you to gain a basic understanding of what you are
typing in as it will and does have an impact on how your system behaves, and how
software interacts with your Elastix system.
First of all, when your Elastix box is finally built, it comes up on the network using a DHCP
Address. For 99% of users this will be true. You either have a Dedicated DHCP Server on
the Network or your Router is acting as a DHCP Server. What this means is that your
Elastix system is assigned a dynamic IP address on your Network, which will last about 7-
8 Days (normally). After that time period, it will request a new address. In most cases it is
allocated the same address, unless you have a busy network, where in some cases it
may allocate that address to another device.
So the first thing we need to do is to allocate and set a static IP address for your Elastix
System. But before we can do this, we need to understand how your Network is setup,
which includes your Domain Name Service (DNS) entries, the domain name of your
Elastix System, whether you are going to make your Elastix system available from the
Web (e.g. externally connected Phones).
Let’s ignore the Elastix system for the time being and assume that you have a basic
Network system. You have one or two Windows workstations connected to a router and
this router connects to the Internet. This router has probably allocated IP addresses to
the workstations, and it would be useful to obtain the information from one of these
workstations to allow us to correctly fill in the Elastix Network Details.
On one of the Windows workstations, click on the Green START button, and from the
Menu select RUN. Now in the box type the letters cmd and click on OK.
Write this information down, and let’s talk about each one and what impact it has when
you implement them on your Elastix System.
2.1 IP ADDRESS
Basically this address must be unique on your Network. If you put two devices on your
Network, that have the same IP address, you are bound to have issues, some of them
very hard to diagnose.
One thing to note is that DHCP does not, by default, know what static addresses that you
have issued, and it is possible, sometime in the future, that DHCP allocates the same
address as your static address to another device, causing untold issues.
For this reason, we need to understand what addresses your router is giving out. If you
have Web access to your router, you can look at the DHCP Server setup and find what
addresses that it allowed to give out (Usually called a Scope). Quite often, you will find
most routers by default are setup to provide either 50 to 90 addresses. On some routers,
you can set exact ranges, on others; it just allows you to select a number of addresses,
usually starting from the first available number in the range of IP addresses. If you don’t
have access to your router, then don’t panic.
As a general rule of thumb, we normally choose 100 as the IP address for the Elastix
System, as it normally avoids IP address clashes, and is a nice round number to
remember.
So based on the information that we gained from our IPCONFIG, we are going to set the
IP address of our Elastix System to 172.22.22.100 e.g. If your address of workstation is
192.168.1.2 then you would make Elastix 192.168.1.100
Note that the first three blocks of numbers, must match the same address scheme as our
workstation, otherwise (unless you know network design well), you will not be able to talk
to your Elastix box from your workstation.
Your system may be different and contain the addresses that have nothing to do with your
normal network address range such as 203.21.20.20 & 203.10.1.9. These are external
DNS Addresses and are normally supplied by your Internet ISP. Each ISP will have
different addresses for their DNS Servers. If you have a workstation or device using a
DHCP Address, then as part of that DHCP address, it passes these DNS Addresses
down from the router. The router gets these when it gets its IP address from the ISP.
Now here comes the important part, which forms good network design even for the small
network:
If you have an internal DNS Server (e.g. Microsoft Server) on your Network, then it should
be the first DNS entry. The reason for this is speed. If a program needs to communicate
with a device (even a phone), and especially if it is on the Internal Network, why should it
go outside of the Network to interrogate a DNS Server that is going to respond generally
50x slower.
If you don’t have a second DNS Server on the Internal Network, then set the second
address to the router. Many routers can act as a DNS Proxy, meaning that they forward
your DNS requests to the DNS Servers that they know about (remember the router
received the DNS Server information when it made a successful connection to the ISP).
Now for many of you, you wil not have a DNS server on your local Network, and your first
thought would be to use the ISP’s two DNS addresses. This will work, but it may still have
some issues.
As we are about to set some static addresses on your Elastix system, it means that we
are hard coding these addresses and 99% of the time, this will be fine, except when your
ISP decides to change their IP addresses of their DNS Server. In general they don’t
change that often, but for a period of time, there was one very prominent ISP that
changed their address several times over a period of several months.
They work on the 99% rule, that everyone is using DHCP addresses from their router,
and when they change the addresses of the DNS servers, then your router will get the
updates and naturally filter down to the rest of your Network. If you have the two DNS
addresses hard coded into your Elastix System, and your ISP changes the available DNS
Server addresses, all of a sudden, your Elastix System cannot find the outside world,
So the normal recommended solution for a small network with no internal DNS Server is
to set the first DNS Address to your router, and the second address to the Primary DNS
address of your ISP. In this case, you are actually improving the redundancy on your
Network as the Router interrogates two DNS Servers, and the Elastix System has one
more DNS Server to try if the first two do not respond. Furthermore, if the ISP changes
the DNS Server addresses, your router would know about these new addresses, keeping
your system still running well even though a DNS Server change has occurred.
You might also be thinking that all you need is the router address as it has access to two
DNS Servers, and you don’t need to add the ISP’s Primary DNS Server address. The
reason why we do this, is that many consumer based routers, are not the most reliable
devices, and it has been seen on many occasions, that the DNS proxy function fails (but
usually corrected by a reboot), even though the router is still connected to the Internet
and everything else seems to function. By using the ISP’s Primary DNS Server address, it
means that our Elastix System, can still interrogate a DNS Server, directly through the
router, even though the DNS proxy capability has failed.
So if we were using the IPCONFIG example above, we would set the DNS Entries in
Elastix to
If you are running a simple network, then you might be setup using
It might sound like a lot of trouble, but you are talking about a Phone system, which
should be reliable. Especially in a business, how hard is it to go to your manager and tell
him that the Phone system failed or suffered some issues because the ISP changed their
DNS Server address.
As we are already running a domain on our Lab Network, it shows up under IPCONFIG.
This allows us to use this domain name for Elastix.
If you are running a simple Network, you will probably see this entry as empty, so what it
means is that you can setup a new domain name for your Internal Network.
If we were to use the details as provided by IPCONFIG, then we would setup the Domain
Name as elastix.netintegrity.local matching the domain name structure already
employed on our network. Netintegrity.local is the domain name. The name before it is
whatever you wish to call your Elastix system.
If you have no DNS Structure, as mentioned you set your own up. An example might be
elastix.myhouse.local. You might be wondering, why the use of the word local instead of
.com or .net. Again this is just good practice. There is no root domain for .local and is
regularly used for domain names they are mainly used for Internet networks. Microsoft
Servers also use this structure for Internal Networks. Agreed, the world does not live by
Microsoft’s word, but this one is simple and has no real impact.
• Burn the ISO image that you have just downloaded to a blank CD.
• Ensure that your PC will boot from the CD. If necessary change the BIOS
settings to enabled this.
• **NOTE: This will erase all data on the hard drives of the PC.
If you have 2 drives, both may be blown away as well - beware.
• Boot your Elastix box with the CD in the CD Drive and press enter. After a few
seconds, the following screen will appear. You press F2 to see the various
options. However, it is not really necessary. Just press [Enter] to start the
installation
• After initial system detection, you will be asked to select the type of keyboard that
you will be using. Use your cursor keys to navigate the keyboard types and use
the Tab key to move the focus to the OK or Back option. Select the appropriate
keyboard. Selected us and move the focus to OK and hit [Enter]
• Use your cursor arrow keys to navigate to the appropriate time zone. In our case,
we will selected Australia/NSW. Use the TAB key to move the focus to OK and
hit [Enter] to accept (see cheat sheet to set NTP time manually).
• Next you will be asked to enter your root password (remember this password).
• From this point it will take about 30-45 minutes for the installation to be complete
and ready for the configuration stage.
• During this stage, you will see screens similar to the following. Linux and the
required files are being installed. All you do is, wait for it to finish.
• After Linux is loaded the CD will eject. Take the CD out and wait for the system to
reboot.
• When it reboots, you will be presented with the Elastix splash screen.
• After a moment, it will continue and you will see lots of lines of codes. This
process will take a while because it is building Asterisk.
• When Asterisk build is complete, it will reboot itself. Make sure that you remove
the CD from the CD Drive before the PC reboots itself.
• After going through its initial startup script, Elastix is ready for you to configuring
and make changes to the system default.
Once Elastix has been installed, you may log in to Elastix if you need to do any command
line tasks.
Log in to your new Elastix (user: root, password: The one you gave earlier)
You will be presented with the Elastix initial Admin web login screen as illustrated below.
The initial Username is admin and the default password is palosanto. You can change
this password later on using that User Management facility provided by Elastix.
To log in to Elastix Web GUI, use user: admin, password: palosanto unless you
have changed the user admin password, whereas the default user/password for
unembedded FreePBX is admin/admin.
Once logged in, the System Status screen will appear. This screen is the control centre.
As it stands, Elastix need to be configured before any of the facilities offered are operable
by users. In this guide, we will only be dealing with the basic essentials to get
Elastix working.
On the top of the screen, you will notice several tabs arranged by groups (the top most
tabs) followed by the sub tabs (the line of tabs underneath). Currently we are looking at
the System Info tab under the System group tab.
Under the system group tab are sub-tabs that allow us to conduct system type tasks such
as changing Network settings, detecting new hardware etc. The functions of the tabs are
self-explanatory.
Selecting the Network Tab will display the following screen where you should select the
network interface.
Click yes when the “Are you sure you want to apply changes” dialog box appears and you
are done.
Next we will go to the User Management Tab and change the default password for the
user Admin (the only user at the moment).
Click on the User Management tab and the following screen will appear.
Click on the admin link (see illustration above) to open up the admin user detail screen
below.
In the ensuing screen, enter the name of the admin and change the password followed by
a retype of the password in the appropriate fields. Since an extension number has not
been allocated as yet, simply leave the field blank.
When the following screen appears, click on the Detect New Hardware button. In 99% of
the time, your interface cards will be detected. This is the part I love most about Elastix.
In my case, my $15.00 X100P clone card was detected straight away.
#include zapata-auto.conf
#include zapata-channels.conf
#include zapata_additional.conf
(See Get Under The Bonnet to see how the config file can be edited).
Restart Asterisk
Once done, we are now ready to configure the PBX part of Elastix.
From here, those who are familiar with freePBX will have no difficulties in configuring the
PBX portion of Elastix. The choice to do the task using the embedded freePBX or the
unembedded version is totally on the users. The functionalities are similar either way.
Naturally not all the modules available for freePBX are available in the embedded version
but what were included were the ones that are considered essential.
To log in to the Unembedded freePBX, use user: admin, password: admin. Why we
need a login and password is beyond me.
All of the modules necessary to get Elastix operational are already pre-installed and ready
for the individual administrator to start setting-up. However there are other optional
modules that can be installed if necessary.
For this installation, we will simply use the standard default modules using embedded
freePBX.
When presented with the General Setting screen, for the moment, it is wise to leave the
default setting as provided except of a few of the fields that needs changing to suit local
conditions.
Allow Anonymous Inbound SIP Calls? Yes (if this is set you ‘No’, all inbound unidentified
SIP calls will not be accepted).
Apart from what I have indicated above, you may need customised it to your own specific
needs such as:
Generally the default values are sufficient to get you started. These values can be
changed later to suit your purposes. However the value I have as example above is
required to ensure that Elastix will function as expected – at the very least, during the
testing stages.
Naturally, help is available. Hovering your mouse on the corresponding field description
with a dotted underline (e.g. Asterisk Outbound Dial Command options) will display the
purpose of the fields and the various switches related to it.
Once done, click on the Submit Change button followed by the “Apply Configuration
Changes Here” red bar under the sub-tabs for the changes to take effect.
To overcome this, exit the General Setting screen and go to Extension screen, then click
on the aforesaid red bar (things do go wrong from time to time but that is life in the
software world).
The following are the dial command options available to you but for now, lets leave it
alone:
Options:
A(x) Play an announcement to the called party, using 'x' as the file
C Reset the CDR for this call
Allow the calling user to dial a 1 digit extension while waiting for
a call to be answered. Exit to that extension if it exists in the
d
current context, or the context defined in the EXITCONTEXT
variable, if it exists.
Send the specified DTMF strings *after* the called party has
answered, but before the call gets bridged. The 'called' DTMF
D([called][:calling])
string is sent to the called party, and the 'calling' DTMF string is
sent to the calling party. Both parameters can be used alone.
Force the callerid of the *calling* channel to be set as the
extension associated with the channel using a dialplan 'hint'. For
f
example, some PSTNs do not allow CallerID to be set to
anything other than the number assigned to the caller.
Proceed with dialplan execution at the current extension if the
g
destination channel hangs up
If the call is answered, transfer both parties to the specified
G(context^exten^pri) priority. Optionally, an extension, or extension and context may
be specified. Otherwise, the current extension is used.
h Allow the called party to hang up by sending the '*' DTMF digit.
H Allow the calling party to hang up by hitting the '*' DTMF digit.
Jump to priority n+101 if all of the requested channels were
i
busy.
Limit the call to 'x' ms. Play a warning when 'y' ms are left.
Repeat the warning every 'z' ms. The following special variables
can be used with this option:
• LIMIT_PLAYAUDIO_CALLER yes|no (default yes)
- Play sounds to the caller.
• LIMIT_PLAYAUDIO_CALLEE yes|no - Play
L(x[:y][:z])
sounds to the callee.
• LIMIT_TIMEOUT_FILE File to play when time is
up.
• LIMIT_CONNECT_FILE File to play when call
begins.
• LIMIT_WARNING_FILE File to play as warning if
There are a number of device types for the extensions. This we need to determine
prior to creating the extensions.
• Generic SIP Device : SIP is the Standard protocol for VoIP handsets and
ATA's.
• Generic IAX2 Device : IAX is 'Inter Asterisk Protocol', a newer protocol
supported by a few devices (eg, PA1688 based phones, and the IAXy ATA).
• Generic ZAP Device : ZAP is a hardware device connected to your Asterisk
machine eg, X100P TDM400, TE110P etc.
• Other (Custom) Device : Custom is a general term used for any non standard
device, such as H323. It can also be used for "mapping" an extension to an
external number (eg: to route extension 2010 to 1300151151, we can create a
custom extension 2010 and in the "dial" text box enter:
Local/1300151151@outbound-allroutes.
We need to create a few SIP extensions. Therefore you should select Generic SIP
Device from the device drop-down list then click “Submit”.
You will notice a few fields that you will need to populate. The important ones are:
• User Extension: 3000 (that’s the extension number I gave for reception)
Submit when done and don’t forget the red bar to apply the changes.
For simplicity, we will allocate passwords to be the same as the extension numbers.
Where Voicemail is enabled, we will allocate the same password as well (but you
don’t have to. You may also nominate an email address for Voicemail Email
Notification – it’s up to you). Voicemail will be covered in more detail a little later in
this document.
When creating a ZAP extension the following must be done otherwise you run the risk
of getting a one way audio only. This also affects any Fax machines attached to the
FXS ports; you will not receive faxes at all unless you do as below
As illustrated above, after having created your Zap Extension, go back in and remove
anything in echo training and submit
Now you should have audio both ways and faxing inbound and out should work
Note: Make sure if you are sending over SIP that the codec is ulaw or alaw or the fax
will fail with any compression codec like g729
It will be necessary to re-submit all extensions created this way from within
Elastix/freePBX to enabled freePBX to correctly register these extensions in
extensions_additional.conf, otherwise you may not be able to ring those
extensions.
As part of Elastix 1.0, the developers have added a new tool called Extensions Batch
This tool allows you to use a spreadsheet to setup all your extensions and users on a
spreadsheet, and then upload them to Elastix. This will then create all the extensions
in FreePBX.
To start and learn how to use this tool, it is recommended that you setup two
extensions in FreePBX as shown elsewhere in this guide. Set them up with all the
options that you would normally set in an extension.
Next, click on Extensions Batch, and click on the Download Extensions. This will
download a CSV file down to your local hard drive (you normally can choose where to
save it). You can now open/import it with your favourite spreadsheet.
You should see a spreadsheet with headings and hopefully the two extensions that
you have already setup like the following
Now you have a guide, you can setup the rest of the extensions on the spreadsheet.
Using the tools that are in your spreadsheet application, you can copy most of the
fields that are common for all users, and with the rest, do a select and drop, and in
the case of Excel (and probably others), as you drag and drop, it will increment the
numbers for you.
Once you are satisfied, that the content is correct, save the file back out as a CSV
file. You can call it whatever you like, maybe extensions_companyname.csv or
extensions_15042008.csv. Just make sure that when you save it, that your
spreadsheet program is selected to save it as a CSV Text file (.CSV).
Now we need to upload you completed CSV file back to Elastix, so click on the
browse button, and the following dialog box will appear
As you can see, it has filled in the file name and directory in the input box. Now click
on Save.
That’s it!!! Now go into Freepbx and check that your extensions are there, which they
should be.
On a 20 user system, your time to implement extensions, can come down from 30-40
minutes, to around 5-10 minutes, and the more extensions, the more time you will
save
Combined with the Endpoint Manager, this tool can literally save you hours in larger
system setups.
In this case let us enable voicemail on extension 3001 (the Manager’s extension).
Go back to the Extension Option of Elastix and click on extension 3001. In the
Device Option’s Mailbox field, change the 3001@device to read 3001@default.
Scroll down to the Voicemail and directory section and do the following:
Click submit when done followed by the red bar on top of the screen.
Select the extensions that you want to define (the extension selection is on the right of the
screen). In this case, we will pick the Medical Centre Manager’s extension – ‘Manager
<3001> add’
• Ring strategy: ringallv2 (to call the main numbers then the other numbers)
• Extension List: 2001 (Manager’s extension) followed by Administration’s Office
and the Reception (The reception will take down messages for the Manager).
• Ring time: 20 seconds
• Destination if no answer: Core – Hangup
Every time the Manager’s extension is called, Asterisk will try to connect to extension
3001 and if no answer, it will call Ext. 3005 and 3000 (Reception). If still no answer, it will
simply hang up. During business hours, the reception or the Admin Office will take down
messages for the manager or the Doctors.
Click “submit” followed by clicking the red bar on top of the screen to finalise this
selection.
You may not want a ring group – it’s entirely up to you. If you don’t require a ring group, you
may ignore this section.
When there is an incoming call to the ring group, the phones nominated in the selected
group will ring. You may select different ring group for each of the incoming trunk or you
may nominate the same group for all the trunks, in which case you will only need to define
only one ring group.
For simplicity, we will only defined 1 ring group for all incoming calls from all trunks – at
this stage, let’s not get too fancy.
We will create a ring group 11 for this purpose. Let’s call it AdminGroup as it rings all the
phones related to the Administration of the Medical Centre. A single digit ring group is not
recommended.
We have included the Manager’s Mobile Phone number in as the last one in the group. If
no one answers the call, Asterisk will simply hang up. Since the last number in the group
is the Manager’s mobile phone, generally, the Mobile phone voicemail will take the
message if the phone is not answered.
http://www.counterpath.com/xlitedownload.html
After installing the softphone (assuming that users can install the softphone), we need to
configure the sofphone.
When you start X-Lite 3 for the first time, you will see the following screen.
For this purpose, that’s all you need to do and Click apply, OK and close at the next
screen. You are now ready to use the X-Lite softphone.
Those using X-Lite having this problem may have to make the following correction in the
advance setting of X-Lite.
In X-lite:
To configure the softphone, click on the hammer icon and you will see the following.
Profile Tab
• Click on the Tuning Wizard to tune your audio input and output.
• Check Auto Send Video (if you are using Video). I checked it anyway.
• Check Auto Receive Video (if you are using Video). I checked it anyway.
Click OK
Network Tab
Click OK
STUN Tab
In my case, I do not use STUN and therefore I left that section blank and Enable STUN
check box un-ticked.
Click OK to close.
You might want to set-up a couple of PCs with the softphone after which you may start
testing your brand new Phone System by dialling each extension in turn.
If you use one of the softphone and dial 7777, Asterisk will simulate an incoming call.
If everything has been done as explained above, we should be able to make and receive
calls between our internal extensions. If not, it is time to re-inspect what we have done
above and make the necessary correction before attempting to go any further.
Let’s take a break and test the soft phone extensions by making calls to each extension
that we have created.
It assumes that the phone is set as default (e.g. in the state it was when removed from
the box).
Before you use the Endpoint Manager, you should have setup your Extensions in
Freepbx, as it will provide these as a dropdown box so that you can assign each
Extension to a phone.
Under the PBX tab in Elastix, click on Endpoint Configuration and the following screen will
appear.
You will notice the input box beside the ENDPOINT SCAN button. Here we will enter, the
address of our network, however, it differs slightly from what we may have entered into
Elastix. The reason for this is that the subnet mask uses a different method of describing
it.
If you are running a simple network, you probably have a subnet mask set as
255.255.255.0. This can also be written as /24. For most network technicians, this is
common knowledge, and also know how the similar numbers for other subnets and again
it requires a subject on its own, so for the time being accept that 255.255.255.0 equals
/24
The reason for the change is that Elastix makes use of a product called NMAP which
performs a search on your Network, and with the Elastix implementation, it requires the
subnet to be entered in the /24 format.
One other item, if you are not aware off, is that if we are specifying the whole subnet, we
use a zero (0) at the end of the ip address, e.g. your Elastix Server might be
192.168.1.100, and your address for the entire subnet would be 192.168.1.0.
So, having explained that, we have an Elastix Server at 172.22.22.100, and our subnet is
255.255.255.0, so the information we would add to that box is 172.22.22.0/24.
Once you have entered that, press SCAN and if successful, and you have some
compatible phones, you should see the following screen.
If done correctly, you should end up with something similar to above. Once you are happy
with the settings click on all the boxes underneath the SET button and click on the SET
Button.
On occasions we have found it necessary to reboot the phones afterwards, but it appears
to depend on the state of the phone before the Endpoint Discovery.
If you get another phone, then just run the Endpoint Scan again, and it should show the
new phone. Make the changes to the phone type, and extension and click only the box
relating to that phone and press SET. As simple as that…
To be able to do these, you will need at least one trunk to the outside world.
This is a simplified guide to give the budding Elastix users some understanding in setting
up Trunks.
The various patterns you can enter are similar to Asterisk's definition of them:
If you have paid for VOIP service to enabled you to make calls out through PSTN, you
can use this as a trunk for that purpose otherwise, you can only use it for making calls
using VOIP between subscribers of the VSP only (unless there are peering arrangements
with other VSPs).
You can have several trunks if you want to. You can have Telstra and/or Optus
telephone lines and use them as trunks, and you can also have a few VSPs that you
subscribed to as additional trunks.
To make external, PSTN or VOIP calls; you must have at least one trunk.
• Trunk (a) charges the best rate for Local calls but is expensive for Mobile calls and not so
great for international calls.
• Trunk (b) has great rate for international call.
• Trunk (c) has good mobile rate and will allow 1300 numbers while the other 2 do not.
A properly planned route will direct the phone calls you make to the appropriate trunk that
will provide you with maximum effectiveness and savings.
E.g. When you make a call to a Mobile phone, asterisk will route your call via trunk (c)
while it will route your call to trunk (a) if you make a local call. Similarly, when you make
an international call, asterisk will route your outbound call via trunk (b).
Each of these two works in conjunction with each other – they compliment each other
when an outgoing call is being made.
Since your VOIP provider does not discriminate where you are calling from or where
you are calling to, it requires a universal type number to call so your call can be
directed to the correct recipient.
In most cases, the VOIP provider will need to dial the universal e164 format e.g.
61291234567 for Sydney or 61391234567 for Melbourne. (61 being the code for
Australia, 2 or 3 being the code for Sydney or Melbourne respectively, followed by
the telephone number of your friend which is 91234567).
Since you are dialling 03 91234567, asterisk only need to send 391234567 (without
the 0 prefix). Therefore in your Outbound Route Dial Pattern (lets call this Outgoing
Route Domestic) you will need the following pattern:
0|NXXXXXXXX
That pattern tells Asterisk to send only 9 digits out of 10 dialled by not sending the
first digit 0. Thus, if you dialled 0291234567, the number that will be sent to the
Trunk will be 291234567.
How will this then be translated to 61291234567? This is where the Trunk Outgoing
Dial Rule comes in.
Using the above example, assuming that the VOIP service provider requires the full
e164 format, Asterisk will need to add the missing Australian code 61.
61+NXXXXXXXX
That pattern tells Asterisk to add 61 in front of the 291234567 before dialling the
number via the trunk. For variations of patterns, see What is a Dial Pattern in the
previous chapter earlier on in this document.
For this example, let’s create 2 SIP trunks; Pennytel and Oztell.
Since we are creating SIP trunks, click on the Add SIP Trunk option as illustrated below.
Outbound Caller ID: “Insert Your Name” <Your Number> (Must include the “ “ and <>)
In this example we will create a Pennytel and Oztell SIP Trunks, which we will call
pennytel and oztell respectively. We will also define their dialling patterns.
We will require the following Outgoing Dialling Rules for this trunk, which instruct the
trunk to dial whatever is sent by the appropriate route. This example is for dialling
Malaysia with a country code of 60, and Australian Mobile phones.
Pattern Explanation
This pattern tells Pennytel to dial all Malaysian Mobile numbers starts
601XXXXXXXX
with 601 followed by 8 more digits.
This pattern dials numbers start with 60 followed by a one-digit
60NXXXXXXX
number in the range of 2-9 followed by 7 more digits.
For dialling Australian Mobile phone. The 61 is the Australian Country
61+4XXXXXXXX
code that will be added to the mobile phone number.
601XXXXXXXX
In your Outgoing Dial Rules box, we will enter the
60NXXXXXXX
following;
61+4XXXXXXXX
Next we need to create the Outgoing Setting, Incoming Settings and Registration for
Pennytel.
Outgoing Settings
In the Trunk Name field we will enter the name of this trunk: pennytel
allow=alaw&ulaw&gsm
canredirect=no
canreinvite=no
In the Peer Details enter the following; disallow=all
Pennytel preferred codecs are: g729, gsm host=sip.pennytel.com
and g723 but g729 and g723 are not installed insecure=very
as default in ELASTIX secret= Password
type=peer
username=8880XXXX
Incoming Settings
In the User Context, enter the Pennytel User ID: 888XXXXX
canreinvite=no
In the User Details we will have the following: context=from-trunk
fromuser=888XXXXX
qualify=no
secret= Password
type=user
username=888XXXXX
Registration
In the registration field, enter the following:
888XXXXX:[email protected]/888XXXXX
After all these have been done, click on the Submit Changes button and click on the
red bar across the top of the screen.
useragent = Elastix
language=au
videosupport=yes
allow=g729
allow=g723
allow=h261
allow=h263
allow=h263p
useragent = Elastix
Pattern Explanation
899060X. This pattern tells Oztell to dial the inter Oztell’s numbers
This pattern dials numbers start with 60 followed by a one digit
number 1-9 followed by other numbers minimum of 2 digits from 0 -
60ZXX.
9. This can be an international number with a Country code of 60
followed by a number between 1 and 9 inclusive.
06612+NXXXXXXX Using the Oztell 06 rate to dial any NSW number.
0661+NXXXXXXXX Using Oztell 06 rate to dial any Australian number.
61+1300XXXXXX Dials 1300 numbers
61+13ZXXX Dials 13 numbers
61+1800XXXXXX Dials 1800 numbers
899060X.
In your Outgoing Dial Rules box, it will look like this: 60ZXX.
– this is simply an example based on my setting; 06612+NXXXXXXX
0661+NXXXXXXXX
yours will no doubt be different. 61+1300XXXXXX
61+13ZXXX
61+1800XXXXXX
Next we need to create the Outgoing Setting, Incoming Settings and Registration for
Oztell.
allow=ulaw&alaw
In the Peer Details we will need the canredirect=no
following; disallow=all
dtmfmode=rfc2833
fromuser=899060xxxxx
You must enable all the codecs that you want to host= sip2.syd.net2max.com
use through Oztell’s web page. insecure=very
secret=Password
type=peer
username=899060XXXXX
Incoming Settings
In the User Context, enter the Oztell User ID: 899060XXXXX
canreinvite=no
In the User Details enter the following: context=from-trunk
fromuser=899060XXXXX
insecure=very
qualify=no
secret=Password
type=user
username=899060XXXXX
Registration
In the registration field, enter the following:
899060XXXXX:[email protected]/899060XXXXX
After all have been done, click on the Submit Changes button and click on the red
bar across the top of the screen.
Note* Don’t forget to Forward UDP Port 4569 to your Asterisk IP address and edit your
iax.conf file.
Outgoing Settings
In the Trunk Name, enter the name of this trunk: oztelliax (as an example)
allow=ulaw&alaw
In the Peer Details we will need the disallow=all
following; host=iax2.syd.net2max.com
qualify=yes
secret=Password
Note: You must enable all the codecs that you type=peer
want to use through Oztell’s web page. username=899060XXXXX
Incoming Settings
In the User Context, enter the Oztell User ID: 899060XXXXX
context=from-trunk
In the User Details enter the following: secret=Password
type=user
899060XXXXX:[email protected]
After all have been done, click on the Submit Changes button and click on the red
bar across the top of the screen.
The SIP Trunks screen in freePBX will look like the following illustration below:
I already have a few trunks setup so please ignore all the other trunks in the
illustration.
Now that you know what the trunk will do, you may proceed to the next chapters to
create the Inbound and outbound routes.
This time when you chose to create a trunk, you will select ZAP trunk.
Maximum Channels: 1
Dial Rules: XX.
ZIP Identifier (Trunk name): 1 (replace the default g0 with 1, or 2 if it is the second
channel)
Click Submit changes followed by the confirm bar on top and you are done.
When an incoming call from PSTN or VoIP trunk is received, asterisk needs to know
where to direct it. It can be directed to a ring group, an extension, Digital Receptionist
(IVR) or Queue. For this purpose, Inbound Route needs to be set up.
Select the Inbound Routes selection in the left bar of the screen.
Initially, (since we have not created an IVR yet) we will set all incoming calls to be
directed to Ring Group 600 as illustrated below (later on in this guide we will create a
digital receptionist for this purpose and we will redirect all the incoming calls to the IVR).
As a matter of fact, this can be the only Inbound Route that you will need if
you deploy IVR (to be discussed later on). Besides, without this inbound
route created, your 7777 simulated calls will not work.
If you are using freePBX v2.4, you will not have the Zaptel Channel (see arrow in the
above illustration). To handle calls coming in through the ZAP channel you will have to
do define the DID of the channel through the ZAP Channel DID option in freePBX as
described in 9.1.1 below.
For our purpose, only put in the following data. The rest are optional.
However, at least one Inbound Route must be created for Elastix to answer incoming
calls. This includes calls from PSTN trunk as well. The route that we have created above
is precisely for this purpose.
This route will handle the calls that come in without Trunk ID and calls from trunks that do
not have an Inbound Route created (which includes all calls from PSTN and incorrectly
created incoming route). We call this a “Catch-All” route, an Inbound Route with the DID
Number and Calling ID Number fields left blank.
As usual, you will need to click on the red bar on top of the screen after each time you
submit a new Inbound Route.
The DID that you have defined is the DID number you should use in the DID number
field when defining your inbound route.
You may create several time conditions and give each of the time condition a Short Name
to identify it. These time conditions can then be assigned to each individual Inbound
Route if you choose to do so or they can be nested.
Once the above is done, go to Inbound Route, select the appropriate inbound route
and under Set Destination, select Time Condition DayNight, submit and click the red
bar on top of the screen.
4. Once the above is done, go to Inbound Route, select the appropriate inbound
route and under Set Destination, select Time Condition OfficeMorning, submit
and click the red bar on top of the screen.
What the inbound route will do is, as soon as an incoming call is accepted, it will be
forwarded to the OfficeMorning time condition.
If the time condition is met, it will then be forwarded to the IVR. On the other hand, if
it does not match, it will be forwarded to time condition OfficeAfternoon.
If it matches the OfficeAfternoon time condition, the call will be forwarded to IVR, if
not, it will be forwarded to the voicemail box that you have determined.
Following the above example, time conditions can be nested to multiple levels deep
allowing you to manage your time condition and make them as complex or as simple as
the situation demands – imagination is the only restricting factor.
To make an external call (except inter extension calls), you will need at least
one trunk and one route.
• International
• Domestic
• MobileAust
• OztellOnly
The International Route will be used for all international phone calls.
The Domestic Route will take care of the Australian phone and mobile.
The other two will do as the names suggest.
To create a new route using Elastix, select PBX tab and then select the Outbound
Routes option from the vertical menu on the left.
Click on the Add Route in the menu on the right of the screen.
Pattern Explanation
Most of our International calls are to Malaysia, I have defined the
0011|60NXX.
Malaysian PSTN pattern here.
This pattern dials all international numbers by prefixing it with 0011
and any digit between 7 and nine inclusive. Before the number is
0011|[7-9]XX.
sent to the trunk the 0011 will be stripped. If required by the trunk,
the trunk will insert the 0011.
This is the catchall international dialling including International Mobile
0011|NXX.
(excluding USA which is a 1).
In your Dial Patterns box, you will see something like this.
Dial Patterns
0011|60NXX.
0011|[7-9]XX.
0011|NXX.
You will then need to pick the Trunk Sequence. In this case we will use Pennytel as
the trunk for this route and if it fails, we will use Oztell as a second choice/backup.
Trunk Sequence
0 Pennytel
1 Oztell
Any number dialled with the 0011 prefix will be routed through the Astratel trunk and
should it fail, it will be routed to Pennytel.
9.3.4 Domestic
You need the following pattern to match the Australian Telephone numbers and the
Australian Mobile numbers.
Pattern Explanation
You will dial Australian telephone number as normal using
03, 02 prefix but the route will strip the leading 0 before it is
0|[23478]XXXXXXXX
sent to the trunk.
If the trunk requires the 0, the trunk will insert it.
If you dial local number and not use the STD prefix, it will
send to the trunk as is and the trunk will insert the 02 if
[2-9]XXXXXXX
required (this is a NSW pattern. If you are in Victoria you
will need to modify the trunk).
This is the catchall dialling for numbers that does not start
ZXX.
with a 0 such as 1300, 1800, 13 etc.
In your Dial Patterns box, you will see something like this.
Dial Patterns
0|[2378]XXXXXXXX
[4689]XXXXXXX
ZXX.
You will then need to pick the Trunk Sequence. In this case we need Oztell as the
trunk for this route and if it fails, we want Pennytel to take over as a second
choice/backup.
Trunk Sequence
All numbers dialled matching the above pattern will be routed through Oztell and if it
failed, it will be routed via Pennytel.
9.3.5 MobileAust
There is only a single pattern for calling Australian mobile – illustrated below.
Dial Patterns
0|4XXXXXXXX
We want all my domestic mobile calls to be routed via Pennytel and we have not
nominated a second trunk. If it fails then we will not be able to make a Mobile call, as
we don’t have a second trunk nominated.
Trunk Sequence
0 Pennytel
9.3.6 Oztellonly
The following pattern is in the Oztellonly route. We will use Oztell for a number of call
types therefore some explanation may be in order.
Pattern Explanation
This pattern will allow me to dial a Malaysian Mobile number. The
0011|601XX. 0011 will be stripped before the number is sent to Oztell. Oztell
does not require the 0011. It only requires the Country code.
You will dial Australian telephone number as normal using 03, 02
prefix but the route will strip the leading 0 before it is sent to the
0|[378]NXXXXXXX
trunk.
If the trunk requires the 0, the trunk will insert it.
1[38]XX. This is for dialling 1300, 1800 and 13 numbers.
899060XX. For dialling Oztell inter Oztell users
NXXXXXXX Catchall for dialling a local number that doesn’t start with 1
In the dial pattern box you will see something like the illustration below.
Dial Patterns
0011|601XX.
0|[378]NXXXXXXX
1[38]XX.
NXXXXXXX
Since the above pattern is for Oztell only, in my trunk sequence, Oztell was chosen to
be the only trunk for any of these calls.
Trunk Sequence
0 Oztell
I will not enter into any elaborate explanation how enum works, as there are already a
number of articles describing this. In essence, your phone number and server information
are stored in a special DNS zone (very similar to a reverse lookup zone). When an
ENUM enabled Asterisk user calls your phone number, it will first attempt to find your
phone number in the ENUM DNS zone. If it finds your phone number it will use the
information to setup a call directly between his Asterisk server and yours, resorting to
PSTN only if your number is not found.
Note: ENUM only works between ENUM enabled Asterisk (or other ENUM enabled VOIP)
users.
Custom Contexts creates contexts that can be used to allow limited access to dial-plan
applications.
Features:
Reference
http://aussievoip.com.au/wiki/freePBX-CustomContexts
http://www.elastix.org/index.php?option=com_openwiki&Itemid=27&id=installation#first_time_access_to_the_web_interface
By now we should be able to navigate ourselves through the freePBX menu. To get to
the system recordings, select the PBX Configuration tab and pick System Recordings
as per the illustration below.
There are two methods that you can capture your recording:
You will be making your recording using the telephone on this extension (or the
microphone of the softphone).
Click Go.
Follow the prompt on the screen and dial *77 on your phone to do your recording now.
Verify the recording by dialling *99. Go to step 1 again if you are not happy with the
recording. Keep doing this till you are satisfied.
Once you are happy with the recording, give the recording a descriptive name e.g.
“MainMenu” so you will know what the recording is for.
Click Save.
Follow the prompt for the upload and once again when the upload is completed, give the
file a descriptive name for you to know what that recording is for.
The above recorded files either recorded manually or uploaded using the system
recording facility will be stored in the /var/lib/asterisk/sounds/custom directory.
Click on the Add IVR option on the top right on the screen (see arrow) and the new
Unnamed IVR configuration screen will be presented to you.
Name (Change Name): MainOffice (that’s what we shall called the main menu)
Timeout: 10 (leave it at default)
Enable Directory: Tick
Directory Context: Leave it at Default
Enable Direct Dial: Tick
Announcement: MainOfficeMenu (That’s what we called the IVR recording that was made for
this purpose)
If you need more choice options in the IVR, click on the Increase Options button at the
bottom of the screen.
For number 1 - 7, we select Extension, and for 8, which we have changed to the letter “t”,
we also selected Extension.
The last extension (which we have changed to the letter “t”) is to capture timeout, if the
caller does not press any option or, in case the DTMF tone does not register, the call will
be sent to the receptionist.
Once finished, click Save and also click on the Apply Configuration Changes on the
top of the screen.
Test it by dialling 7777, (Asterisk will simulate an incoming call) and you will hear your
Digital receptionist in action.
Elastix allows multi languages IVR handling by simply telling Elastix what language to
use. Naturally you will need to install all the language sets that you wish to use.
See Installing Other Languages in the chapter referring to Customised Voice in later part
of this document.
I am assuming that you already have your MainMenu IVR in English set up for selecting
various options. This IVR is known as IVR-2 in your extension_additional.conf file. Any
subsequent IVR created will be IVR-3, IVR-4 and so on.
You will need to create another IVR for selecting the language options that you want to
present to the callers. This will be the IVR that will greet all callers with Select 1 for
English, 2 for Italian etc. In this example, we will have 2 language sets, Australian and
Spanish. Let us name this second IVR LanguageChoice.
Being the second IVR you have created, this IVR will be known as IVR-3 in your
extension_additional.conf file. Any subsequent IVR created will be IVR-4 and so on.
In choice 1, select the Custom App: radio button and enter the following in the box:
In choice 2, select the Custom App: radio button and enter the following in the box:
The third choice, instead of a number, you will enter the letter “t” in the option box, select
Custom App: radio button and enter the following:
You will also need to create another IVR called MainMenu_ES with options to be
presented in Spanish. This is similar to your main IVR except that it is presented to the
caller in Spanish. This IVR being the third that you have created will be referred to as
IVR-4 in the extensions_additional.conf file.
Next, you will need to do a little editing of the extensions_custom.conf file. You need to
add the following towards the end of your extensions_custom.conf.
[custom-language_au]
exten => s,1,Set(LANGUAGE()=au)
exten => s,n,Playback(vm-dialout)
exten => s,n,Goto(ivr-2,s,begin)
[custom-language_es]
exten => s,1,Set(LANGUAGE()=it)
Save it and re-read the configuration change and you are done.
Now you will need to change your inbound route to point to the LanguageChoice IVR.
All calls will then be greeted by the LanguageChoice IVR and when the caller select 1 (or
2), the IVR will call the appropriate exten. If the caller selected 1, the [custom-
language_au] will be selected and the language will be set to Australian English, an
announcement in the appropriate language will be made and the caller will be sent to the
MainMenu (or MainMenu_IT) for call options (you must also have recorded the call
options announcement in the various languages).
To take the multi-language IVR one step further, we can also have multi-language (or
multi category) MOH to compliment the language.
If the language used is Spanish, it is safe to assume that the caller is Spanish
speaking and would much prefer to listen to Spanish music instead of Chinese or
Arabic music.
To do this you will need to have the appropriate MOH music in Elastix.
Assuming that you already have the default music category that comes with Asterisk,
you will need to create a new music category using freePBX On Hold Music option.
Let us call this new category SpanishTune.
See the chapter relating to MOH in the later chapter of this document.
Once you have created this category, upload a few MP3 Spanish music/Tunes to it.
If you want the tune to be randomised, click the Enable Random button and you are
set to go.
[custom-language_au]
exten => s,1,Set(LANGUAGE()=au)
exten => s,n, SetMusicOnHold(default)
exten => s,n,Playback(vm-dialout)
exten => s,n,Goto(ivr-2,s,begin)
[custom-language_it]
exten => s,1,Set(LANGUAGE()=it)
exten => s,n, SetMusicOnHold(SpanishTune)
exten => s,n,Playback(vm-dialout)
exten => s,n,Goto(ivr-4,s,begin)
Now you will have multi language IVR as well as the complimentary MOH.
While freePBX is a very versatile GUI front-end for Elastix it does not have the facility to
configure a PBX for multi-Tenants application. However, Elastix (Asterisk) has the ability
to do it with a little creative manipulation.
In the chapter above we covered multi languages IVR handling by simply telling Elastix
what language to use. We are going to use the same principal to handle the Multi-
Tenants requirement.
In this example, I will use a Medical Centre in Malaysia, that I have the privilege of
installing the Asterisk PABX for. There are 3 tenants involved – a General Practitioner, a
Dental Practitioner and a Pathology representative. Each has separate incoming
telephone numbers with their own receptionist but using a common PABX.
I have picked this organisation as an example because it is small enough to write about.
If I choose one of my bigger installations, this book will never see the light of day ☺
• Calls that come in through the different tenants should be directed to the
appropriate IVR. One IVR for each tenant.
• 12 extensions - 4 for Dental Practitioner, 3 for Radiologist and 5 for General
Practitioners.
• Voicemail for each receptionist.
There are other requirements such as multi language prompts, after-hours ring groups,
time conditions, Interlinking 2 Elastix boxes between the Medical Centre and the
Pathology Main Office in Kuala Lumpur etc., but I have only listed the major requirements.
In this example I will only highlight the Multi-Tenants incoming route handling and
restricting outgoing calls to the appropriate telephone lines only.
My first task was to install the base Elastix as per the chapter on Installation. In this
installation, there is no VOIP trunk involved. All telephone communications are through
PSTN lines apart from the Elastix inter-connect between the Medical Centre and the
Pathology Main Office in Kuala Lumpur, which will be done via a DSL connection.
PSTN Interface
2 x TDM400 were installed in the PC designated for the PBX
IVR Prompts
3 x IVR were created, one for each of the different tenant.
Each IVR will act as a traffic cop to direct calls to the appropriate extensions belonging to
each tenant.
Extensions
• [from-Internal-medical]
• [from-internal-dental]
• [from-internal-pathology]
You also install the Custom Context Module and use this module to do this. Actually it
is much simpler using the custom context module.
All of the basic set up requirements above are explained in the various chapters of this
book and should not present any difficulty to complete.
Once the basic is completed, the rest of the variations and extras can be handled as per
the individual requirement.
First you must ensure that asterisk is well and running or you may not be able to make or
receive any call.
Click on the PBX Tab then click on the Unembedded freePBX option as shown in the
illustration below.
.
The freePBX system status screen will be displayed.
The server status should all display OK and green as illustrated above.
If any of the four services aren’t running, chances are something is wrong and your
Elastix will not be working correctly or not working at all. A probable cause can be wrong
configuration of your zaptel drivers. If you don’t have a zaptel devise, you should try to
disable the related .conf files.
Ensure that the minimum requirements have been met. If the minimum requirements and
the right type of hardware requirements have been met, and yet it is still not working, then
maybe its time to start the installation again.
Next, while on the freePBX screen, Tools Asterisk info Full Report.
If all trunks are registered, you can be almost certain that at the very least, your Elastix
installation is working (although not necessarily that you can make or receive calls).
In the majority of cases, if you have done everything as described in the preceding
chapters, the chances of your installation working are pretty good. However there are
always times when you think that the weather is going to be fine and yet you are pelted by
a thunderstorm.
If you are not able to make or receive calls, the most common causes are Trunk
Registrations, the choice of Codec, Routings, and Dialling rules errors.
Routings and Dialling rules are something that needs to be thought out logically with no
simple way of determining, as different people has different requirements and different
VSP have different dialling rules.
Generally there are 2 ways of doing this – using an ATA or using interface cards such as
the OpenVox A100P and the A400P (there are other cards out there). If you are using
the interface card, it has to be physically installed in the PC.
In the following screen, click on Detect New Hardware. Elastix will then detect the
hardware installed.
To remedy this, you have to add the following lines at the end of zapata.conf:
#include zapata-channels.conf
#include zapata_additional.conf
You may also need to edit another file /usr/sbin genzaptelconf and add the following
line in to overcome the ZAP channel handling difficulties that many people are
experiencing.
This card allows you to connect a POTS (plain Old Telephone System) line to your
Asterisk box.
1. Enter the phone number for you pots line in the Caller ID field
Once the card is configured, you must add a route for Incoming Calls or asterisk will not
answer this line
Click on Incoming Calls in freePBX and set up an incoming route. To make outbound
calls you will need to set an outbound route as well.
You may need to edit the following files zapata.conf, zapata-channels.conf, zaptel.conf
and modprobe.conf. The last 2 files live in the /etc directory – use a text editor (I use
nano) to edit them.
14.3.1 zapata.conf
Under [channels] change the following lines to reflect the following values:
[channels]
context=from-zaptel < --- changed from context = from-pstn
busydetect=yes
busycount=6
; This is to ensure that the line is hung up if there is no answer or busy after 6 busy tones)
At the bottom of this file ensure that the following 2 lines exist if not add the following
(otherwise your ZAP will not work):
#include zapata-channels.conf
#include zapata_additional.conf
For my A100P (for A400P or TDM400, you may have other values that will work well
for your installation) installation to function correctly, I have also changed the
following setting to obtain a good compromise on volume/echoing:
rxgain=4 (you may have to experiment with this setting for both A100P and A400P)
txgain=2 (you may have to experiment with this setting for both A100P and A400P)
Check it for each channel. Leave the rest of the file as it is.
14.3.3 zaptel.conf
Change the loadzone and defaultzone to “au” (if you are in Australia. Other countries
have different identifiers)
# Global data
loadzone = au
defaultzone = au
14.4.1 zapata-channels.conf
Next, using config edit, look in the zapata-channels.conf file and you will see a list of
all your channels in your TDM400P. Set up the trunks as trunks and the extensions
as extensions in freePBX.
For your information only, when you open the file, it will look something like the
illustration below.
If in the illustration it shows channel 1 is your Zap extension then add a zap extension
for channel 1 in Elastix or freePBX and if it shows your Zap trunk is channel 2 you
should create a zap trunk for channel 2 in Elastix or freePBX.
Once this is done, reboot your PC and when Asterisk starts, use the GUI to add a
route for incoming calls or asterisk will not answer your trunk. Similarly, to make
outbound calls you will need an outbound route. Set them up as per setting up routes
in the earlier chapters of this document.
If you have this card installed, you may need to edit the following files: zapata.conf
and zaptel.conf as per the A100P card in the previous section.
14.4.2 modprobe.conf
You may need to edit the modprobe.conf to add the necessary option for usage in
Australia (don’t bother doing it for A100P or X100P as it will have no effect).
You may use nano or WinSCP3 to edit /etc/modprobe.conf. Simply add the line in
red at the bottom of the file as illustrated below.
modprobe wctdm
To ensure that you have the right mode operating, do the following at the command
line:
or
dmesg
Mar 10 13:30:09 asterisk1 kernel: Module 0: Installed -- AUTO FXO (AUSTRALIA mode)
Mar 10 13:30:09 asterisk1 kernel: Module 1: Installed -- AUTO FXO (AUSTRALIA mode)
Mar 10 13:30:09 asterisk1 kernel: Module 2: Installed -- AUTO FXO (AUSTRALIA mode)
Mar 10 13:30:09 asterisk1 kernel: Module 3: Installed -- AUTO FXO (AUSTRALIA mode)
If you see an FCC mode then you will have an impedance mismatch.
Determine if there is any conflict with other PCI hardware. If there is, you probably will
need to replace or use another motherboard. If there is no conflict, then you will have to
re-detect the card.
Once done, run zttool on the command line to ensure the card is functioning.
To confirm that zaptel is actually running, after reboot, log in to Asterisk and at the
command prompt issue the following command to configure zaptel.
genzaptelconf -d -s -M -F
If there is no error then your card has been detected. Prove it by issue the following
command:
dmesg
• In Australia, for you to get Caller ID is actually having to apply to your Telco to
have it activated on your line – this is not activated by default by your Telco
(Optus or Telstra). If caller ID is not activated on your line, you will not get CID.
• If you already have caller ID activated and still don’t get caller ID, it’s time to have
a look at the ZAP configuration file. Typically you may have to look at
zapata.conf and/or zapata-channels.conf.
Naturally if you are using an X100P clone for your FXO, the following exercise will
probably be futile as the X100P, even at the best of time will probably not handle the CID
properly. However if you are using a more substantial device such as the A400P or
TDM400, then this may possibly help you towards getting the CID passed correctly.
(caveat: This solution may not necessarily work for your installation but you have nothing to
loose if you try)
A participant (Shane B) in the Whirlpool Forum provided the solution below that will
correctly pass the CID to Asterisk and your telephones:
You may need to set the following switches in your zapata.conf and/or zapata-
channels.conf.
14.6.1 zapata.conf
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
usecallerid=yes
hidecallerid=no
relaxdtmf=yes
adsi=yes
;echotraining = yes < --- need to be commented out
;echotraining = 800 < --- need to be commented out
sendcalleridafter=2 ;you may need to add this switch
hanguponpolarityswitch = yes (may have to ask your telco for the polarity reversal)
useincommingcalleridonzaptransfer=yes
If you are lucky, it should work. If not, you haven’t really lost anything apart from the CID.
I have come across a few people in the various forums wanting to use their Sipura SPA-
3000s as FXO front-end to their ELASTIX boxes. To help them in their endeavours, I've
put the following together, as no one single source of information that I've found so far
has a config that would actually work for me.
Before you change anything, I'd suggest taking a snapshot (i.e. just save the .html
page) of your current SPA3000/SPA3102 configuration, just in case you ever need to
refer back to your own customisations.
If you're not already running the latest SPA3000/SPA3102 firmware, then upgrade it
to the latest version. Take another snapshot for good measure. Nothing should have
changed in your settings, except that you have a few extra options that you didn't
have before.
Now reset SPA-3000/SPA3102 back to factory defaults, because I'm only going to list
the minimum changes required to keep things simple. Take another snapshot now
too, in case you ever want to know what the defaults were.
System tab
DHCP: No
Static IP: something on your local subnet e.g.; 192.168.1.200
NetMask: 255.255.255.0
Gateway: your router's IP address e.g.; 192.168.1.254
Primary DNS: your ISP's primary DNS address e.g.; 203.12.160.35
Secondary DNS: your ISP's secondary DNS address e.g.; 203.12.160.36
Regional tab
Dial Tone: 400@-19,425@-19;10(*/0/1+2)
Busy Tone: 425@-10;10(.4/.4/1)
Reorder Tone: 425@-10;10(.2/.2/1)
Ring Back Tone: 400@-19,425@-19,450@-19;*(.4/.2/1+2+3,.4/.2/1+2+3,0/2/0)
Ring 1 Cadence: 60(1.5/3.4)
Ring 3 Cadence:
60(1.5/3.4,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.
2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2,.4/.2,.4/2)
CWT8 Cadence: 30(.2/.2,.2/4.4)
Hook Flash Timer Min: .07
Line 1 tab
Proxy: IP address of your Asterisk box e.g.; 192.168.1.100
Register Expires: 60
Display Name: Whatever
User ID: Asterisk extension number e.g.; 2000
Password: password for that extension
Silence Threshold: medium
DTMF Tx Method: INFO
Hook Flash Tx Method: INFO
Dial Plan: (**|*xx|000|0011xxxxxxxx.|0[23478]xxxxxxxx|09xxxxxx|1100
|122[135]|1222xxxxxxx|12510[12]|12554|1[38]00xxxxxx|13[1-9]xxx
|2xx|393xxxxxx|3xxxx.|[4689]xxxxxxx|899060xxxxx.) for example
Using method 1 above, it will be necessary for you to create an inbound route using
the 0298765432 (or whatever you have defined) as your inbound route DID number.
As this incoming call is identified by the (S0<:0298765432>) in the dial plan 1 setting
of your SPA3000, this can be directed to any extension by the inbound route.
Using method 2 above, you are not required to create an inbound route as the call is
directed directly to asterisk and will be handled by the any DID / any CID catch all
inbound route. Through this route, you can direct it to your IVR or any extension you
like. This method is simpler if you only have one SPA3000/SPA3102, however if you
are using multiple SPA3000/SPA3102, method 1 is the recommended method.
User 1 tab
Default Ring: 3
Default CWT: 8
General Settings:
Outbound Caller ID: <0298765432> (for example)
Maximum Channels: 1
Dial Rules: 0+NXXXXXXXX (for example)
0011+ZXXXXXXXXXX.
Trunk Name: telstra (for example)
Peer Details:
canreinvite=no
context=from-pstn
host=the IP address of your SPA-3000/SPA3102 (for example; 192.168.1.200)
insecure=very
nat=no
port=5061 (for example)
User Details:
canreinvite=no
context=from-pstn
host=the IP address of your SPA-3000/SPA3102 (for example; 192.168.1.200)
insecure=very
nat=no
port=5061 for example
type=user
username=PSTN
Naturally you will have to use the appropriate IP addresses, port and your own
password etc. The illustration above is for my system.
If you are managing your SPA3000 remotely, you may encounter some
difficulties displaying the pages or sometimes it just seems to hang. To solve this
problem, you can try changing your TCP setting (I use TCP Optimizer) by
setting the RWIN to something smaller eg. 10xMTU, i.e if your MTU is 1500, try
setting your RWIN to 15000.
DISA (Direct Inward System Access) allows you to dial in from outside to the Asterisk
switch (PBX) to obtain an "internal" system dial tone. You can place calls from it as if
they were placed from within.
Normally you can do this via the Digital Receptionist and enter the unannounced option
number known only to selected callers.
The caller enters his/her password, followed by the pound sign (#). If the password is
correct, the user is then given system dial tone on which an external call may be placed.
This type of access has SERIOUS security implications, and GREAT care must be taken
NOT to compromise your security.
In my "MyMenu" that says, “Hi, you have reached the Sharif’s household. Press 1 for
Ben, 2 for Rohani, 3 for Norsurya etc…” I have created an extra option – option 4 (best if
you use a few digits) that has an "Action" of "Custom App", which reads, "custom-
pstn2voip,s,1".
Then in extensions_custom.conf, I have added (do this towards the end of the file).
Change "12345678" to whatever digits you want your "DISA password" to be.
The above is one way of doing it (the hard way). The easier way of doing it is through
Elastix - see below.
When you set up your digital receptionist, in the DISA dropdown selection, simply select
PSTN2VOIP as your DISA application.
If you are using this method, there is a slight catch. When you choose the DISA option to
call a number, you will be greeted with “Please enter your password followed by the
pound key” and immediately you will get a dialtone. You may start dialling the password
followed by # followed by the telephone number.
E.g. If you have chosen to have a password e.g. 12345, and the number you wish to dial
is 0292345678, you must dial the number thus: 12345#0292345678 without waiting for
another dialtone, otherwise it will not dial out correctly and you will be wondering what
happened. I hope this will be fixed up soon.
The Flash Operator Panel is the one that comes with ELASTIX.
Apart from Flash Operator Panel, There are a number of operator panels available. One
that comes to mind can be found at SOFTPEDIA and another is HUDLite from Fonality.
HUD will integrate nicely with ELASTIX and the support for HUD is already integrated
within ELASTIX.
The layout is configurable (button sizes and colours, icons, etc). You can have more than
100 buttons active per screen. It also supports contexts: you can have one server
running and many different client displays (for hosted PBX, different departments, etc).
It can integrate with CRM software, by popping up a web page (and passing the CLID)
when a specified button is ringing.
FOP can be activated by clicking on the PBX tab on the top of the screen and selecting
Flash Operator Panel.
• Hang-up a channel
• Using drag-&-drop to transfer a call
• Initiate calls by drag-&-drop
• Barge in on a call using drag-&-drop
• Set the caller id when transferring or originating a call
• Automatically pop up web page with customer details
• Click-to-Dial from a web page
• Mute/Unmute meet-me participants
In this example, Putty is used to log in remotely to ELASTIX. Once logged in, change
the directory to /etc
cd /etc
nano amportal.conf
FOPPASSWORD=cowscomehome
Close off nano and putty. Open your web browser and go to FOP. You should now
be able to click on the little lock, put in your password and you will see it lock up. Now
you can begin to have some fun.
Note: You may have to increase your digittimeout duration from the default to 2000
depending on the type of phones you use. If you have to do this, insert the following in
your features.conf file.
This is handy if you want to manage the calls to be transferred. After parking the call, you
may call the person you are transferring it to and tell him/her that there is a call on
extension 71. The person can then dial 71 and get the parked call.
1. Dial ##70 - the call will be transferred to a park extension and the number
will be announced to you. In this case it will be 71. After the announcement,
you may hang up and dial the extension of the person you wish to transfer
the call to and inform him to dial 71 to accept the call.
3. If for any reason the person refused to take the call, you then hang up and
dial 71 to pick up the call back to you and speak to the caller making the
usual excuses “I am afraid Mrs. Roberts, Dr. Roberts is busy with his nurse and
his office door is being locked from the inside” ☺ and the next time Dr. Roberts
will always accept the calls from his wife.
E.g. to transfer to extension 2001, you simply dial ##2001 and hang up.
When you are ready to take the call, dial 71 (or whatever the park extension is) and the
call will be picked up again. While the call is being parked, the caller will be listening to
your MOH music.
Group call pickup is typically invoked by dialling ** from another phone in the call pickup
group.
For this purpose, the Privacy Manager option of the extension can be invoked, however I
found that caller often get confused with the need to enter the 10 digits phone number as
often they may have only 9 digits or more than 10 digits.
This feature will force callers to record their names before the calls will be parked. The
extension that you nominate will ring and on answering, you will be informed that there is
a call waiting for you in a parked extension e.g. 71.
After receiving the call and if you wish to take the call, hang up and dial 71 and you will be
connected to the caller. Otherwise, just hang up and the caller will just have to leave a
message in the voicemail. Real nifty ☺
This is how I did it with my Asterisk. Since I am pretty simple myself, I just take the low
road make it really simple.
[who-r-u]
exten => s,1,Background(privacy-unident)
exten => s,2,Background(vm-rec-name)
exten => s,3,Wait(2)
exten => s,4,Record(/tmp/asterisk-stranger:gsm|5|15)
exten => s,5,Background(pls-hold-while-try)
exten => s,6,Goto(parkedcalls,70,1)
exten => s,7,VoiceMail(2001@default)
exten => s,8,Playback(Goodbye)
exten => s,9,Hangup
[parkedcalls]
exten => 70,1,Answer
exten => 70,2,SetMusicOnHold(default)
exten => 70,3,ParkAndAnnounce(asterisk-friend:/tmp/asterisk-
stranger:vm-isonphone:at-following-
number:PARKED|40|local/2001@from-internal|who-r-u,s,7)
exten => 70,4,Hangup
I forward all calls that were parked to my existing extension 2001 (in bold type) and direct
voicemail for unanswered calls to the same extension as well.
Next I create a new extension using freePBX e.g. 222. Using a softphone, I connect to
extension 222 and unconditionally forward all calls to extension 222 to extension 111 by
dialling *72111
I then direct all my incoming calls from my PSTN trunk to extension 222.
When the call gets to extension 111, the caller will hear a message saying that,
“unrecognised calls are not accepted and asking the caller to record his/her name after the tone”
(or something to that effect). After the caller has complied and press the # key, the call
will be parked.
Extension 2001 will be called by Asterisk. When you answer the call, Asterisk will
announce that there is a call by <name as recorded> on extension 71 (or 72 depending on
how many calls are being parked). If you recognize the name recorded, or if you want to
take the call, simply hang up and dial 71. You will be connected to the caller. While this
is all happening, the caller will be put on hold listening to your MOH.
If however you do not wish to accept the call, you simply hang up and do not dial 71. The
caller will be asked to leave a message instead.
Conference is pretty easy to set up, as there is very little to do. However, to set up
Conference, a Zaptel card may be required (at least in my case as I don’t seem to be able
to get it working without a Zaptel card installed). In the latest Elastix 1.0, this seems to
have been resolved.
In Elastix, there are 2 .conf files that relates to conferencing. They are:
meetme.conf
meetme_additional.conf
meetme.conf
Ensure that you have the following 2 lines (only 2 lines in the file):
[rooms]
#include meetme_additional.conf
meetme_additional.conf
This is where the extensions for the meeting rooms are created. One line per room.
You may have just one extension for your meeting room or you may have several
meeting rooms. In my case, I have 1 meeting room and therefore my
meetme_additional.conf contains the following extension:
Naturally there are some options that you may wish to have for the conference room.
They are entirely up to you. The main important things are for you to create the
conference room number and the conference name for you to know what that
conference room is for. The rest of the fields are optional.
Once these are done, from one of your phones dial, 8000 and you will be able to join the
conference.
You are now in the conference room and every time someone joins or leaves the
conference, it will also be announced.
To test this, go to another phone and also dial 8000. You should hear an announcement
(if you are listening on the first phone), indicating that someone has joined the
conference.
If there are 2 (or more) of you, you will be able to talk to each other. If one of you hangs
up, you will know about it.
To set up this facility, under the PBX tab, you will notice the sub-tab “Conference”. Click
on the conference sub-tab and you will be presented with the screen as illustrated.
Once fully installed and activated, you will be presented with a new screen where you can
start populating the conference you want to control.
The following screen will appear. In this case we want to control the general
conference 8000 that we created earlier on.
Similar screen to the above example will appear. In this case we the conference will
be an internal conference by invitation only.
You will need to populate the fields as per the example above except that you may
not have a pre-created conference number. The conference will be nominated by the
system and you do not change this number to any pre-created conference that was
done using freePBX.
When you click save, you will have created a controllable conference.
The Elastix team has taken all the hardwork away from you so you can control and
moderate the conference with relative ease
Click on the participant as shown in the illustration above to start administering the
conference (see arrow).
The conference will automatically reset anad terminate at the end of the period you have
determined at the time of setting up.
.
If you have enabled voice mail when setting up your extension, and you hear a
stutter tone (not the normal dial tone) when you initially pick up your phone, it is
indicating to you that you have a voice mail waiting.
To enable voicemail on an extension simply "enable" it when you create the extensions
from the Elastix GUI. If you require email notification of your voicemail, you may enter
your email address in the email address field.
Click submit when done followed by the red bar on top of the screen.
I was having a lot of fun trying to get email notification going without having to resort to
SASL. Finally I was able to get it to work after a few trial and errors. MY SMTP Relay
host is expecting mail from a valid DNS before it will accept the mail, but Postfix is
sending the email from Asterisk@localhost therefore it was rejected.
To overcome this, I have to edit the /etc/postfix/main.cf file to include the following;
After having done that, you may do one of the following methods:
20.1.1 Method 1
This is a desperate method (not recommended – do only on desperation) where I have to
change my Elastix hostname from elastix.local default to a fully qualified DynDNS
name using the GUI as per the illustration below.
# RECEIVING MAIL
When Postfix send the mail to your Relay Host, it will show that the mail is from
[email protected] which is a valid address and not
Asterisk@localhost which is, as far as the Relay Host is concerned is an invalid
address.
If things go wrong with your email notification, you can look at the maillog file in the
/var/log directory.
The above methods are just two quick and dirty ways of getting your email out. In the
Elastix Mail System and Webmail, we will touch a little deeper.
Change the entry in red to reflect your requirement e.g you may change vm@asterisk to
FHC PBX and change Voice mail System to read Family Health Centre Voicemail.
Once these are done, you will receive email notification of voicemail left in your voicemail
box.
You may start testing it and your email received will look something like this:
This is how I do it (you may have been told of other different methods).
20.3.1 Method 1
1. Call my number and when the Digital Receptionist answers, I will dial my
extension number prefixing it with an *. E.g. My extension number is 2001,
so when the DR answers me, I will dial *2001
2. I will then be ask to leave a voicemail, but instead, I will dial * again.
20.3.2 Method 2
1. From freePBX Setup Screen, create a Misc Destination and give it a name
of e.g. “Check VM”
2. Select Feature Code Dial Voicemail (*98) from the dropdown menu.
3. Submit the changes.
1. Increase option. If you already have 7 options, this will be the 8th.
2. Create an unannounced IVR selection e.g. selection no: 8
Ensure that you have changed your Direct Dial to Voicemail message type, in
General Setting, from Default to something else e.g. Unavailable. Otherwise
when you use follow-me and the like, your custom recorded message will not
be played back. The Asterisk default message will be played back instead.
While sending and/or receiving Faxes are the available functions in ELASTIX, there have
been reports of various degree of success if you are sending or receiving Faxes via IP.
However it has been proven that receiving and sending faxes via Elastix through ISDN or
PSTN have been consistently reliable and of commercial grade. This was achieved by
utilising Hylafax which is a mature product (instead of the more commonly used
mechanism by some other iPBX distributions).
One of the difficulties experience by many users are the inability to have the Fax (or voice
mail notification) sent out by email. One of the possible reason is that postfix need a valid
relay host address which you will need to add to etc/postfix/main.cf
Once this is done, changes are it may work (but then again it may not).
Faxing through IP are achievable however it is variable due to several factors which
include hardware and bandwidth considerations and VSP support of T38. For
commercial usage, it is not highly recommended.
Elastix does not utilise the standard Asterisk Fax handler for Faxing, instead utilising a
separate module to handle fax traffic, which we will be discussing here.
As already stipulated, Elastix is using Hylafax. As such all tools and applications that
interface to Hylafax can be used (you may even have 10 virtual fax machines). It is
recommended that dedicated Fax lines be used for incoming and sending faxes although
the same lines can be used for outgoing calls (not incoming calls) – caveat: this assumption
is made on the result of our testing.
Click on the FAX tab and the following screen will appear.
Click on Save.
You will then notice the following screen with “Running and idle on ttyIAX1”.
That’s a virtual FAX machine setup and ready to go as soon as we create an extension.
By now we should already know how to set up an extension. This extension that we will
be setting up is an IAX extension, which differs slightly from the SIP extensions that you
are used to.
• User Extension: 1100 (same user extension when you setup your virtual fax)
• Display Name: Sydney Fax (or whatever you want to call it)
• Secret: 1234 (make sure this is the same secret you use when you setup your
virtual fax)
• Fax Extension: Disabled
• Incoming/outgoing recording: Disabled
If you have dedicated line for the Virtual Fax, under freePBX, all you do is set the
incoming route of your Fax DID to go directly to extension 1100.
This is where you wish to share one PSTN line for Voice and Fax. Your Elastix system
will discriminate between Fax call and a voice call and send it to the appropriate
extension for fax or pass it through to your normal handler if it is a voice call.
In the freePBX General setting, ensure that the Extension of fax machine field is disabled
(see below).
In the incoming route set your fax extension number to 1100 (the one we have set up)
and set Fax Detect to Zaptel leaving your final destination to the voice call if it is not a fax
call.
Even though we have only set 1 virtual fax, you can set several if needed using the same
procedure as outlined above except you need to use separate fax extension numbers e.g.
1100, 1101, 1102 etc
1. Click on the Fax Visor Sub-Tab. The Fax visor screen will be displayed listing the
Faxes that you have received.
2. Click on the blue link will open the fax.
The Australia weather report reference file can be obtained from the following site:
http://www.bom.gov.au/
You may choose the reference file (text file) for the area that you are interested in. You
do not need to manually download the file, instead only the file name is required to be
noted and can be incorporated within the Elastix’s extensions_custom.conf file later.
The script will download the file for you in the background.
The following are examples of available weather report files that you can reference in
your script.
After downloading copy the downloaded file into your root directory (the file I downloaded
was flite-1.3-release.tar.gz) and install it thus:
tar zxvf flite-1.3-release.tar.gz
cd flite-XXX
./configure
make
I used Putty to log on to the Asterisk box remotely and used Nano to create a text file
called “convert2wav” in the /usr/bin directory containing the following:
/flite-1.3-release/bin/flite /tmp/weather.txt /tmp/weather.wav
Once this is done, the permission for the “convert2wav” text file need to be appropriately
set to allow it to be executed. To do this you need to run the following command from
Command Line.
Now you have completed all the necessary preparations – for me anyway.
The next step is to include the following in the extensions_custom.conf through the
File Editor option of ELASTIX Tools Tab. Select an unused extension code e.g. *61,
*63, *64 etc.
Add the following example (*Note: The third line in each section (bold) should read as a
complete single line- change the file reference in red to suit.).
; ##################################
; Forecast for Sydney Metro
; ###################################
exten => *61,1,Answer
exten => *61,2,Playback(national-weather-service)
exten => *61,3,Playback(pls-hold-while-try)
exten => *61,4,System(/usr/bin/wget -O weather.txt
ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN10064.txt)
exten => *61,5,Wait(1)
exten => *61,6,System(/usr/bin/convert2wav)
exten => *61,7,Playback(/tmp/weather)
exten => *61,8,System(rm /tmp/weather.* -f)
exten => *61,9,Hangup
; ######################################
; Forecast for the whole of NSW
; ######################################
exten => *63,1,Answer
exten => *63,2,Playback(national-weather-service)
exten => *63,3,Playback(pls-hold-while-try)
exten => *63,4,System(/usr/bin/wget -O weather.txt
ftp://ftp2.bom.gov.au/anon/gen/fwo/IDN10031.txt)
exten => *63,5,Wait(1)
exten => *63,6,System(/usr/bin/convert2wav)
exten => *63,7,Playback(/tmp/weather)
exten => *63,8,System(rm /tmp/weather.* -f)
exten => *63,9,Hangup
Restart asterisk and test. You will be presented with the weather report of the areas
you have chosen.
(Source Reference:
http://forums.whirlpool.net.au/forum-replies.cfm?t=364420&p=1)
This method is very slow and therefore is only suitable for a very fast PC. Depending on
the speed of your computer during the .wav conversion, there may be about 1 minute or
more delay between dialling the extension and the weather announcement. Therefore I
have included step 3 telling the caller to hold while trying to connect.
First we will use putty to make a batch text file called “convert2wav” in the /usr/bin
directory containing the following:
If you want to get rid of a couple of nasty characters, you can always add the following
line or lines in the appropriate places and changing the characters that you want to
discard or change,
- but we are not going there. It may get too confusing. For the moment we will just stick
with the batch file example above.
Use Webmin to schedule a Cron job to run this batch file every 4 hours (or schedule it to
suit your purpose). This will run the batch job at the scheduled time avoiding having to
download the weather file and converting them to sound files when a caller chooses the
weather report option.
The sound files will always be available when a caller requires them without having to
wait for them to be downloaded and converted.
; ##################################
; Forecast for Sydney Metro
; ###################################
; ######################################
; Forecast for the whole of NSW
Restart asterisk and test. You will be presented with the weather report of the areas
you have chosen without any delay whatsoever.
; ##################################
; Forecast for Sydney Metro
; ###################################
[custom-weathermetro]
exten => s,1,Answer
exten => s,2,Playback(national-weather-service)
exten => s,3,Playback(pls-hold-while-try)
exten => s,4,Playback(/tmp/weather1)
exten => s,5,Hangup
; ######################################
; Forecast for the whole of NSW
; ######################################
[custom-weathernsw]
exten => s,1,Answer
exten => s,2,Playback(national-weather-service)
exten => s,3,Playback(pls-hold-while-try)
exten => s,4,Playback(/tmp/weather2)
exten => s,5,Hangup
When you create your menu option in Digital receptionist, e.g. “Press 6 for Sydney
weather report, press 7 for the whole of NSW weather report”, select the custom app: and
enter the appropriate custom procedures above. See example below:
You should also forward port 443 on your router to point to the local IP address of your
Elastix box.
To log on locally you simply log on to https://192.168.1.101 (or whatever your local IP is).
Since I am on Optusnet cable, I only have the privilege of a dynamic IP hence I registered
for a Domain ID with DynDNS pointing to my Dynamic IP address. Every time my
dynamic IP changes, DynDNS will point to the new IP address. This way I don’t have to
keep changing IP addresses. I simply use the same DNS ID eg: myasterisk.freedns.com
As mentioned above, you may create a SIP extension instead, if you so wish but you
must ensure that you set “nat” field to “yes” ( in the device option) instead of “never” as
illustrated in the screen below - see red arrow.
Once you have done this, you will need to ensure a couple of things in your .conf files are
set correctly.
iax.conf
[general]
bindport = 4569 ; Port to bind to (IAX is 4569. Forward this port to your Asterisk box)
externip = <your fixed external IP> or
externhost = <myasterisk.freedns.com>
localnet = 192.168.1.0/255.255.255.0
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
delayreject = yes
disallow=all
allow=g729
allow=ilbc
allow=gsm
allow=g723
allow=alaw
allow=ulaw
jitterbuffer = yes
mailboxdetail = yes
#include iax_additional.conf
#include iax_custom.conf
24.3 SIP_NAT.CONF
The only other .conf file that requires attention is the sip_nat.conf in case you want to
use SIP. If you do, ensure that you have forward ports 5004 – 5082 as well. My file is as
per the example below.
sip_nat.conf
nat=yes
externip=<your fixed external IP> or
externhost=< myasterisk.freedns.com>
localnet=192.168.1.0/255.255.255.0
externrefresh=10
Those are the only 2 .conf files that require changing if needed.
Setting up IDEFISK is very simple. All you have to do is download the file, extract it and
save it in its own directory.
Click on the idefisk.exe and just configure it like the example below.
The next option to take care of is the Account option. Apart from that, there is nothing
else critical to be done for you to use IDEFISK.
The rest of the options are there for you to set up your sound preference and customize
your look and feel. They are pretty straightforward.
Now you are ready to go on the road with an Asterisk extension under your arm.
To upgrade Elastix to the new v1.0-16 you simply log on to the console (or ssh using
putty) and issue the following command at the root ptompt:
yum update elastix.
To enabled this feature, the following Dial Command Option must be enabled in freePBX
General settings Asterisk Dial command option and Asterisk Outbound Dial
command option fields by adding the following flag in the fields.
w: Allow the called user to start recording after pressing *1 (Asterisk v1.2)
W: Allow the calling user to start recording after pressing *1 (Asterisk v1.2)
Some users have noticed that the *1 need to be pressed very quickly for this feature to
work. This can be remedied by adding the following line in the features,conf file under
the general section.
featuredigittimeout = 2000 ;(the default is 500 which is too fast for an old guy like me
If you want to listen to all the calls, you will need to log in as admin with the default
password of ari_password., otherwise you can only listen to your recordings only.
To monitor the calls for any individual extension, log in using the extension number and
the extension password.
To play the recording, simply click on the Play link related to the extension that you want
to listen to, in the screen that follows.
For those who do record conversations through the ARI interface of unembedded
freePBX, the recording are kept in the /var/spool/asterisk/monitor directory.
I never have the need to use STUN. The list below is provided for those who have the
need to use public STUN Servers. These are the servers that I am aware off - there may
be others.
stun.xten.com stun1.noc.ams-ix.net
stun.fwd.org stun.voipbuster.com
stun01.sipphone.com stun.voxgratia.org
I was alerted of this facility in Outlook® and Asterisk® and asked to prove the application
and publish a simplified instruction in this guide.
To get started, you will need to edit manager_custom.conf file. The easiest is to use
Elastix’s File Editor (the easiest way!)
On opening the manager_custom.conf file, you will notice the following, which you will
need to do a tiny weeny edit:
[phpconfig]
secret = php[onfig
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
[phpagi]
secret = phpagi
deny=0.0.0.0/0.0.0.0
permit=127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user
[AstTapi]
Under the [AstTapi] User context, remove the # from the permit line and change the
192.168.1.0 to the network address of your network. In my case I left it as it is because
my network is under 192.168.1.0 (see red highlight).
Fire up Outlook®.
User Channel: (your extension – the extension you want Asterisk to ring before
connecting you the number you are calling) e.g. sip/2001
You can now start making calls from Outlook using the click-to-dial facility.
To do this, you will need to edit extensions_custom.conf by adding the lines below
containing the relevant exten expressions.
; #############################################################
; Speed Dial to some predefined numbers (added by Ben 2/12/2005)
; #############################################################
You will need to substitute the example phone numbers above such as 6140036xxxx with
the real phone numbers.
When 236 (which is BEN) is dialled, you will hear a voice prompt saying “Please wait
while I connect your call” followed by Asterisk calling Ben’s Mobile number which is
61400336510 using the Pennytel SIP trunk.
Pennytel SIP trunk was called Pennytelsip when it was initially set up.
The call will be tried for 60 seconds (,60) and while the call is being attempted, the caller
will be listening to a MOH tune (,m) instead of the ringing tone. You may however
change it to a ringing tone by substituting the “m” with a “r” or remove “,m” altogether
Once you have done that, click on Update and re-read the config. That’s all there is to it.
Here you simply enter the Phone number of the party you wish to call, the name and the
Speed Dial Code in the appropriate fields as per the example below. Submit change
when done.
To call the Speed dial, e.g. you want to call Ben Sharif, simply dial *069 (the *0 tells
Elastix that you want to use the Speed Dial and the 69 is the Speed Dial Code for Ben
Sharif).
Naturally if you have a big list of Names and Phone Numbers that you want to enter in
your Elastix Phone Book, you have the option of uploading the list. You have to scroll
down the page to get to the “Import from CSV” section of the Phone Book (see illustration
below)
.
The “Import from CSV” is a misnomer because, if you havae created a list using EXCEL
and trying to import the list, it will not work since EXCEL CSV file is a comma delimited
one where as freePBX is expecting a semi-colon delimited file. Mousing over the word
file will give you the format it is expecting;
“Name”;Number;Speeddial code
From the Windows Messenger dialog box, go to Tools -> Options ->Accounts:
• Check the [My contacts include users of a SIP Communications Service] checkbox.
• Enter "sip:<your extension>@<Asterisk Address>"
(e.g.."sip:[email protected]") in the [Sign-in name] field
In order for Windows Messenger to work as a voice communication device, you must
have a microphone and speaker(s) connected to your PC.
Verify that Windows Messenger has successfully registered with Asterisk by logging in to
Asterisk.
You should see under SIP Registry that the Windows Messenger is registered as a
user/phone number of 206, with a contact URL of your local PC IP Address e.g.
192.168.0.11, among other registration information.
Note: Windows Messenger 5.0 or later has support for VoIP communications but it seems
that it may create problems with chat or other features. For this purpose, please focus
your testing on VoIP only.
I have 2 different locations, the Main Office (def.com.au) with about 11 extensions and
another office in a different location (xyz.com.au) about 20 km away with 9 extensions.
The main office is the only box that will have accounts with different VSPs and all external
communications are through the main office Elastix box. I settled for the simplest solution
and after some fiddling around I managed to get them to work the way I wanted it but not
happy with it, I solicited some advise from a friend (thanks to Mark Brooker) who provided
further assistance.
Instead of being verbose in my explanation, I will just create a few tables outlining what I
did. I hope this will help those in the same position as I am, to set 2 very basic systems
together (you can refer to DUNDi for a more complete solution). A little tutorial on DUNDi
can be found here.
System 1 System 2
def.com.au xyz.com.au
IAX Trunk
Outgoing Dial Rules: XX. XX.
Trunk Name Parramatta MainOffice
host=xyz.com.au (or System 2 IP) host=def.com.au (or System 1 IP)
Peer Details qualify=yes qualify=yes
secret=xxxyyy secret=xxxyyy
type=peer type=peer
username=91000 username=90000
User Context Leave blank Leave blank
User Details Leave blank Leave blank
Register String 91000:[email protected] 90000:[email protected]
Note: Registration isn’t really necessary. It will still work without it unless you use Dynamic IP.
System 1 System 2
Extensions
Phone Protocol IAX IAX
Extension Number 90000 91000
Extension Password xxxyyy xxxyyy
Fullname Parramatta Main Office
Voicemail & Directory Disabled Disabled
Outbound Routing
Route Name Parramatta MainOffice
Route Password Leave Blank Leave Blank
6XXX XX.
Dial Patterns (6001 to 6009 are Parramatta (Apart from Local extensions, all
Office extensions) others go via Main Office)
Trunk Sequence IAX2/Parramatta IAX2/MainOffice
The above Outbound Routing rule assumes that you do not wish to use a dialling prefix. If
you want to use a prefix to dial the remote extensions and to use the remote routing rules,
you may place a prefix e.g. 9|6XXX and 9|XX. for system 1 and system 2 respectively
instead of just 6XXX and XX.
While this method will provide some rudimentary security (though pretty
weak), as it requires an extension to be created for the peer Asterisk box, it will
not pass the calling party extension number to the remote Asterisk box.
Instead, it will pass the Trunk ID only and all calls will seem to come from the
same trunk and not individual extension – I did say that this is a simple
solution.
Unlike the first method, this second method will pass the Caller ID to the receiving party.
The receiving party will actually get the callers’ extension number/ID instead of the
extension number of the peer Asterisk box.
Rather than being verbose, I will illustrate this method using tables as follows:
System 1 System 2
def.com.au xyz.com.au
IAX2 Trunk
Outgoing Dial Rules: XX. XX.
Trunk Name InterOffice InterOffice
host=xyz.com.au (or System 2 IP) host=def.com.au (or System 1 IP)
Peer Details Qualify=yes Qualify=yes
type=peer type=peer
User Context InterOffice-In InterOffice-In
context=from-internal context=from-internal
User Details host=xyz.com.au (or IP) host=def.com.au (or IP)
type=user type=user
Outbound Routing
Route Name InterOffice InterOffice
Route Password Leave Blank Leave Blank
6XXX XX.
Dial Patterns (6001 to 6009 are Parramatta (Apart from Local extensions, all
Office extensions) others go via Main Office)
9|XX. (To call external number
via Main Office)
Trunk Sequence IAX2/InterOffice IAX2/InterOffice
This method is by far the simplest method where the boxes are treated as friend to each
other. Like Method 2, registration is not required and this method will also pass the Caller
ID to the receiving party.
System 1 System 2
def.com.au xyz.com.au
IAX2 Trunk
Outgoing Dial Rules: XX. XX.
Trunk Name InterOffice InterOffice
host=xyz.com.au (or System 2 IP) host=def.com.au (or System 1 IP)
Peer Details Qualify=yes Qualify=yes
type=friend type=friend
User Context
User Details
System 1 System 2
Outbound Routing
Route Name InterOffice InterOffice
Route Password Leave Blank Leave Blank
6XXX XX.
Dial Patterns (6001 to 6009 are Parramatta (Apart from Local extensions, all
Office extensions) others go via Main Office)
9|XX. (To call external number
via Main Office)
Trunk Sequence IAX2/InterOffice IAX2/InterOffice
All the above examples assume that both Asterisk boxes have Public Fix IP address. If
you have Dynamic IP addresses, you will need to register both the boxes with DynDns to
obtain a valid DNS ID. If you are a part of a Corporate LAN, then you will have no need
to worry about DynDns and what not.
Warning: You must provide for security, as this is pretty wide open.
Like all installation, you must provide for security. As different installation resorts to
different types of security arrangement, I will leave that to the individual implementer to
deal with the security issues.
Except for local traffic, all external and inter-office (inter-branch) traffic goes
via Box A. – with the appropriate dial plan of course.
Both the above methods, while useable for a basic configuration, will not provide you with
a complete solution. To provide a complete solution is beyond the scope of this
document.
The following link will provide further reference for connecting two Asterisk boxes together
http://www.voip-info.org/wiki/view/Asterisk+-+dual+servers
If you require a complete solution tailored to your exact requirement, my advise to you is
to hire a VOIP consultant.
Personally I really wouldn’t do this as it is simpler to get a redirection to the new number from
the exchange.
In this example, lets say that all calls coming to your head office Elastix PBX made on
phone number 12345678 need to be sent to your Elastix PBX in a different location.
Let us call your Head Office PBX Box-A and your remote PBX Box-B and calls coming in
to Box-A to be sent to Box-B.
There are a number of ways that this can be achieved but most involved editing conf files
and adding extra codes in the conf files. Unless you are quite comfortable with doing this,
it can be quite daunting to the uninitiated.
The example I am illustrating here does not involve editing any conf file. All can be done
through freePBX. It is a little long winded but you don’t have to touch any of the conf files.
6000
To unconditionally forward calls made to this extension to extension 6000, you need
to connect to extension 500 using a softphone and dial *726000. Any calls to this
extension will be unconditionally forwarded to extension 9000.
i. Create a Trunk
Trunk name: TransferTrunk. Leave the peer details blank.
context=from-trunk
That is all we need to do and from now on, calls that come in to Box-A on your phone
number 12345678 will be directed to extension 500 of Box-A. However, since all calls to
extension 500 has been unconditionally redirected to extension 6000, asterisk will forward
the call to extension 6000 which your outbound route will pick up and send to Box-B.
Although there are separate voice sets that can be used, sometimes we only require a
few prompts and not the entire voice set.
However, if you want to manually cut the script, you can do the following (personally I
wouldn’t bother – why re-invent the wheel?). Under the [from-internal-custom] context
of extensions_custom.conf, add the following codes.
[from-internal-custom]
To start recording, use one of the phone extension and dial 5678. At the beep, start
recording the voice prompt.
The voice prompt will be saved as my-recording.gsm (gsm format) in the /tmp directory.
When completed, hang up and dial 5679. The voice prompt will be played back.
Once you are satisfied, rename the file to something related and recognisable e.g.
my_office_business_hours.gsm. The file should then be moved to the
/var/lib/asterisk/sound directory.
The file can be played through your custom applications or prompts using the Playback
or Background function of Asterisk.
A good information on Asterisk sound files and how to create them can be found here
http://voip-info.org/wiki/view/Asterisk+sound+files
Create a subdirectory for the particular language (eg: ‘au’ for Australian English, ‘fr’ for
French, ‘it’ for Italian etc.) in the /var/library/asterisk/sounds directory, e.g.
/var/library/asterisk/sounds/au and send all your prompts sound files there. Also create
the language directories in the digits, letters etc directories, and send the entire prompt
files there.
Add the following line in the iax.conf and sip.conf configuration file under [general]. In
zapata.conf configuration file the line should be added under [channels].
You may use the Edit Configuration facility of ELASTIX, otherwise you can use
nano at the command prompt of your Asterisk box (or SSH to your Asterisk box) to
edit the files that resides in the etc/asterisk directory.
Elastix will be able to play virtually any sound that it has the codec for e.g. wav(pcm),
wav49, gsm, g711, g729 etc. However, the gsm format seems to be the common format
used for the default voice prompts.
Since the WAV format is the most common format that is being adopted when
recording with a windows based PC, and most times, the windows based WAV format
does not play well with asterisk, below is a method of converting the windows
recorded WAV format to GSM using SOX.
Your result will be better if you record your sound files in mono, 16 bit, 8000 Hz.
After recording the WAV sound files, transfer the sound files to the TEMP directory of
the Elastix PC. In this example, let,s call one of the sound files hello.wav.
Login as root and change directory to the directory where you have transferred
the sound files to e.g. cd /tmp
• If your sound files were recorded in mono but NOT 16 bit, 8000 Hz
• if your sound files were recorded in ADPCM wav files, to convert to standard
wav file;
Next, move the sound file to the sound directory where all your prompts are
stored and you are done.
You may also convert a number of WAV files at once using the following command.
In this example, lets assume that the files were all recorded in stereo;
Starting from Asterisk version 1.2.0, the .sln (SLINEAR) format seems to be the
format that is being adopted (the GSM format is still commonly being used), so don’t
worry about converting your existing prompts.
Further reference for converting wav sound files can be found here at voip-info.org.
You may also need to add the following, under [channels] in your zapata.conf file:
musiconhold=default
Pretty much any mp3 will work with Elastix. Prior to that, it's better to convert it to a
standard format. When converting my MP3 music, I use FreeRip and convert the music
as per the following:
To customise your music to your favourite, you may need to create a new music category
directory to hold your favourite music. Do this through the freePBX “On Hold Music” GUI
interface. I call my category favourites.
Upload your favourite music to this directory. Again, do this through the freePBX GUI.
Once finished uploading, click the “Enable Random Play” button and the red bar.
Make a little change to your musiconhold.conf file like the example below (this way you
don’t have to delete the music in your default directory).
You will now have to get used to the newer approach (it no longer uses the [classes] tag):
The musiconhold.conf files in 1.2 is now set out differently as per the example of my file
below:
musiconhold.conf
;
; Music on hold class definitions
; This is using the new 1.2 config file format, and will not work with
1.0
; based Asterisk systems
;
[default]
mode=files
;
; valid mode options:
; quietmp3 -- default
; mp3 -- loud
; mp3nb -- unbuffered
; quietmp3nb -- quiet unbuffered
; custom -- run a custom application
; files -- read files from a directory in any Asterisk supported format
;
directory=/var/lib/asterisk/mohmp3/favourite ;<- I pointed this to my favourite
musiconhold_additional.conf
[acc_1]
mode=files
directory=/var/lib/asterisk/mohmp3/acc_1/
random=yes
While freePBX does not have a ready method of doing it from the GUI, we can trick the
system into doing it with a simple creative modification. Here goes.
Create 3 separate music categories (Rock, country and classical) and populate them with
MP3s or whatever that turns you on.
[custom-department_1]
exten => s,1,playback(pls-wait-connect-call)
exten => s,n,SetMusicOnHold(country)
exten => s,n,Dial(SIP/2001,60,r)
exten => s,n,Macro(vm,2001); voice mail to extension if no answer
exten => s,n,Hangup
[custom-department_2]
exten => s,1,playback(pls-wait-connect-call)
exten => s,n,SetMusicOnHold(classical)
exten => s,n,Dial(SIP/2002,60,r)
exten => s,n,Macro(vm,2002); voice mail to extension if no answer
exten => s,n,Hangup
[custom-department_3]
exten => s,1,playback(pls-wait-connect-call)
exten => s,n,SetMusicOnHold(Rock)
exten => s,n,Dial(SIP/2003,60,r)
exten => s,n,Macro(vm,2003); voice mail to extension if no answer
exten => s,n,Hangup
Assuming 2001,2002 and 2003 being the extensions of the various departments,
There are 2 ways of doing this and I will outline them both below:
Method 1
(old method of doing things but pretty straight forward and it works)
Below is what I have to do to get Streaming On Hold for my system. I realised that it
is not the best method, but for the sole purpose of getting Music on Hold, it got me
working.
From command line, find out if you have mpg123 installed using the following
command.
mpg123 –v
You will find out if you have mpg123 installed or not and its version number. The
version that we want is mpg123-0.59r.
Since I do not have mpg123 installed, first I have to download and install mpg123 - it
is not included in Elastix implementation of Asterisk. To get mpg123 I have to log on
as root and at the command prompt I did the following:
cd /usr/bin
wget http://www.mpg123.de/mpg123/mpg123-0.59r.tar.gz
tar –zxvf mpg123-0.59r.tar.gz
cd mpg123-0.59r
make linux
make install
ln -s /usr/local/bin/mpg123 /usr/bin/mpg123
I have to make a directory for the streaming music. You can do this though the
freePBX GUI or manually. In this example, I have shown the manual method.
su asterisk
cd /var/lib/asterisk/mohmp3/
mkdir stream
Next I need to create a zero length dummy MP3 file for this purpose in the
/var/lib/asterisk/mohmp3/stream directory (this can be done manually).
cd stream
touch stream.mp3
exit
Open the musiconhold.conf file using the Config edit option on your Elastix and add
the following lines on top of the file;
[classes]
default => quietmp3:/var/lib/asterisk/mohmp3/stream,http://128.177.3.80:4064/
and leave everything else out (or commented out) like my example below.
[classes]
The lines in BOLD are the lines that was added to the musiconhold.conf file.
The above is not necessarily being the best way to approach it but that is the simplest
way that I know of.
Method 2
(as suggested by Bob Fryer)
This method was tested on system running Elastix 0.9.2, but we expect that it will not
present any issues on Elastix 1.0.
cd /usr/src
wget http://dag.wieers.com/rpm/packages/libmad/libmad-0.15.1b-4.el5.rf.i386.rpm
wget http://dag.wieers.com/rpm/packages/libid3tag/libid3tag-0.15.1b-3.el5.rf.i386.rpm
wget http://zak.googlecode.com/files/madplay-0.15.2b-1.el5.i386.rpm
rpm -ivh libmad*.*
rpm -ivh libid3tag*.*
rpm -ivh madplay*.*
cd /var/lib/asterisk/mohmp3/
mkdir stream
cd stream
touch stream.mp3
--------------------------------
[easylistening]
mode=custom
application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0
http://128.177.3.80:4064/
[classical]
mode=custom
application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0
http://216.126.84.50:8000/
[Country]
mode=custom
application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0
http://64.236.34.106:80/stream/1075/
[Dance]
mode=custom
application = /usr/bin/madplay -q -s --mono -A 3 --attenuate=-3 -r 8000 -f 8192 -b 0
http://193.138.205.194:8014/
--------------------------------
Just in case formatting is incorrect, between the start of the word "Application" and
the end of the HTTP address is all on one line. The same with the WGET.
Then go into your trunks and extensions in freepbx and choose the MOH Stream you
want for on hold music.
The following are addresses where you may find some streaming music for your MOH.
There are 2 ways you can do this. One is through Elastix or if you wish you can do it
through the Unembedded FreePBX.
To schedule a backup, from Elastix choose System Tab -> Backup & Restore
The screen that follows is where you define your backup requirement.
1. Place a check mark in the All Options (which will tick everything)
2. Click Process
Once the backup process is completed, you will see a screen with the backup
filename displayed as per illustration below.
Naturally you can do as many backups as you want. It is up to you to decide. If you
are wondering where it is being stored, it is here /var/www/html/backup. The backup
files are identified by the backup names. Depending on how big your content is the
backup can take quite some time.
Backup itself is not useful if it cannot be restored. The freePBX developer has
thought of this too.
This is a very simple procedure. All you need to do is click on the appropriate options
and the rest are all a matter of choosing what it is that you want to restore (see
illustration below).
Once done you may leave the screen and check the system to make sure that all
those that need to be restored have been restored.
To schedule a backup, from freePBX choose Tools -> Backup & Restore
The screen that follows is where you define your backup requirement.
I have chosen to schedule a Weekly (on Sundayst) backup as per the illustration
above:
• In the Schedule Name, I have given it a name Weekly (to signify that it is a
weekly job)
• I have also selected all the items to be backed up – VoiceMail, System
Recordings, System Configurations and CDR only.
• Next from the Run Backup drop down choice, I have chosen Weekly (on
Sundays)
• Once I have done these, I click on Submit Changes.
Naturally you can schedule numerous backups. It is up to you to decide. If you are
wondering where it is being stored, it is here /var/lib/asterisk/backups. The backup
files are identified by the backup names.
Backup itself is not useful if it cannot be restored. The freePBX developer has
thought of this too.
This is a very simple procedure. All you need to do is click on the Restore option.
Determine which of the various items in the list you want to restore and click on it and
your restore will be executed.
For security reason you should change the Admin password. To do this, click on 'My
Account' in the upper right-hand corner, then click on the 'Change Password' button
underneath 'Users: Administrator (Admin) in the center-left of the screen.
Change it to a new password and confirm your new password and click 'Save.'
Now it's time to set up your contacts. I will start off setting up a couple of my internal
extensions.
Click on 'My Account' again and then click the 'Edit' button.
Change 'Asterisk Phone Extension' to your Asterisk extension. My extension is 2001.
While you are at it, change your time zone and date format as well.
Click on the contacts tab and then select 'Create Contact' from the left hand Shortcuts
menu.
Firstname: Norsurya
Last name: Sharif
Home: 2002
Add another and another if you want to, using the method above.
At this point, you may find that you are unable to make a phone call through SugarCRM.
This is due to a little bug in the popup_picker.php (this bug may have been fixed by the
time you read this, but at the time of writing, this bug exists).
To fix this bug, you need to edit popup_picker.php by doing the following:
cd /var/www/html/crm/modules/Contacts
nano popup_picker.php
To
You should now be able to dial from SugarCRM to your other internal extensions and to
the outside world.
You can add multiple users who will each have their own settings/contacts etc.
You might be thinking, what do I want with a Openfire server, what use do I have for it.
You actually may be using products that already use the Jabber/XMPP protocol right now
such as Google Talk or similar. Jabber/XMPP is not just one product. It is the base for a
range of products that use XMPP and as it says, it is Extensible, which means that its
capabilities can be increased, especially with Plugins. One of those Plugins is the Asterisk
IM (Instant Messaging) which joins the Openfire server to the Asterisk Server and allows
them to talk. Naturally with any server product, you need a client before some
functionality is realized. There are literally heaps of clients that support the XMPP
protocol, but in particular, the one developed by the same developers that designed
Openfire, is called Spark. It doesn’t mean that it is the best and will suit everyone, but it is
able to showcase some of the capabilities of the Openfire server.
So what can we do with Openfire and the Asterisk IM Plug-in and a suitable desktop client
such as SPARK?
• Instant Messaging between people on your Network, even Networks joined by a Wide
Area Network.
• Instant messaging to external people, using the Openfire Gateway plug-in which
allows connection to other messaging systems such as (AIM, ICQ, MSN, Yahoo, etc).
• Presence monitoring. The system can monitor whether you are away from the
keyboard, offline, on the phone. This makes it easier for people to see whether to call
you or chat to you (if you are on the phone and it is urgent that they reach you).
Furthermore, with another additional Plug-in, you can publish this presence
information to a Web Page.
On paper it does not seem like a lot, but there are many more applications and Plug-ins
that work with Openfire, and it is up to you to decide whether they are suitable to you and
make it the product that you want. Even with those items alone, once implemented and
integrated into a Business, it makes a huge difference in the efficiency of a business.
So let’s get started.
Click on the CLICK HERE hyperlink and the following screen will appear after a short wait
(it is setting up the application for use).
This screen lets you setup your domain name for your system and must match the
domain name of your Elastix System. If you haven’t setup a domain name correctly on
your Elastix system, then drop out of this installation program and do it now. In this guide,
you will find a Brief Guide to Networking with Elastix, which explains in reasonable detail
how to setup Networking.
If you change the way your system is setup in terms of domain, at a later date, it will
break your Openfire application, and while it is possible to recover from this issue, it could
take you hours.
With the ports, leave them as they are. They are the default ports.
In this screen, you have two choices. The first one is a standard Database connection,
which unless you have done a large amount of database set-ups, including Java
nomenclature, then avoid this.
The second is the favourite, where you press a button and it does it all for you and allows
you to bring the product online with a minimal effort.
This screen allows you to choose where to store your users and groups. For most you will
select default, using the database to store your users and groups, which is fine for most
set-ups.
The other option is to use the LDAP protocol using and LDAP compliant system to store
the users and groups such as Microsoft Active Directory, or another Linux System, where
the users, passwords and groups are already implemented. Unless you are very familiar
with LDAP, leave it at default.
Enter your normal accessible email address as the admin email address. Now the
confusing part is that it asks for a password and password confirmation. It has nothing to
do with the email address. It is the admin password that you will use for the Openfire
system. - For a new user it would have made it easier to understand if they had separated it
(still keeping it on the same page as it is to do with the Admin Account), and gave a separate
explanation.
Make sure that you use a password that you know well, or at least write it down. You lose
it, and it is not a simple measure to recover it.
Click on continue
That’s the first part. You now have functional Openfire Server, which you can login in to
and setup further.
Click on LOGIN TO THE ADMIN CONSOLE and you will get the following screen, which
will allow you to login.
The next screen will confirm that you indeed have a functional Openfire Server running.
Don’t panic, there is a lot on this screen, but we will take you through the few basics that
you need. Don’t upgrade Openfire yourself; these updates will come from Elastix.
Remember that they have integrated it into the Elastix system, and there may be minor
tweaks to allow this to happen. These minor tweaks however, may be the difference
between your Openfire Server working or not working.
We are now going to add some Plugins into the system to make it functional. So in the
Openfire Console, click on the Plugins Tab, and the following screen will come up
So click on Available Plugins from the side menu and the following screen will appear.
What you see in this list is a list of all Plug-ins that have been registered with Openfire.
You may find this list increase, allowing you to add another new plug-in that might be
suitable for your system. You can click on the UPDATE NOW hyperlink, if you want to
confirm if there are any more available.
You can also manually upload Plugins, e.g. ones that are not part of the registered
Plugins, but we don’t require that at this stage.
You will note that the Green Plus sign turns into a little “Loading Timer”, and may take a
short while to install. Once completed, it will automatically remove itself from the screen,
as it has now ended up in the Plugins
Do the same for, IM gateway, Presence Service and SIP Phone Plugin if they exist in the
list. If you now click on the Plugins on the left menu, you will see the Plugins that you
have installed.
You can also delete the Plugins from this screen or restart them if you need to. You will
also notice that we now have a new tab at the top called ASTERISK-IM, which is the
result of installing the ASTERISK-IM plugin.
Click on that ASTERISK-IM Tab and the following screen will appear.
Now before we can go any further, we have to correct a bug in the Asterisk-IM Plugin,
otherwise we cannot connect the Openfire Server to the Asterisk system.
This means either using the Elastix System Console or using SSH to login to the Linux
system.
Once you are logged in, we need to edit a file, only a small change, but it needs to be
done. If you are well ahead and have already installed your favourite editor onto your
Elastix system, then use your favourite editor, but if not you can download and install
NANO, our favourite editor (see TOOLS section of this document on how to install
NANO).
cd /opt
cd openfire
cd Plugins
cd asterisk-im
cd database
nano asterisk-im_hsqldb.sql (if you are using nano)
Basically we have to remove the word unique from the third line as shown in the picture
above, which is causing the bug we spoke about previously.
Using arrow keys, just move along and use the delete keys so that your screen now looks
like the following
Once you hit CTRL X, you will get the following screen
Enter Y for yes, which means that we are going to save the changes and the following
screen will appear.
You have now completed the changes which will allows us to complete the Asterisk-IM
implementation.
Reboot your Elastix!!! – It is important that you do this so that it picks up the changes.
Now go back to your Elastix Web GUI, click on the IM tab to bring up OPENFIRE and
then click on the ASTERISK-IM Tab and then click on Add Server hyperlink which will
take us to the following screen.
Click on Create Server and if everything is successful, you should see the following
screen
Take special note of the green dot next to the name of our Elastix box. If it is green then
the Openfire server has a working connection to our Elastix Server. If the server address
is missing altogether, then you either did not reboot the Elastix Server (which meant the
bug fixes are not applied), or you have not edited the file correctly.
So if you have the green dot, you now have a working Openfire Server connected to your
Elastix Server. All we need to do now is add users and install the client on the desktops.
Click on users and groups tab at the top and the following screen will appear
Only the admin user will appear. We now need to create users for your system. Click on
create new user on your system. And the following screen will appear.
Fill in the details for each user you want to connect to Openfire. Keep the usernames in
lower case (makes it easier), fill in their proper name, their current email address, and
provide them with a password. This password does not have to match anything, it will be
used by the client that resides on their desktop to connect to the Openfire server.
After you have done this, you should see the screen (we have only done one user) like
this
We have now setup one user on the system. For the system to recognise when we are on
the phone, we need to map the user to an extension
We do this by clicking again on the Asterisk-IM Plugin Tab and then clicking on Phone
Mappings on the left menu. You should see a screen like so:
Username is the username you setup, in this case it was bob (remember I said to setup in
lowercase, it just makes it easier, as the system will not recognise if you use an
uppercase char, it sees it has a different login).
The device is the actual phone, and you should be able to drop down the box and it will
show extensions that you have in your Elastix System. If it doesn’t show, then you can
enter it manually (e.g. for our one user we would add SIP/301). Then add the extension
number which is the same, without the SIP/, so we would enter 301 in here, and then a
caller ID. I normally enter 301 in here as well. You can click on the primary field as well if
you like, but it is not crucial. This does have a purpose, but it is for more complex
systems, which are beyond the scope of this document.
After you have pressed the add button, you should see the following user setup
Install it as per default install instructions. And you should end up with the following
screen
Username: bob
Password: (the password you setup for that user)
Server: Your server DNS (or DynDNS)
And then click on Login. If all is successful, you will end up with the following screen
Note. In the mode that we have shown, you will have to accept users and they you, before they
will show up on your list (very much like ICQ and similar).
If this is not what you want, and you want all the people that are on your local Network to
be immediately available to each SPARK user, then you can set them into Groups (a
subject we did not broach).
If you go back to Openfire Users and Groups Tab, create a Group Name and add the
selected users to the Group and they will be immediately available to communicate with if
they are members of that group.
There are many more features, and functions within Openfire. It deserves a book all by
itself, which again is not the purpose of this document. We hopefully have provided
enough to get you started, so that you can explore Elastix and the integrated Openfire
server.
Again like most items included in Elastix, they have designed an interface, to reduce the
amount of “manual” changes to configuration files.
However, having said that, the topic of setup of email is never easy, as everyone’s
Network and Mail host/design, and even ISP are different, so it is impossible to describe a
step by step setup that will suit all, and some manual changes may be required.
To this end, we are going to discuss the setup of four types of Email setup. These are:
1. Email Directly Via Postfix – using your Elastix Postfix to send out mail direct
using Postfix as a SMTP Server (including relaying via your ISP/Webhost)
2. Email Directly Via Postfix with Authorisation - Setup of Elastix postfix to relay
mail via your external mail server which requires SMTP-Auth
3. Email via your local Mail Server - Using your local Network Mail server. This is
typical of most business networks where they have a proper Network
infrastructure, with Internal DNS Server, Mail Server (Microsoft Exchange or other
completely configured mail server e.g. Postfix, Sendmail, QMail etc)
4. Email using your Elastix Postfix Server and Roundcube – This works on the
basis that you have a domain name and you choose to make the Postfix Server
the actual mail server for that domain.
Before we start, I just want to cover a small bit of concept, which may make it easier as
you read the following sections.
One of the biggest misconceptions, especially from people new to the area of mail
servers is the use of the domain names. I have seen network systems setup to use the
external domain name that their company owns, as they believe that is the one that they
are supposed to use.
You will note that this guide talked about the .local domain. It is a “dummy” domain
basically. It still meets all the needs of a domain name and DNS internally, but it is not
routable, in other words it does not have a root name server in the Internet, unlike the
.com, .com.au, .net, .org etc.
The .local is a domain name that we can use locally on our network, very similar to the
private IP address ranges that we use, that are generally not routable on the internet. Just
because we have used the .local domain name, does not mean it cannot handle parts of
the .com domain name as well. As you will see from this guide, our .com Website, can
reside on a Webserver somewhere on this Internet, while our mail server can reside on
our Elastix Server, in a different location.
SMTP Server
mail.myrealdomain.com
Myrealdomain.local
Not the best of diagrams I must admit, but hopefully it will give you a slightly more
conceptual idea of what we are discussing.
It is important that we get that piece understood, as I have seen so many incorrect or very
flawed installations, based on the misunderstanding of this concept, which eventually lead
to kludges and fixes, that finally breakdown and leave the person feeling like the system
is unreliable. Getting your wires crossed on the domain name issue can cause you untold
internal strife.
For many, this is also where it fails. It can fail for the following reasons:
1. The ISP Blocks port 25 for sending email directly in an effort to force you send
the email to route through their SMTP Server. What they do is block port 25 to all
addresses except their own mail server.
2. You ISP mail host rejects your mail, because it is leaving your system with your
local domain name as the sender. It rejects it as it is not a valid domain.
3. Even after you make some configuration changes, your ISP rejects the email
because they want you to authenticate, in other words use SMTP-Auth.
4. Another peculiar one, which people get confused with, as only some of their mail
is rejected and other emails get through is the ISP/Webhost use of the POP
before SMTP. What this means is that instead of putting on SMTP Auth, they
work on the basis that your normal Mail client that you run on your workstation,
normally performs a receive and then performs a send straight after. Basically
they use the POP3 receive mail (which usually involves your mail client providing
your login and password to receive email), and as long as an SMTP send is
performed with 30 seconds of the POP3 receive, from the same IP address, they
will let the SMTP mail out, without Authentication. The issue arises in that with
your Postfix server, you are not performing a receive at anytime using POP3, so
this method will normally fail. What becomes confusing is that sometimes it will go
through, and this is usually, especially in the case of a network that uses external
You might wonder why all the hassle with trying to send email via your own server, but
over the last few years it has become necessary as ISP/Webhosts have tried to stem the
spread of SPAM email. In some cases, it is a legal requirement. If they do not try to limit
the SPAM coming out of their system, or IP addresses that they have control over, they
can be seen as promoting SPAM, which in turn can lead to possible legal ramifications.
If on your initial installation of Elastix, your emails work then great, you are probably one
of the lucky ones that can send out email direct, but they are generally not the rule.
So that we don’t go off on the wrong track, it is necessary to look at the mail log to see
why your email failed. In most cases it will tell you what went wrong. You will need to SSH
into your system and get to the Linux Operating System or use your Console screen after
you have logged in. The file you want to look for is /var/log/maillog. So at the prompt
type less /var/log/maillog, and scroll up and down until you find the error close to the
time and date that the system tried to send an email. You will usually identify easily as it
will also have the email address in it, where the email was supported to go.
An example of a log file from a system that cannot send an email is as follows:
So now we know it is not going to work in a default mode, so we have to make some
changes to the Postfix config file. We are now going to tell Postfix to route the mail via our
ISP’s mail server. Your ISP is going to be whomever you have an Internet connection
through e.g. Verizon might be mail.verizon.com, Westnet might be mail.westnet.com.au
(which is the one that we are using). So the changes in the next part include a relay host
(in other words a place that we route mail through), and the correct setup of the domain
names for the mail. The file is found in the /etc/postfix directory and is called main.cf. So
issue the following commands
cd /etc/postfix
nano main.cf
Change
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
to
myhostname = elastix1.myrealdomain.local
#myhostname = virtual.domain.tld
to
mydomain = myrealdomain.com.au
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
change to
#relayhost = $mydomain
#relayhost = [gateway.my.domain]
relayhost = mail.westnet.com.au (remember to take the # out and make it your ISP)
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
After you have completed the config changes, then issue the following command.
postfix reload
After this, it was expected that we should be working, but upon looking at the logs we got
the following:
The issue was the sender address, our ISP rejected it on the grounds that it recognises
that the sender address is not a valid domain.
We finally found the issue was down at the bottom of the main.cf file. The developers in
their wisdom have written these entries down the bottom of the file, not where I normally
expect them, so basically they were overwriting the ones we had set above. From what I
can read, they have been included for Webadmin??
So you need to change the main.cf file again and also add them to the bottom.
################################
#Ingresado por yb-webadmin
mydomain =myrealdomain.com.au
myhostname = elastix.myrealdomain.local
Save it and do a postfix reload again, and lets look at the mail log again after leaving a
voicemail to email or fax to email, and see what a proper one looks like.
That’s it for the first method of implementing the mail system using the Direct From
Postfix method. Test your fax to email and also your voice to email. It uses the same
method and should function well.
Another time this is required, is when you cannot use your ISP’s SMTP server (due to
ongoing issues with your ISP SMTP Server or similar (e.g. timeouts etc), and you wish to
use the Webhosts mail server, where your POP accounts currently reside.
Understandably, almost very Webhost requires you to use SMTP-Auth to move your mail
through their SMTP Server (or they use the method previously spoken about which is
POP before SMTP).
So to start with, you would have performed almost everything in the previous section on
using email via PostFix directly, and you have use the following line in main.cf.
instead of pointing it to your ISP Mail Server, and now you are up to the point where your
mail log file is showing the following or similar, but the important line is 550 - Verification
Failed.
So, we now have to setup Postfix for SMTP-Auth which we will describe in this section.
Right now we are going to create a password file in /etc/postfix directory by doing the
following:
nano /etc/postfix/sasl_passwd
mail.mywebhost.com.au loginname:password
save the file, that’s the first part. Now we are going to convert this to a database for
Postfix to read by the following command
postmap hash:/etc/postfix/sasl_passwd
Now to add the final bit of information for the process to work, so edit the main.cf in the
postfix directory, by the following command
nano /etc/postfix/main.cf
and save the file. Now to reload Postfix and try your SMTP-Auth mechanism, so reload by
the command
postfix reload
and test it out, remembering to check the /var/log/maillog after each send to confirm what
is actually happening.
If indeed you needed to authenticate this, should get you up and running, but just in case,
there are plenty of resources on the Web about this process, so have a look.
Postfix will try and determine the MX address, which if the DNS Server is configured
correctly, it will respond with the Internal Mail Server in your organisation. As a guide,
anyone running Microsoft Server Suite, especially Small Business Server, is probably
setup in this way by default. So as soon as Postfix gets a reply, it sends mail out via that
Server.
As it is an internal server, you will probably find it is a little more forgiving on Senders
email addresses, but that it purely dependent on the version, and how strict the IT
administrator is and whether he has really locked it down.
If this is the case, you may find that you may have to utilise a couple of methods in the
previous chapters. As an example, Microsoft Exchange server can be configured to allow
unauthenticated SMTP mail to pass through as long as it is from their local range of LAN
IP addresses. Others say that you must authenticate, and have removed the ability to
send mail without authentication. This means that you need to get a mail user (or an
existing user) setup on the mail server, and use the SMTP –Auth method described in the
previous section.
There is not much else, other than performing faultfinding with the logs, as described
previously.
There are a few prerequisites for this implementation to be successful, these are
1. Ability to send email by SMTP (if you have managed to get one of the Email
Direct or Email by SMTP Auth methods functioning, then you have it covered.
2. You need a real domain name and you need someone to host your DNS. Now
many of the Domain registrars offer this service, and usually include enough
3. With these Webhost/DNS providers, you need the ability to redirect the MX
record to your Elastix box. Some have it in the form of a management page for
your domain name, whereas some others can perform the change on request.
So lets start, go to the Elastix GUI and click on the Email tab and then the domain tab
2 1
You should see an empty domain list, which is correct. Click on the Create Domain
button.
You will now see the next screen asking for the domain name.
2 1
Now, you should have a domain name registered by now, and for this example, we are
going to use elastixconnection.com as the domain name that we have just registered.
Naturally you replace this with the one that you hopefully have registered.
So in the box, we are going to type elastixconnection.com and click on SAVE and the
following screen will appear
This shows the domain name and the number of email accounts against this domain
name. This mail server can handle multiple domains, but for this guide we will stick to
one.
Click on the Accounts tab, and select the new domain you setup from the drop down box
next to the word Domain as per the following screen.
Now click on Create Account button, which will provide you with the following screen.
Fill in the details, which are fairly straightforward. First is the email address that you want
to setup, set a password, and then set a quota, which be aware, is in Kb, hence the
20000 that has been entered above will provide a quota of 20Mb.
Click on Save and the following screen will appear showing your email address setup.
Naturally, if you have more users, then, keep setting them up, there is basically no limit
except space and I suppose CPU cycles used. Take note of the account name. As an
example the one in the screen above is bob.elastixconnection.com, which is a slightly
different to what I have been used to over the years.
You will also need to determine the relay server for your network. In this case normally
your local server and therefore we will accept the default that was provided. If you have
other relay servers, this is where you defined them.
Now click on the Webmail Tab and the following screen will appear.
You are now looking at your Webmail screen. Before you get too excited and start
sending emails, we still have a little work to do.
Up in the right hand top corner of the Webmail screen, you will see the Personal Settings
link, click on this and the following screen will appear.
Correct the Time Zone information for area and click save. Now click on the Identities Tab
and the following screen will appear.
To do this click on the New Identity Button and the following screen will appear.
In terms of setup of the Webmail system, that’s it, unless you have more users to setup
which will be setup identical to the one we have run through as an example.
At this point, you will not receive any mail, as all the Mail servers throughout the world,
don’t know anything about your mail server at the moment. This is where the DNS MX
records come into play.
We now need to either set a MX record to point to your Elastix Server. As mentioned, a
Control Panel of your Webhost facilities or DNS Registrar can sometimes do this.
As an example, some o f the Webhosts running the latest CPanel software, now have MX
record editing capabilities built in. Everyone’s system is different, and definitely not within
the scope of this document, but speaks to your Webhost or registrar and in almost all
cases they will understand what you are after.
Correct DNS implementation dictates that DNS MX records must point to a Fully Qualified
Domain Name (FQDN), not directly to an IP address. What this means is that you could
point your MX record to a dynamic DNS name. Also I have not tested it, but it is
understood that Dyndns and ZoneEdit amongst many others, have the ability to manage
your MX records, for either a small fee or in the case of ZoneEdit, a few domain names
for free. If you are using a dynamic IP address, I recommend doing a bit of research as I
have not used these services for many years, but based on knowledge, it is all feasible.
One last thing, make sure that you have port 25 (SMTP) on your Internet router forwarded
to your Elastix Mail server to allow the mail server to receive the mail.
g729 does not come preinstalled with Asterisk – you will need to purchase it.
So the more bandwidth you have, the less need for a higher compression ratio and the
less powerful the CPU that will be needed.
Most VoIP providers/hardware/licensed software will support G711 and G729 (However
be sure to check this before purchasing hardware, or signing up with a VoIP provider!),
with G711 requiring almost 3 times as much bandwidth, and providing excellent quality
and the G729 providing quality similar to a good mobile call but using less bandwidth.
Below are the approximate bandwidth requirements for Several Common VoIP
Compression Algorithms using SIP. They vary slightly depending on the protocol used.
The following links will give you some indications of the bandwidth usage of the various
codecs that you may be using or contemplating on using.
http://www.asteriskguru.com/tools/bandwidth_calculator.php
http://www.cisco.com/en/US/tech/tk652/tk698/technologies_tech_note09186a0080094ae2.shtml
http://www.voip-calculator.com/calculator/lipb/
http://www.connect802.com/voip_bandwidth.php
http://www.newport-networks.com/pages/voip-bandwidth-calculator.html
There are others. All you have to do is Google for them ☺
DISCLAIMER:
You might have to pay royalty fees to the G.729/723 patent holders for using their
algorithm.
Before downloading the codec module you need to verify what your processor type is,
as to get a compatible compiled codec.
# cat /proc/cpuinfo
Look specifically at the model name and the flags. The following is an example of the
process that I am using.
Process: 0
vendor_id: GenuineIntel
cpu family: 6
model: 8
model name: Pentium III (Coppermine)
stepping: 3
cpu MHz: 648.110
cache size: 256 KB
fdiv_bug: no
hlt_bug: no
f00f_bug: no
coma_bug: no
fpu: yes
fpu_exception: yes
cpuid level: 2
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 mtrr pge mca
cmov pat pse36 mmx fxsr sse
bogomips: 1297.41
From this information we can see that it is a Pentium III processor and it is using sse.
This is the 2 bits of required information that we need. If you don’t see sse in your
flag then the file you need must contain the words no-sse.
So from the information above to obtain the G729 codec we need to get the file
codec_g729-gcc-pentium3.so and for the G723 codec we need to get the file g723-
gcc-pentium3.so
The gcc represents the way the module was compiled. This is your most likely
choice. To view the different type of compiled version look at this file
http://kvin.lv/pub/Linux/Asterisk/README
Now that we know what file we need you can now download the appropriate file.
# wget http://kvin.lv/pub/Linux/Asterisk/built-for-asterisk-
1.2/codec_g729-gcc-pentium3.so
For Pentium IV
# wget http://kvin.lv/pub/Linux/Asterisk/built-for-asterisk-
1.2/codec_g729-gcc-pentium4.so
# wget http://kvin.lv/pub/Linux/Asterisk/built-for-asterisk-
1.2/codec_g723-gcc-pentium3.so
For Pentium IV
# http://kvin.lv/pub/Linux/Asterisk/built-for-asterisk-
1.2/codec_g723-icc-pentium4.so
If Asterisk does not start then you may need to try icc files instead of gcc.
I have also pre-recorded a voice prompt to instruct the caller what to do after the second
dial tone.
;##############################################
; To get outside line through ZAP - Ben 22-12-2005
; after dialling 0 will get a second dial tone.
; Then dial the number required.
; No need to press the send button after the second number dialled
;##############################################
The example above is based on systems that have Zaptel card (e.g. TDM400 or
X100P etc.) installed. Note:* If you're using a PRI line, you need to enable 'overlapdial'
in /etc/asterisk/zapata.conf for this to work.
Using SPA3K will be a little tricky. I am describing how I got around it (assuming that
you have set up the SPA3K as described in this document), however there maybe
other method.
1. In the SPA Line 1 Tab, I have included the following entry in the dialplan:
<0:#><:@gw0>)
(**|*xx|xx.|<0:#><:@gw0>)
;##############################################
; To get outside line through SPA3K - Ben 25-12-2005
; after dialling 0 will get a second dial tone. Then dial the
; number required. No need to press the send button again
;##############################################
Every time when I dial ‘0’, the SPA3K will send it to Gateway 0, which is the PSTN
line and present me with a second dial tone.
Imagine what will happen if you want to use the PSTN line to call emergency 000 (in
Australia) and someone else was hogging the line. The sensible way is for Asterisk to
disconnect the line and allow you to make the emergency call instead.
The following method will provide you with the facility, however you need to do some
editing to the extensions_custom.conf file in /etc/asterisk.
;###################################################
; Give priority to emergency number by disconnecting existing user
; if using the PSTN line first, otherwise simply call the emergency number.
;###################################################
exten => 000,1,Background(calling-emergency) ; voice warning
exten => 000,2,Wait(1) ; give caller a chance to hang up
exten => 000,3,Dial(Zap/1/000,,j) ; If ZAP 1 is busy, jump to n+101
exten => 000,4,Hangup() ; hang up after the call
exten => 000,104,Softhangup(Zap/1-1) ; hang up the line if being used
exten => 000,105,Goto(3) ; make call after disconnecting the other user
I am using the LinkSys WRT54G wireless router. In the example below, I have forwarded
all the ports mentioned above to my asterisk box IP, which is 192.168.1.101
I use the Linksys™ WRT54G®. Taking the easy way out, I simply restrict the PCs (see
below) that more often than not will be used as a P2P client or chatting on the MSN chat
channels.
My recommendation is, if your router has the function, use it. At the very least, it will
prioritise traffic within your own LAN especially when you have sons and daughters (for
that matter you too can be the culprit) who are always on the P2P, leeching files and
music.
This may not be the best solution. If anyone has a better solution for the Linksys
WRT54G, please let me know.
yum –y update or
yum update elastix
When you execute the command, you will see a screen similar to the one illustrated
below.
At the end of it, it will tell you that your update is completed.
amportal restart
There are 2 ways to upgrade freePBX as explained at the aussievoip website here
http://www.aussievoip.com/wiki/freePBX
Either one will be fine but I would like to suggest that you take the all-in-one version with
modules and be done with it. Afterall, this is the method recommended if one is on a
To conduct this upgrade, you will need to log on to the Elastix box as root.
cd /usr/src/
wget http://mirror.freepbx.org/freepbx-2.4.0.tar.gz (or whatever the new
version is)
tar zxvf freepbx-2.4.0.tar.gz
cd freepbx-2.4.0
./install_amp
Once this is done, freePBX is now upgraded to version 2.4.0 and you can start managing
and/or upgrading the freePBX modules.
42.1 WEBMIN
Webmin is an invaluable web based tool for managing a Linux box. Webmin make it easy
to configure application like SMTP mail, editing files etc.
Webmin is not installed as default in Elastix but user can download and install it manually.
Log in to the Elastix box as root and do the following at the command prompt:
wget http://internap.dl.sourceforge.net/sourceforge/webadmin/webmin-1.410-
1.noarch.rpm
I have found the above method is straightforward and simple. However there are some
users who found that following an alternative method is simpler. If that is the case, the
alternative installation method can be found here:
http://www.terrasoftsolutions.com/support/solutions/ydl_general/webmin.shtml
Once installed, you may connect to Webmin remotely through your browser using the
following address https://<YourAsterisk_IPAddress>:10000. E.g.
192.168.0.101:10000
If you would like to avoid clashing the port with your RTP port which is 10000 – 20000,
you may edit the file /etc/webmin/miniserv.conf and change the port value to something
else, such as 9000.
Port=10000
Port=9000
The alternative is to edit the /etc/asterisk/rtp.conf file like the example below and you
can keep https://192.168.0.101:10000
[general]
;
; RTP start and RTP end configure start and end addresses
;
rtpstart=10000 < - - change this to 10002(totally unnecessary.. ☺)
rtpend=20000
42.2 PUTTY
PuTTY is a free implementation of Telnet and SSH for Win32 and Unix platforms, along
with an xterm terminal emulator.
It is written and maintained primarily by Simon Tatham and can be downloaded from the
following link.http://www.putty.nl/download.html
42.3 WINSCP
WinSCP is an open source freeware SFTP client for Windows using SSH. Legacy SCP
protocol is also supported. Its main function is safe copying of files between a local and a
remote computer.
http://winscp.net/eng/index.php
42.4 NANO
A simple editor called NANO, which for the novice Linux user is far simpler to understand
and control than the standard VI that comes with the Elastix Distribution.
Since Nano is not included in the Elastix distribution, it need to be downloaded and install
manually. To do that you must log in to Elastic as user root.
So once you are logged into your Elastix Server either at the console or via SSH, you
need to issue a command yum install nano similar to the following screen.
After a few lines flick by (this may take up to a minute or so), it will then ask you if it is ok
to install nano which you will reply with a Y. Once completed you will then have Nano on
your system.
PhpMyAdmin is a web interface for managing your MySQL server. Unfortunately it is not
included in the Elastix distribution. If you want to use this tool, you will need to download
it from The phpMyAdmin Project for their latest version.
1. Log in to your Elastix server, either at the console or using putty, as root.
2. Using nano, create a dbadmin directory in /var/www/html/modules
cd /var/www/html/modules
mkdir dbadmin
3. After unpacking the phpMyAdmin file that you downloaded, copy the entire
content to /var/www/html/modules/dbadmin
4. Create a text file called config.inc.php in /var/www/html/modules/dbadmin
nano config.inc.php
<?php
/* Servers configuration */
$i = 0;
?>
Once this is done, you may log in to phpMyAdmin with your browser using the following
address: http://<your.elastix.address>/modules/dbadmin (eg: http://192.168.1.101/modules/dbadmin).
You will be asked to enter the username and password. Use root as the username and
eLaStIx.2oo7 as the password and you can now start using the phpMyAdmin.
Config files manual tweaks in this guide are meant for advanced users.
Unless you have a compelling reason to do so, users are advised against
any manual config file tweaks.
Just as you think that all is OK, you realized something else requires attention. This is
true with Elastix as well.
To do this we may need to edit some configuration files (.conf) that reside both in the
/etc/asterisk directory and /etc directories. Configuration files in the /etc/asterisk are
generally editable through File editor.
To start editing the .conf files we need to select the PBX tab and select the Tool option
followed by File Editor selection from the menu as illustrated below.
You may need to navigate through the pages to find the file you wish to edit from the
resulting screen.
Select the file you wish to edit e.g. zapata.conf (marked with red arrow) and we will see a
new screen below which can be edited manually.
Every time you update freePBX, there is a good chance that changes or
additions you have made in sip.conf will be overwritten. To avoid this,
all additions I wish to make in sip.conf are made in sip_custom.conf
43.1.1 sip.conf
Lets make a slight change in sip.conf. We believe, the position of the #include
sip_nat.conf should be placed more towards the beginning of the file. Instead of
deleting the line from the original position at the bottom of sip.conf, we simply
commented it out and added it towards the beginning of sip.conf but underneath the
bindport and the bindaddr as shown below.
; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn't, try adding "nat=1" to each peer definition to
; solve translation problems.
[general]
#include sip_general_additional.conf
disallow=all
allow=ulaw
; enable and force the sip jitterbuffer. If these settings are desired
; they should be set in the sip_general_custom.conf file as this file
; will get overwritten during reloads and upgrades.
;
; jbenable=yes
; jbforce=yes
43.1.2 sip_custom.conf
language=au
videosupport=yes
allow=g729
allow=g723
allow=h261
allow=h263
allow=h263p
Every time you update freePBX, there is a good chance that changes or
additions you have made in iax.conf will be overwritten. To avoid this, all
additions I wish to make in iax.conf are made in iax_custom.conf
43.1.3 iax_custom.conf
;externip = <your fixed external IP> or (one or the other NOT both)
externhost = <your DynDNS name>
localnet = 192.168.1.0/255.255.255.0
43.1.4 indications.conf
[general]
country = au ; (The default is country = us, therefore replace “us” with “au”)
43.1.5 enum.conf
[general]
;
; The search list for domains may be customized.
; Domains are searched in the order they are listed here.
;
search => e164.arpa
search => e164.org
43.1.6 extensions_custom.conf
If you have a ZAP trunk and you want to get an external line and be presented with a
dial tone first before you dial the external line, you may add the following codes in the
extensions_custom.conf file.
This will allow you to dial 0 and you will get a second dial tone from PSTN. Following
which you can dial a PSTN number that you wish to call.
/var/www/html/recordings
/var/www/html/_asterisk
You can either use WinSCP to create these directories or use Nano.
When you start Elastix or when you do amportal restart and if you see the following errors
means that you will need to create those directories.
We will endeavour to list troubleshooting tips as we experience them (or those suggested
by other users). These will be added progressively as we encounter them.
Asterisk –rvvvv (the “v” depends on the level of verbosity you need)
Studying the activities will give you an indication of what has gone wrong.
This also applies to all other ATAs, FXS devices such as the various routers with built-in
FXS ports and IP Phones that has their own feature codes built-in. Unless these feature
codes are disabled, they are likely to clash with Asterisk's feature codes and as such
Asterisk feature codes will not give you the desired results.
A quick fix for ELASTIX is to create an Inbound Route with the DID and CID field left
blank. At least this will let incoming calls through while you try to solve the problem.
Only one catch with this: if you put somebody on hold for longer than the above settings,
if they don't make any noise, it will hang up.
44.8 VIRTUAL FAX LIST DOES NOT DISPLAY EXISTING VIRTUAL FAX.
An error in one of the lines of /var/www/html/libs/paloSantoFax.class.php (in line 146)
caused this problem.
if(is_array($result))
to
if(isset($result))
My VOIP Network
IBM
Internet
PSTN
8 Ports router
192.168.1.1
SPA3000
TALK / DATA
TALK RS CS TR RD TD CD
Broadband Modem
192.168.1.10
1 2 3
4 5 6
7 8 9
* 8 #
C3010-2E
192.168.1.11 PC
Asterisk PC (IPBX) 192.168.1.21
192.168.1.101
1 2 3
4 5 6
7 8 9
* 8 #
C3010-2E
192.168.1.12
PC
PC using SoftPhone 192.168.1.22
(X-Ten) 1 2 3
4 5 6
192.168.1.20 7 8 9
* 8 #
C3010-2E
192.168.1.13
# Directory
## In-Call Asterisk Blind Transfer
** Call Pickup
*0 Speed Dial Prefix
*1 In-Call Asterisk Toggle Call Recording
*2 In-Call Asterisk Attended Transfer
*11 User Log on
*12 User Log off
*28 Day/Night toggle
*30 Blacklist a number
*31 Remove a number from the blacklist
*32 Blacklist the last caller
*34 Perform dictation
*35 Email completed dictation
*43 Echo Test
*52 Call Forward No Answer/Unavailable Activate
*53 Call Forward No Answer/Unavailable Deactivate
*54 User Intercom Allow
*55 User Intercom Disallow
*60 Speaking Clock
*65 Speak your Extension number (your extension is XXX)
*69 Last Caller number/ID (Call trace)
*70 Activate Call Waiting (deactivated by default)
*71 Deactivate Call Waiting
*72 Call Forwarding System
*73 Disable Call Forwarding
*74 Call Forward all prompting deactivate
Those who are familiar with the Wakeup-Call feature witll find that the feature is
missing. This is relatively easy to remedy as the necessary agi is included within this
distribution although not included in the feature.
To recover this functionality, all you need to do is simply include the following (in bold)
in your extensions_custom.conf file as per my example below. Place it directly
under the [from-internal-custom] context.
[from-internal-custom]
[at]
ringcadence = 1000,5000
dial = 420
busy = 420/400,0/400
ring = 420/1000,0/5000
congestion = 420/200,0/200
callwaiting = 420/40,0/1960
dialrecall = 420
record = 1400/80,0/14920
info = 950/330,1450/330,1850/330,0/1000
stutter = 380+420
[br]
ringcadence = 1000,4000
dial = 425
busy = 425/250,0/250
ring = 425/1000,0/4000
congestion = 425/250,0/250,425/750,0/250
callwaiting = 425/50,0/1000
dialrecall = 350+440
record = 425/250,0/250
info = 950/330,1400/330,1800/330
stutter = 350+440
[be]
ringcadence = 1000,3000
dial = 425
busy = 425/500,0/500
ring = 425/1000,0/3000
congestion = 425/167,0/167
callwaiting = 1400/175,0/175,1400/175,0/3500
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = 900/330,1400/330,1800/330,0/1000
stutter = 425/1000,0/250
[ch]
ringcadence = 1000,4000
dial = 425
busy = 425/500,0/500
ring = 425/1000,0/4000
congestion = 425/200,0/200
callwaiting = 425/200,0/200,425/200,0/4000
dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
record = 1400/80,0/15000
info = 950/330,1400/330,1800/330,0/1000
stutter = 425+340/1100,0/1100
[cl]
ringcadence = 1000,3000
dial = 400
busy = 400/500,0/500
ring = 400/1000,0/3000
congestion = 400/200,0/200
callwaiting = 400/250,0/8750
dialrecall = !400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400
record = 1400/500,0/15000
[cn]
ringcadence = 1000,4000
dial = 450
busy = 450/350,0/350
ring = 450/1000,0/4000
congestion = 450/700,0/700
callwaiting = 450/400,0/4000
dialrecall = 450
record = 950/400,0/10000
info = 450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400
stutter = 450+425
[cz]
ringcadence = 1000,4000
dial = 425/330,0/330,425/660,0/660
busy = 425/330,0/330
ring = 425/1000,0/4000
congestion = 425/165,0/165
callwaiting = 425/330,0/9000
dialrecall =
!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660
record = 1400/500,0/14000
info = 950/330,0/30,1400/330,0/30,1800/330,0/1000
stutter = 425/450,0/50
[de]
ringcadence = 1000,4000
dial = 425
busy = 425/480,0/480
ring = 425/1000,0/4000
congestion = 425/240,0/240
callwaiting =
!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/
200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0
dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
record = 1400/80,0/15000
info = 950/330,1400/330,1800/330,0/1000
stutter = 425+400
[dk]
ringcadence = 1000,4000
dial = 425
busy = 425/500,0/500
ring = 425/1000,0/4000
congestion = 425/200,0/200
callwaiting = !425/200,!0/600,!425/200,!0/3000,!425/200,!0/200,!425/200,0
dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
record = 1400/80,0/15000
info = 950/330,1400/330,1800/330,0/1000
stutter = 425/450,0/50
[ee]
ringcadence = 1000,4000
dial = 425
busy = 425/300,0/300
[es]
ringcadence = 1500,3000
dial = 425
busy = 425/200,0/200
ring = 425/1500,0/3000
congestion = 425/200,0/200,425/200,0/200,425/200,0/600
callwaiting = 425/175,0/175,425/175,0/3500
dialrecall = !425/200,!0/200,!425/200,!0/200,!425/200,!0/200,425
record = 1400/500,0/15000
info = 950/330,0/1000
dialout = 500
[fi]
ringcadence = 1000,4000
dial = 425
busy = 425/300,0/300
ring = 425/1000,0/4000
congestion = 425/200,0/200
callwaiting = 425/150,0/150,425/150,0/8000
dialrecall = 425/650,0/25
record = 1400/500,0/15000
info = 950/650,0/325,950/325,0/30,1400/1300,0/2600
stutter = 425/650,0/25
[fr]
ringcadence = 1500,3500
dial = 440
busy = 440/500,0/500
ring = 440/1500,0/3500
congestion = 440/250,0/250
callwait = 440/300,0/10000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330
stutter =
!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/10
0,!0/100,440
[gr]
ringcadence = 1000,4000
dial = 425/200,0/300,425/700,0/800
busy = 425/300,0/300
ring = 425/1000,0/4000
congestion = 425/200,0/200
callwaiting = 425/150,0/150,425/150,0/8000
dialrecall = 425/650,0/25
record = 1400/400,0/15000
info =
!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1
400/330,!1800/330,!0/1000,0
[hk]
ringcadence = 400,200,400,2000
dial = 350+440
busy = 480+620/500,0/500
ring = 440+480/400,0/200,440+480/400,0/2000
congestion = 480+620/250,0/250
callwaiting = 440/100,0/4000
dialrecall = 300/1500,0/500
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330
[hu]
ringcadence = 1250,3750
dial = 425
busy = 425/300,0/300
ring = 425/1250,0/3750
congestion = 425/300,0/300
callwaiting = 425/40,0/1960
dialrecall = 425+450
record = 1400/400,0/15000
info =
!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1
400/330,!1800/330,!0/1000,0
stutter = 350+375+400
[il]
; Source: libtonezone.
description = Israel
ringcadence = 1000,3000
dial = 414
busy = 414/500,0/500
ring = 414/1000,0/3000
congestion = 414/250,0/250
callwaiting = 414/100,0/100,414/100,0/100,414/600,0/3000
dialrecall = !414/100,!0/100,!414/100,!0/100,!414/100,!0/100,414
record = 1400/500,0/15000
info = 1000/330,1400/330,1800/330,0/1000
stutter =
!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/16
0,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,414
[in]
; Source: libtonezone.
description = India
ringcadence = 400,200,400,2000
dial = 400*25
busy = 400/750,0/750
ring = 400*25/400,0/200,400*25/400,0/2000
congestion = 400/250,0/250
callwaiting = 400/200,0/100,400/200,0/7500
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0/1000
stutter =
!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35
0+440/100,!0/100,!350+440/100,!0/100,350+440
[it]
[jp]
; Source: libtonezone.
description = Japan
ringcadence = 1000,2000
dial = 400
busy = 400/500,0/500
ring = 400+15/1000,0/2000
congestion = 400/500,0/500
callwaiting = 400+16/500,0/8000
dialrecall = !400/200,!0/200,!400/200,!0/200,!400/200,!0/200,400
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
stutter =
!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/10
0,!0/100,400
[lt]
ringcadence = 1000,4000
dial = 425
busy = 425/350,0/350
ring = 425/1000,0/4000
congestion = 425/200,0/200
callwaiting = 425/150,0/150,425/150,0/4000
dialrecall = 425/500,0/50
record = 1400/500,0/15000
info =
!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1
400/330,!1800/330,!0/1000,0
stutter =
!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10
0,!0/100,425
[mx]
ringcadence = 2000,4000
dial = 425
busy = 425/250,0/250
ring = 425/1000,0/4000
congestion = 425/250,0/250
callwaiting = 425/200,0/600,425/200,0/10000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = 950/330,0/30,1400/330,0/30,1800/330,0/1000
stutter =
!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35
0+440/100,!0/100,!350+440/100,!0/100,350+440
[no]
ringcadence = 1000,4000
dial = 425
busy = 425/500,0/500
ring = 425/1000,0/4000
congestion = 425/200,0/200
callwaiting = 425/200,0/600,425/200,0/10000
dialrecall = 470/400,425/400
record = 1400/400,0/15000
info =
!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1
400/330,!1800/330,!0/1000,0
stutter = 470/400,425/400
[nz]
ringcadence = 400,200,400,2000
dial = 400
busy = 400/250,0/250
ring = 400+450/400,0/200,400+450/400,0/2000
congestion = 400/375,0/375
callwaiting = !400/200,!0/3000,!400/200,!0/3000,!400/200,!0/3000,!400/200
dialrecall = !400/100!0/100,!400/100,!0/100,!400/100,!0/100,400
record = 1400/425,0/15000
info = 400/750,0/100,400/750,0/100,400/750,0/100,400/750,0/400
stutter =
!400/100!0/100,!400/100,!0/100,!400/100,!0/100,!400/100!0/100,!400/100,!0/100,!400/100,
!0/100,400
[pl]
ringcadence = 1000,4000
dial = 425
busy = 425/500,0/500
ring = 425/1000,0/4000
congestion = 425/500,0/500
callwaiting = 425/150,0/150,425/150,0/4000
dialrecall = 425/500,0/50
record = 1400/500,0/15000
info =
!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1
400/330,!1800/330,!0/1000
stutter =
!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10
0,!0/100,425
[pt]
ringcadence = 1000,5000
dial = 425
[ru]
ringcadence = 800,3200
dial = 425
busy = 425/350,0/350
ring = 425/800,0/3200
congestion = 425/350,0/350
callwaiting = 425/200,0/5000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
[se]
ringcadence = 1000,5000
dial = 425
busy = 425/250,0/250
ring = 425/1000,0/5000
congestion = 425/250,0/750
callwaiting = 425/200,0/500,425/200,0/9100
dialrecall = !425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425
record = 1400/500,0/15000
info =
!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/3
32,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/
24,!1800/332,!0/2024,!950/332,!0/24,!1400/332,!0/24,!1800/332,0
stutter =
!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/10
0,!0/100,425
[sg]
ringcadence = 400,200,400,2000
dial = 425
ring = 425*24/400,0/200,425*24/400,0/2000 ; modulation should be 100%, not 90%
busy = 425/750,0/750
congestion = 425/250,0/250
callwaiting = 425*24/300,0/200,425*24/300,0/3200
stutter =
!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/60
0,!0/200,!425/200,!0/200,!425/600,!0/200,425
info = 950/330,1400/330,1800/330,0/1000 ; not currently in use acc. to reference
dialrecall = 425*24/500,0/500,425/500,0/2500 ; unspecified in IDA reference, use repeating
Holding Tone A,B
record = 1400/500,0/15000 ; unspecified in IDA reference, use 0.5s tone every 15s
nutone = 425/2500,0/500
intrusion = 425/250,0/2000
warning = 425/624,0/4376 ; end of period tone, warning
acceptance = 425/125,0/125
holdinga = !425*24/500,!0/500 ; followed by holdingb
holdingb = !425/500,!0/2500
[us]
ringcadence = 2000,4000
dial = 350+440
busy = 480+620/500,0/500
ring = 440+480/2000,0/4000
congestion = 480+620/250,0/250
callwaiting = 440/300,0/10000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
stutter =
!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35
0+440/100,!0/100,!350+440/100,!0/100,350+440
[us-old]
ringcadence = 2000,4000
dial = 600*120
busy = 500*100/500,0/500
ring = 420*40/2000,0/4000
congestion = 500*100/250,0/250
callwaiting = 440/300,0/10000
dialrecall = !600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
stutter =
!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*
120/100,!0/100,!600*120/100,!0/100,600*120
[tw]
ringcadence = 1000,4000
dial = 350+440
busy = 480+620/500,0/500
ring = 440+480/1000,0/2000
congestion = 480+620/250,0/250
callwaiting = 350+440/250,0/250,350+440/250,0/3250
dialrecall = 300/1500,0/500
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
stutter =
!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!35
0+440/100,!0/100,!350+440/100,!0/100,350+440
Note: In Peer Details, insert qualify=yes if you want fail-over to PSTN should you loose
your internet connection.
B.1.1 BBPglobal
allow=g723&gsm context=from-trunk
authuser=<user number> fromuser=<user number>
disallow=all insecure=very
fromdomain=sip2.bbpglobal.com secret=<password>
fromuser=<user number> type=user
host= sip2.bbpglobal.com username=<user number>
insecure=very Note:You may need to include the
secret=<password> following in your sip.conf
type=peer Maxexpirey=3600
username=<user number> Qualify=yes
Register String:
<user number>:<password>sip2.bbpglobal.com/<user number>
Register String:
02321XXXX:<password>@byo.engin.com.au/02321XXXX
Register String:
xxxxxx:<password>@iax.faktortel.com.au
Faktortel supports the following codecs: ulaw, alaw, ilbc, gsm, g729. The following is
the link on the discussions for setting up Faktortel on ELASTIX.
http://www.faktortel.com.au/support-Elastix-settings.shtml
B.1.4 GoTalk
allow=alaw context=from-trunk
disallow=all fromuser=094XXXXX
dtmfmode=inband host=dynamic
username=094XXXXX insecure=very
fromuser=094XXXXX nat=yes
insecure=very secret=<password>
nat=yes type=user
host=sip.gotalk.com username=094XXXXX
qualify=yes
secret=<password>
type=peer
Register String:
094XXXXX:<password>@sip.gotalk.com/094XXXXX
To get the necessary credentials, we cheated a little as the method was published in
the whirlpool forum http://forums.whirlpool.net.au/forum-replies.cfm?t=604015
https://spconfig.voip.iprimus.net.au/SoftphoneConfigurationServer/Default.aspx?Action=LOG
IN&username=username&password=password&computerid=db7b351e57af&MAC=your
_NIC_MAC_address
Replace the bold type with your Talk Broadband username and password given to
you by iPrimus. You can get your NIC MAC address by running ipconfig /all.
When you submit that address, the following data will be displayed in your browser.
Note the bold highlights. These are the data that you need for your trunk setting.
Armed with the data above, you may now set your trunk setting.
allow=alaw&ulaw context=from-trunk
disallow=all type=user
fromdomain=asnjla2.bw.iprimus.net
fromuser=AU_XXXXXXXX
host=asnjla2.bw.iprimus.net
insecure=very
outboundproxy=sbc01a.syd.voip.iprimus.net.au
port=15060
secret=YYYYYYYY
type=peer
username=AU_XXXXXXXX
Register String:
[email protected]:YYYYYYYY:AU_XXXXXXXX@iprimus/02********
allow=g729&alaw&ulaw canreinvite=no
authname=091xxxxx context=from-trunk
canreinvite=no fromuser=091xxxxx
disallow=all insecure=very
dtmfmode=rfc2833 qualify=no
fromuser=091xxxxx secret=<password>
host=sip01.mynetfone.com.au type=friend
insecure=very username=091xxxxx
nat=yes
pedantic=no
qualify=yes
secret=<password>
type=friend
username=091xxxxx
Register String:
[email protected]:<password>:[email protected]/091xxxxx
For further information on MyNetFone, you may refer to the following link:
http://www.myfone.com.au/downloads/sip.conf and http://www.myfone.com.au/downloads/extensions.conf
allow=g729 context=from-trunk
disallow=all host=iax.ifone.com.au
host=iax.ifone.com.au secret=<password>
qualify=yes type=user
secret=<password> username=661xxxx
type=peer
username=661xxxx
Register String:
661xxxx:<password>@iax.ifone.com.au
B.1.8 Nodephone
allow=g729 context=from-trunk
canreinvite=no host= sip.internode.on.net
disallow=all secret=<password>
dtmfmode=rfc2833 type=user
fromdomain=sip.internode.on.net username=<usernumber>
username=<usernumber>
fromuser=<usernumber>
host=sip.internode.on.net
insecure=very
secret=<password>
type=peer
B.1.9 SipMe
Register String:
1777xxxxxx:<password>@sip.sipme.com.au/1777xxxxxx
allow=ulaw&g729
canreinvite=no You may prefix outgoing
context=from-trunk calls with 0197 to disable
disallow=all outgoing CID.
dtmfmode=rfc2833
fromuser=64997xxxxx Inbound route 64997xxxxx
host=akl.italk.co.nz required to be forwarded
insecure=very to a destination ext/menu
secret=<your password>
type=friend
username=64997xxxxx
Register String:
64997xxxxx:<your password>@akl.italk.co.nz/64997xxxxx
(Source Ref: Steve Biddle)
allow=ulaw&g729 context=from-pstn
disallow=all host=voip.0064.co.nz
dtmfmode=rfc2833 insecure=very
host=voip.0064.co.nz secret=PASSWORD
insecure=very type=user
secret=<your password> username=CUSTOMER_ID
type=peer
username=your_Customer_ID
Register String:
Your_Customer_ID: <your password>@voip.0064.co.nz
Register String:
<usernumber>@sip.broadvoice.com:<password>:<usernumber>@sip.broadvoice.com/<usernumber>
Register String:
65xxxx:<password>@iax2.fwdnet.net
B.3.3 SipBroker
Peer Details
Trunk Name: sipbroker-out
allow=g729&ulaw&alaw You will not require
canreinvite=no user details since you
disallow=all will not be receiving
dtmfmode=rfc2833
fromdomain=<your existing sip provider>
incoming calls from this
fromuser=<your user ID of existing provider> trunk.
host=sipbroker.com
insecure=very You do not need to
nat=yes register either.
port=5060
secret=<password for existing provider>
type=peer
nat=yes
externip=<Fix Ip address> ; if you have fix IP or
externhost=<your DNS hostname> ; if you are using Dynamic IP
localnet=192.168.1.0/255.255.255.0
B.3.4 SipPhone
Register String:
1747xxxxxxx:<password>@proxy01.sipphone.com/1747xxxxxxx
Register String:
<username>:<password>@sip1.voipbuster.com/<username>
(Source Ref: Florent Chandelier)
http://www.voip-info.org/tiki-index.php?page=Asterisk+sound+files
http://www.voip-info.org/wiki/view/Asterisk+sound+files+additional
http://www.nathanpralle.com/software/ast_masterlist.html
<Quote>
I have just been setting up the Digital Receptionist and I wanted to use a professional
voice for messages. I thought I might detail my exploits here for those that might be
considering the same thing.
First you need the original recording either from a real professional or a "text to voice"
utility. I went with the Realspeak demo
http://www.nuance.com/realspeak/demo/default.asp
The "British Daniel" voice was deep and professional. Check this out
http://www.cbservers.com.au/whirlpool.wav
Now the demo has a 100-character limit so you may need to do 2 or 3 files and join them
together with a program like Accoustica MP3 mixer.
http://www.acoustica.com/mp3%2Daudio%2Dmixer/
It was after this part that I had a lot of problems. Asterisk is very funny about sound files. I
tried using all sorts of programs to get the file to the right specs but it failed to work every
time. I eventually used "sox" an open source command line editing tool and it worked first
go (using advice from VoIP-info & digium forums) http://sox.sourceforge.net/ then at the
command line prompt use this syntax:
<End quote>
Of course, don’t forget to add the following line in the iax.conf and sip.conf configuration
file under [general]. In zapata.conf configuration file the line should be added under
[channels].
But, as we know, there are more than just one way to skin a cat ☺ thus, the solution is to
telnet to the ADSL modem and remove this restriction.
Trying 10.0.0.138...
Connected to speedtouch
Escape character is '^]'.
Username : root
Password :
----------
...
... welcome message blah blah blah
...
You then should unbind the SIP protocol and reboot the modem thus:
To check whether the SIP protocol is bound in your modem use this command to show
the list of bindings (only showing SIP here):
=>nat bindlist
Application Proto Port
SIP udp 5060
Source Reference:
http://www.sipgate.co.uk/faq/index.php?aktion=artikel&type=faq&rubrik=024&id=398&lang=de
By default, if you enable the FXS ports on the Billion 7402 VL router to be sip enabled,
the router automatically forwards the port (5060) to its own IP address and an error will
occur if you try to forward that port to the Asterisk box. This is because it is intended for
the FXS ports to connect directly to an external SIP provider.
voip set interfacename iplan (this changes it from the WAN to the LAN interface
Now you can add the NAT to point to the asterisk server and the FXS ports will connect to
the Asterisk box.
NOTE: - Also codec G729 had to be disabled on the FXS ports for calls to work. Not sure
why.
Note:
The set-up described here is for use with ELASTIX and not for connecting the unit directly
to the VOIP service provider.
I will describe the minimum changes that are required to get these ATAs to work in
conjunction with Asterisk.
As supplied, the unit comes with DHCP enabled. It is best to allocate a fix IP address to
the unit and therefore the first thing to do is to disable the DHCP and allocate a fix IP
address e.g. 192.168.1.50. You need to do the following:
1. Connect the unit to your network via the RJ45 port behind the unit.
2. Power up the unit
3. Plug in a telephone in the RJ11 port 1 behind the unit (any one will do)
4. Dial **** and listen to the instruction that you will hear from the IVR
5. Dial 101 and when prompted enter 0 followed by # (this will disable DHCP)
6. Dial 111 and when prompted enter 192*168*1*50 followed by # (assuming that
you want to allocate 192.168.1.50 as the IP address of the ATA).
7. Dial 120 and you will hear the current sub-net mask. If it is not your existing
network subnet mask you may want to change it. If it is the same as your current
network’s subnet mask, do don’t need to do anything else). If you need to
change the sub-net mask, do the following:
8. Dial 121 and at the prompt enter 255*255*255*0 (assuming that is your existing
sub-net mask)
Next, connect to the Unit using your browser by entering http://192.168.1.50 in your
browser address bar and hit enter.
These are the minimum changes you need to do to get the ATA working in conjunction
with Asterisk. There are other changes that you can do depending on your own
requirement. There are various discussions on this topic in the Whirlpool, Voxilla and
other forums that you can refer to.
To use the ISO, place into your new PBX and boot the cd. At the boot screen you would
have normally just pressed enter to go straight into a normal install. On this ISO you can
also do this but it will just be a single HDD install.
SATA RAID
At the first boot screen write
linux ks=cdrom:/ks_sataraid.cfg
IDE RAID
At the first boot screen write
linux ks=cdrom:/ks_ideraid.cfg
http://www.voipeye.com.au/Elastix-1.0-mbit.com.au.iso
Don’t configure IDE RAID mode at BIOS. If you have hardware raid then follow other
instructions. For example on an Dell Vostro 200 configure raid at bios, press ctrl+I at
boot, press enter 4 times and you will have a nice little hardware raid1. Here we’ll do it
manually, works on almost anything!
Cabling
Boot from cd-rom, at the welcome screen type “advanced” and press enter. What until it
asks you how you like to configure partitions on your disks. Of course we’ll use all space
so forget your data on those disks.
Use up and down arrow keys to move through disks, tab to move through options and
space to select/toggle
Step 1
Highlight free space under SDA (first disk) using arrow keys and select NEW using
tab.
On the new screen select using only tab and space:
File system Type: Software Raid
Allowable Drives: SDA (unselect SDB using space)
Size: 512
Force to be a primary partition: Select this or the system will never boot
Step 2
The same procedure for SDB but with one difference
Allowable Drives: SDB (unselect SDA)
Step 3
Select RAID
Mount point: /boot
File System Type: ext3
Raid Level: RAID1
Raid members: sda1 and sdb1. It’s already selected. Leave them alone!
Step 1
Highlight free space under SDA (first disk) using arrow keys and select NEW using
tab.
On the new screen select using only tab and space:
File system Type: Software Raid
Allowable Drives: SDA (unselect SDB using space)
Size: 2048
Force to be a primary partition: DON’T select this!
Step2
The same procedure for SDB but with one difference
Allowable Drives: SDB (unselect SDA)
Step 3
Select RAID
Mount point: nothing!
File System Type: swap
Raid Level: RAID1
Raid members: sda2 and sdb2. It’s already selected. Leave them alone!
Step 1
Highlight free space under SDA (first disk) using arrow keys and select NEW using
tab.
On the new screen select using only tab and space:
File system Type: Software Raid
Step2
The same procedure for SDB but with one difference
Allowable Drives: SDB (unselect SDA)
Step 3
Select RAID
Mount point: /
File System Type: ext3
Raid Level: RAID1
Raid members: sda3 and sdb3. It’s already selected. Leave them alone!
Wrap it up
On first boot, login and type: watch cat /proc/mdstat to see the status of the raid.
See if all raid members are active and nothing is unusable or the machine will blow up!
Just kidding.
Some FAQ
Will the system format the disks and build the raid on it’s own?
Yes, don’t worry. Just don’t be too quick to reboot the first boot.
Echo in the SPA-3000 is a common problem. In reality, most of the time the SPA-3000
isn't causing the echo, it's just making it more noticeable. This is due to the fact that the
SPA-3000 passes calls from the PSTN to the LINE1 by converting it to VoIP internally
and then backs to analogue. This process does not produce any echo, however is can
add about 30ms of latency to the call. This added latency can make echo that was
previously unnoticed suddenly become annoying. A pure digital system has no echo (the
TX and RX path are 100% separated). It's the interaction of the Digital and Analogue that
cause problems.
This may help getting rid of that pesky echo on your Sipura SPA-3000 PSTN line:
1. Make sure you are running the latest firmware (3.1.7) and you have everything back to
factory defaults or at least undo all the previous tweaking.
2. Switch *off* all echo can in all your devices. There are 6 places in the sipura to switch
off echo can.
• PSTN Line -> "Echo Canc Enable",
• "Echo Canc Adaptive Enable",
• "Echo Supp Enable" and
• Line 1 -> "Echo Canc Enable",
• "Echo Canc Adaptive Enable",
• "Echo Supp Enable".
The idea is that we want to hear how bad the echo is with different configs.
3. Unplug everything from your phone line except the SPA-3000. This includes all the
extension cables even with nothing connected to them. These can cause impedance
problems that lead to echo.
Doesn't seem to affect echo, but I believe that these are the correct numbers for
Australia.
If you are using a poor quality VoIP service as well as the PSTN then you could change
the
• "LINE1 -> Network Jitter Level: = medium".
Obviously adjust this if you’re accessing your PSTN line via VoIP from a remote network.
Set the LINE1 to allow g711a as well as whatever else your prefer.
• "LINE1 -> Use Pref Codec Only = no".
The g711a is fast to encode and decode. Using this codec again reduces your latency
and may make the echo less obvious or easier to catch with the echo canceller.
8. Power cycle the SPA-3000 (pull the power plug). Believe it or not, this sometimes fixes
the problem. Especially after you have changed the physical phone wiring.
9. Make some test calls. The telco test number 1800801920 is a good one to start with. It
has a recorded voice telling you your local phone number. While it's talking, talk back and
work out how much echo you are getting. Talk loud, talk soft.
10. Look at what you have got. If you can hear an echo then the problem could be that
your probably sending to much power down the line. This is probably reflecting back
somewhere as an echo. If you’re close to the exchange and have good wires then this is
probably the case. You need to crank back on the power. Go to PSTN -> "SPA To PSTN
Gain" and turn it down. Be aware that at some point if you turn it down to much, the SPA
sorts does a double negative and turns it way up. I believe the range of this variable is
about -127 -> 127 (from my testing). Turn it down, down, down, down until the person can
still hear you but reduced echo.
Note: if you enable "Echo Supp Enable" then you will negate these parameters. It seems
that the Sipura echo suppression is actually just an automatic gain control. It's really
annoying - leave it off.
11. Make a test call to someone with a known good phone out via the SPA's PSTN line or
get someone to call in to the PSTN line. Best if it’s just a boring old Telstra phone hard
wired to a socket on the wall. Don't call a mobile!
If the remote party is hearing echo, it could be that your phone is so loud that it's feeding
back into the microphone. Turn down the PSTN To SPA Gain until you can comfortable
hear the person, no more. If the remote user can still hear echo, try using a different
phone plugged into the SPA. Go for the basics first, a cruddy old Telstra phone is what I
use for testing. If this solves the problem you may have a bad phone or an impedance
miss match between your phone and the SPA.
If this doesn't help, change it back. The impedance will only affect what the *remote* party
hears, it won't help echo you are hearing.
12. After you have the echo down to a reasonable level, go back into the "PSTN" tab and
switch on the "Echo Can Enable = yes". Check to see if the echo has improved. If the
echo is tolerable at this level, leave the adaptive echo canceller off. You should have the
echo level down to a level that can be stomped on by the echo canceller. If you are using
a sip device to talk through your PSTN line, you should probably do all the echo
cancellation at that device and leave it switched off in the SPA.
The adaptive echo canceller is a lot more aggressive but also can cancel out some of the
incoming conversation. In particular if you’re calling in a loud environment then the voice
going down the line from your end can trick the echo canceller to start canning some of
the real conversation. It makes the incoming party sound a bit scratchy. Leave it off
unless you really need it.
13. Test call. Talk loud, talk soft. Is your conversation clear at both ends? Should be a lot
better. If echo re-appears, at a later date, remember to try power cycling the SPA before
you tweak with anything. It may also be at the other end of the call.
If you are hearing the echo, the real problem is at the *other* end of the connection. In a
normal phone conversation, the latency is so low that you don't notice it. Your brain
automatically tunes out to its own voice when you’re talking (as long as the delay between
talking and hearing isn't to long). When you insert the SPA, the delay is increased and
sometimes the echo can become noticeable.
The only way you can counter this is to reduce the latency (jitter buffer) and/or reduce the
gains so the echo volume is reduced below the level that it is noticed. At this point, the
SPA-3000 echo canceller should be able to kill off the rest.
To do this you need to change one setting in the zapata.conf file. By default the setting is
set to:
Immediate = no
Immediate = yes
If you are not using Fax, it is also a good idea to disable fax extension in your General
setting.
This may or may not work satisfactorily as Asterisk needs a couple of rings to detect CID.
O’Reilly has licensed the book under the creative commons license and as such, you are
free to download and distribute it.
http://www.voip-info.org/wiki/view/Asterisk%40home+Handbook+Wiki
http://sourceforge.net/forum/?group_id=123387
http://sourceforge.net/docman/?group_id=121515
The following are two tutorial sites that I recommend everyone who is serious about
Elastix and Asterisk generally.
http://mundy.org/blog/index.php?p=81
http://www.asteriskguru.com/tutorials/
http://www.freewebs.com/voipformula/VoIP-HOWTO.html
http://www.cisco.com/en/US/tech/tk652/tk698/technologies_tech_note09186a0080094ae2.shtml
The following are links, which may interest USB phone users, where appropriate drivers
may be found. Users may have to try different drivers to find a suitable one.
http://www.yealink.com/english/support.htm
http://www.packetizer.com/products/
http://www.sednacomputer.com/products/se-p1k.html
http://www.welltech.com/product_e_06.htm
http://www.waytec.com.au/download.htm
http://www.pc-telephone.com/free-phone.htm
http://www.sjlabs.com/usbphone/SJphoneDriverATCOM-AU-100.exe
Login to the shell (SSH) as root. You can do this using Putty.
mysql –p
Enter password: eLaStIx.2oo7
use asteriskcdrdb;
delete from cdr;
exit;
There are 2 ways that this can be handled. One is by using the Custom Context module
or by creating the necessary context manually.
It is somewhat complicated, but I will try to explain it here and provide an example.
1. Set up all your trunks and outbound routes as normal. At this stage, users can make
unrestricted calls. This is the normal way of doing it with freePBX. You probably
would have already done this.
[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-PSTN
include => outrt-002-SPA3K
include => outrt-003-Oztell
include => outrt-004-Pennytel
include => outrt-005-Domestic
include => outrt-006-MobileAust
include => outrt-007-International
include => outrt-008-12Number
include => outrt-009-13N1800Numbers
include => outrt-010-e164
include => outrt-011-SingaporeLink
include => outrt-012-KualaLumpurLink
include => outrt-013-MalaccaLink
exten => foo,1,Noop(bar)
; end of [outbound-allroutes]
Highlight them, copy and paste in a notepad text file somewhere and will get back to
this a little later.
[from-restricted]
;
; These are all the applications that you will require
;
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
include => app-cf-off
include => app-cf-off-any
include => app-cf-on
include => app-cf-unavailable-off
include => app-cf-unavailable-on
include => app-calltrace
include => app-callwaiting-cwoff
include => app-callwaiting-cwon
include => app-dialvm
include => app-directory
include => app-dnd-off
include => app-dnd-on
include => app-echo-test
include => app-recordings
include => app-speakextennum
include => app-speakingclock
include => app-userlogonoff
include => app-zapbarge
include => app-vmmain
include => ext-group
include => ext-fax
include => ext-meetme
include => ext-findmefollow
include => ext-paging
include => ext-queues
include => ext-test
include => ext-local
include => parkedcalls
;
; #### OutBound Routes ########
; # Below are all restricted routes #
; ###########################
;
Now copy your [outbound-allroutes] that was saved to the text file directly underneath
the last line of the above context. Remember to delete the [outbound-allroutes] label.
Unfortunately you can’t cut and paste my example because they are my routes NOT
yours.
Your final handiwork will look something like the example below:
[from-restricted]
;
; These are all the applications that you will require
;
include => app-cf-busy-off
include => app-cf-busy-off-any
include => app-cf-busy-on
4. You may now comment out the outbound routes you do not want the restricted
extensions to use.
5. After you have done that, you need to go back to FreePBX and edit the extension that
you want to restrict by change the context to from-restricted instead of from-internal.
MISSING DIRECTORIES.
The following directories are missing from Elastix 1.0RC
/var/www/html/recordings
/var/www/html/_asterisk
You can either use WinSCP to create these directories or use Nano.
su asterisk
cd /var/www/html
mkdir recordings
cd /var/www/html
mkdir _asterisk
When you start Elastix or when you do amportal restart and if you see the following errors
means that you will need to create those directories.
#include zapata-auto.conf
#include zapata_additional.conf
#include zapata-channels.conf
mv /etc/asterisk/sip.conf /etc/asterisk/sip.conf.old
mv /etc/asterisk/iax.conf /etc/asterisk/iax.conf.old
mv /etc/asterisk/extensions.conf /etc/asterisk/extensions.conf.old
mv /var/lib/asterisk/bin/fax-process.pl /var/lib/asterisk/bin/fax-
process.pl.old
/var/lib/asterisk/bin/retrieve_conf
Some say it is not a bug but to me if users have to make modification to get all the
phones to work locally and accept PSTN calls, something is terribly wrong and therefore it
is a bug and I think it is a fundamental flaw in the design of Asterisk.
Asterisk is assuming that when a call is being made, the call is going to be made via a
trunk IF a sip trunk is recorded and enabled. Therefore Asterisk will scan for SIP trunks
availability. Once Asterisk finds a trunk it will start sip. If it does not find an available trunk
it will give up and start sip then you can make a call. However if you have more than one
SIP trunks, it will scan for all enabled SIP trunks until the verification times out. If you also
happen to have 10 SIP trunks, all 10 will be verified first before you can even use your
phones.
In normal cases where internet connection is available, this will only take a couple of
seconds to complete, but if internet connection is out, the verification process will take for
ever till it just die away and all your extensions rendered useless.
If no SIP trunk is recorded or enabled at all, then it will start sip immediately and you can
make a call. This issue only appears for those using SIP trunks, especially multiple SIP
trunks.
This is not a major issue if you only have 1 sip trunk because when Asterisk failed on that
trunk, it will give up and start sip. The only thing you notice will be a slight delay between
your dialling and the other phone ringing. Normally it is just a slight irritation - nothing
more.
The problem starts when you have multiple SIP trunks. If you have 2 SIP trunks, the delay
before Asterisk gives up is a little longer and you can still dial internal number after a long
delay. In many cases the delay is enough for users to think that nothing is happening, but
if you keep waiting it will dial.
However if you have 3 or more trunks, the delay becomes so long for Asterisk to cycle
through all your SIP trunks and the phone system becomes unusable, just gave up and
dies.
Asterisk should dial the number without scanning for SIP trunk (even if you have SIP
trunks) unless the number dialed is part of an outbound route that requires SIP trunk.
I tested this by adding 1 sip trunk then 2 sip trunks etc. The delay becomes progressively
longer and longer the more sip trunks I added.... which brought me to the above
conclusion.
Question is; how do we get around this? There is a way but it is a kludge. It works and
you don’t have to fiddle with codes or create a local DNS or BIND and what not that the
normal digger would not know how.
Hint: Create 2 boxes. Link both boxes using SIP. Make the other box a SIP trunk of your
live box. Make sure that this SIP trunk appears as the first trunk in your
sip_additional.conf. Comment out externhost from sip.conf or sip_nat.conf..
if(is_array($result))
to
if(isset($result))