Installing UK voice prompts for Asterisk

Installing UK voice prompts for Asterisk

By default the English language voice prompts that Asterisk comes with have an American accent. There are some free UK voice prompts available and below are instructions for downloading and installing those. The instructions below will replace the existing US prompts with the UK ones.

The prompts can be found here – http://www.enicomms.com/cutglassivr/

More details about different language voice prompts can be found here – http://www.voip-info.org/wiki/view/Asterisk+sound+files+international

The commands below download the wav, ulaw, alaw, g729 and g723 codec versions.

First create a folder to download the files to -

cd /usr/src
mkdir uk
cd uk

next grab the files -

next extract the files that were downloaded -

find . -name 'Alison_Keenan-British-English-*' -exec tar xvfz {} \;

now we’re going to replace the file extensions on some of the files to match the default Asterisk ones -

find . -exec rename .g711a .alaw {} \;
find . -exec rename .g711u .ulaw {} \;

now remove the original tar files, copy over the new files and tidy up the download folder -

rm -f Alison_Keenan-British-English-*
unalias cp
cp -rf * /var/lib/asterisk/sounds/en
cd ..
rm -rf uk

You can hear an example of these prompts by calling the echo test number here – http://sysadminman.net/livedemo.html

Good prompts - Notes

FreePBX DAHDI Trunk Routing with DID

HowTo: Elastix DAHDI Trunk Routing with DID

If you have multiple FXO (PSTN) lines into your PBX, it is always nice to be able to route these in-bound calls based on the physical line they arrive upon.  Getting this working with DAHDI in Elastix has been driving me up the wall!

This issue has been bugging me for over a week now and I have finally got it to work.  I have two trunks connected via FXO modules on a TDM400 card, but I could not get the DID working with them (CLI with BT sorted).  But once Asterisk had the call, I could not make Asterisk make a decision with call based on which number/line the caller called.  Not the number the caller is calling from, this is CLI or CID, but the number they dialled to make your line ‘ring’.

Asterisk was either saying there was no route and answering the call to say the number you have called is not in service, or just handling the 2 lines in the same way – i.e. it could not tell them apart.  Here I detail my findings so you can process lines automatically.

I had most of the configuration right, but I had to hand edit another configuration file to actually to get the changes made via the web interface actually working.  Trying to find this last little bit of information on the forums has been maddening to say the least.

Changing the route

First you need to correct the router handler, by changing a setting in a configuration file.  There is no graphical interface for this I’m afraid and it is the only file you need to manually edit by a suitable means.

The default setting in this configuration file is ‘from-pstn’ and this needs to be changed to ‘from-zaptel’.  You need to edit:

/etc/asterisk/dahdi-channels.conf

You need to find the correct section for your line connection.  For me this was lines 3 & 4.  Below is the example original settings for my channel 3:

;;; line=”3 WCTDM/4/2 FXSKS”
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 3
callerid=
group=
context=default

And you need to edit this for each channel to become like this:

;;; line=”3 WCTDM/4/2 FXSKS”
signalling=fxs_ks
callerid=asreceived
group=0
context=from-zaptel
channel => 3
callerid=
group=
context=default

Then save the file back and restart Asterisk.

Marking the Channel DID

The next stage is to assign DID numbers to these channels so a decision can be made on how to process the call based on line ID.

Elastix does not have an interface to the required facility, so you need to un-embed the FreePBX console, details are here.

Once in the FreePBX console, you need to choose ‘ZAP Channel DIDs’ from the menu on the left.  You should get a screen similar to:

ZAP DIDs

ZAP DIDs

It is quite simple to complete, needing only 3 bits of information:

  • Channel – The DAHDI channel you are assigning the DID to.
  • Description – Your description for this allocation.  I would suggest an name and a summary of the DID you will be allocating.
  • DID: The DID number need to call to make this channel ‘ring’.

An example UK configuration might look like this for channel 3, used to be routed (Inbound Routes) to the sales department for the number: 01234-123456:

ZAP DID Sample

ZAP DID Sample

Once completed, you can click ‘Submit Changes’.  You need to repeat this for each FXO port you have for inbound calls.

You can then save the changes back and configure the ‘Inbound Routes’ to actually ‘route’ the calls where you want them.

You can actually use almost any number in the DID, but I suggest you use the full number, including the STD, in case you have any ‘out of area’ number.  And it generally reduces confusion in the future.

Notes

FreePBX v3 and Asterisk Installation Guide on Fedora 12

FreePBX v3 and Asterisk Installation Guide on Fedora 12

 

Anyone who is familiar with Asterisk has probably taken a look at FreePBX at one time or another. I decided to give the newest version of FreePBX a try. Since the Asterisk Driver has only recently come available, there aren't any good installation guides that I could find. I ended up using the FreeSwitch Installation guide at the FreePBX website as a guide to get started.

I am using Fedora Core 12 with only the standard repos. All software was installed via YUM except for FreePBX which I checked out via subversion. I know a lot of people look at YUM with disgust, but I find it a pretty useful tool. Building from source is fun, but unless I have a real reason to do so I try to stay away from that. I chose Fedora over CentOS because the packages available for CentOS are generally behind (i.e. stable? :P) and FreePBX v3 requires PHP >= 5.2.

So, here are my installation steps to get a working installation of FreePBX v3 and Asterisk 1.6.1.17, which is the latest version available via the Fedora repo.

Loosely based on http://www.freepbx.org/v3/wiki/Installation

 

Install Fedora Core 12

yum update

You can omit nano and use your favorite command line text editor... I like nano.

yum install nano php php-pdo php-mysl php-xml php-xmlrpc php-soap mysql-server mysql  libpri libss7 subversion dahdi-tools openssl openssl-devel mod_ssl bind sendmail bison bison-devel gcc gcc-c++ ncurses ncurses-devel zlib zlib-devel gnutls-devel

Optionally install sendmail, bind and configure mod_ssl. Also setup your httpd.conf how you see fit and probably enable AllowOverride All.

service httpd start

service sshd start

service mysqld start

chkconfig mysqld on

chkconfig httpd on

chkconfig sshd on

nano /etc/sysconfig/iptables and ensure you have the rules:

 

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT

-A input -m state --state NEW -m udp -p udp --dport 5060 -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

nano /selinux/enforce and change 1 to 0

nano /etc/sysconfig/selinux and set selinux=permissive (or disabled)

yum install asterisk

service asterisk start

chkconfig asterisk on

mysqladmin -u root password 'setyourpasswordhere'

mysql -u root -p

grant all privileges on freepbx.* to freepbx@localhost identified by 'setpasshere';

flush privileges;

go to your web enabled folder (i.e. /var/www/html) and run: svn co http://www.freepbx.org/v3/svn/trunk freepbx/

chown -R apache:apache freepbx/

nano /etc/asterisk/manager.conf

change:

enabled=no to enabled = yes

add (i added all privileges which might not be neccessary and made sure i locked down ip / made super secret password):

[freepbx]

secret = yoursupersecretpassword

deny = 0.0.0.0/0.0.0.0

permit = 127.0.0.1/255.255.255.0

read = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate

write = system,call,log,verbose,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate

now go to http://yourhost/freepbx and follow the installer

read, agree, and hit continue

if you get prompted that cache and logs aren't usable try:

chmod 777 /var/www/html/freepbx/freepbx/cache

chmod 777 /var/www/html/freepbx/freepbx/logs

check to be sure your database settings match what your user / pass was that you granted privileges for and hit continue

select the asterisk driver and enter the info you put in manager.conf

continue, don't select any modules that arent selected (you can add them later if you want them and can get them to work)

continue through the wizard and you should end up with a working installation.

One nice thing to note is that permissions were greatly simplified with v3 compared to the v2 branch. Essentially, FreePBX now uses Asterisk Manager so it doesnt need access to your /etc/asterisk folder, just the files in your web enabled directory.

Now I know I'm missing some stuff such as asterisk sounds and addons and such but this should be a pretty good start at getting a SIP based Asterisk installation up and running with FreePBX to experiment on. I do not recommend, and niether does FreePBX, using this as a production server yet. The interface is easy to follow so you shouldn't need any more instructions once you can login.

Good guide to test out FreePBX V3.0