Wednesday, October 5, 2011

Creating an External IVR for Allworx with database support.

Recently I had an idea of using Asterisk to host an external IVR for our Allworx system. Mainly I want to be able to extend the functionality of our current system and add the ability to do database look-ups from the phone system. Here is an example of the setup:



I will be installing asterisk on top of a fresh install of Ubuntu Server 11.04. First thing to do is to update and upgrade your box and then install the dependencies that Asterisk requires:

sudo apt-get update && apt-get upgrade -y
sudo apt-get install build-essential libtool libncurses5-dev libssl-dev libssl-dev libxml2-dev

Now everything is ready to compile Asterisk. Let’s get the sources from Asterisk website. At this moment the latest stable version is 1.8.7.0

cd /usr/src/
sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-1.8.7.0.tar.gz

Now we will uncompress and compile and install Asterisk
tar -xzvf asterisk-1.8.7.0.tar.gz
cd asterisk-1.8.7.0
./configure
sudo make
sudo make install

If you haven’t hit any errors, you must have a working barebone Asterisk install on your Ubuntu server. Optionally we can install samples and config files to get quickly started:
sudo make samples
sudo make config
Now you can start your Asterisk server by typing:

sudo /etc/init.d/asterisk start

and login into Asterisk CLI to check if everything is working fine:

asterisk -rv
Ok, Now that we have a working version of asterisk, we need to get a TTS (Text to Speach Engine)  I am going to be using cepstral voice, which can be found here and you can hear the voices here. Make sure you select the telephony voices as the output will need to be in the right format. I have chosen Alison and installed it using the following: (Note I am using 64bit OS, you may have to use a different link below)
cd /usr/src/sudo wget http://downloads.cepstral.com/cepstral/x86-64-linux/Cepstral_Allison-8kHz_x86-64-linux_5.1.0.tar.gz
sudo tar -xzvf Cepstral_Allison-8kHz_x86-64-linux_5.1.0.tar.gz
cd Cepstral_Allison-8kHz_x86-64-linux_5.1.0
sudo sh install.sh
Now, add the following line to /etc/ld.so.conf:
 sudo nano /etc/ld.so.conf
and add /opt/swift/lib
and run ldconfig as root:
sudo ldconfig
If you purchase a license for the voice you can follow the instructions to register here.

You can test your tts by enetering the following, and copy the output file to a computer to play back:
swift "Hello World" -o outputfile.wav
You will also need to get the extension for asterisk that allows you to access Swift from here.
wget http://forge.asterisk.org/gf/download/frsrelease/110/142/app_swift-2.0.1-ast1.8.tar.gztar -xzvf app_swift-2.0.1-ast1.8.tar.gz cd app_swift-2.0.1-ast1.8makemake install/etc/init.d/asterisk restart
We will also want to install out database, apache2 and phpmyadmin:

apt-get install mysql-server apache2 php5 phpmyadmin


More coming soon, check back often!

2 comments:

  1. did you ever put this into production. I have a similar request from a bank client for a phone banking solution on an allworx platform.

    Interested in hearing from you.

    I can be reached at mcasebeer@itersource.com

    ReplyDelete