Facebook

Interactive Voice Response system - FreeSwitch Installation



What is IVRS ?

A technology that allows a computer to interact with human through the use of voice and DTMF tones input via keypad.
IVR systems can respond with pre-recorded or dynamically generated audio to further direct user on how to proceed.How to Setup an IVR System.



Requirements -
1. Linux Machine.
2. Internet/Intranet connectivity.
3. FreeSwitch Framework.
4. Soft-phones/PRI lines.
 
Basic Setup.




Detailed Setup :





How to Setup an IVR System.

Linux Machine :

2+ GB RAM
30+ GB HDD
Ubuntu 12.04 or later/CentOS/Fedora
We will follow the process for Ubuntu systems.


Step 1- Before installing FreeSwitch Framework we need to update the system
with the latest packages.

Open the terminal in Ubuntu System. (Control + Alt + t)

Run this command in terminal :

$ sudo apt-get update && sudo apt-get upgrade

Hit enter and type the password. This will update the package repository and then upgrade the packages. Wait for few minutes. It will take some time depending on your internet speed.
After this is done, reboot the system.

Step 2 - Before installing FS(FreeSwitch), we need to install few packages on which FS installation will depend. Run the below command to install them -

$ sudo apt-get install git-core subversion build-essential autoconf automake libtool libncurses5 libncurses5-dev make libjpeg-dev

Step 3 - More necessary packages......

$sudo apt-get install libcurl4-openssl-dev libexpat1-dev libgnutls-dev libtiff4-dev libx11-dev unixodbc-dev libssl-dev zlib1g-dev libzrtpcpp-dev libasound2-dev libogg-dev libvorbis-dev libperl-dev libgdbm-dev libdb-dev python-dev uuid-dev unixodbc-bin libsqlite3-dev libpcre-dev libspeex-dev libspeexdsp-dev libldns-dev libedit-dev

After this, all steps should be executed as ‘root’.

HP usb X500 Wired Optical Sensor Mouse 3 Buttons windows 8 supported



Step 4 - Change the directory to /usr/local/src

$ cd /usr/local/src

Step 5 - Download the package (.tar file)

$ sudo wget http://files.freeswitch.org/freeswitch-1.0.6.tar.gz

Step 6 - After download is complete. Unzip the file.

$ sudo tar -xvf freeswitch-1.0.6.tar.gzInstalling FreeSwitch.

Step 7 - After unzipping the file, a folder will be created, change the current working directory to that folder.

$ cd /usr/local/src/freeswitch*

Step 8 - Edit modules.conf file.

$ gedit modules.conf

Uncomment (remove # from front of line) the below lines.

1. applications/mod_curl
2. asr_tts/mod_flite
3. formats/mod_shout

Save and close the file.

Step 9 - Configure the installation. Run below command.

$ sudo ./configure

Step 10 - Make sound files. Run below command.

$ sudo make all cd-sounds-install cd-moh-install

Step 11 - Run this last command.

$ sudo ./make && make install && make samples

If everything goes fine, we are good to go. But if there is any error from step-1 till step-11 then remove all files and follow steps given on next page.

To remove folder :

$ rm -rf folder_name

Alternate Method:

Step 1 - Change the directory to /usr/local/src

$ cd /usr/local/src

Step 2 - Clone the git repository of freeswitch in your directory.

$ sudo git clone git://git.freeswitch.org/freeswitch.git
or
git clone https://stash.freeswitch.org/scm/fs/freeswitch.git

Step 3 - cd to freeswitch directory just created.

Step 4 - Run bootstrap script file.

$ sudo ./bootstrap.sh

Step 5 - Run configuration file.

$ sudo ./configure

Step 6 - Edit modules.conf file and uncomment the below
lines.

a. applications/mod_curl
b. asr_tts/mod_flite
c. formats/mod_shout

Save and close the file.Installing FreeSwitch.

Step 7 - Run the below commands one after another.
sudo make
sudo make install
sudo make uhd-sounds-install
sudo make uhd-moh-install
sudo make samples

And with this, we are done!

To run the freeswitch server,

run this command as root.

$ /usr/local/freeswitch/bin/freeswitch

To stop :
shutdown

All configuration/dialplan/setting files are located in /usr/local/freeswitch directory.


Installing Soft-Phone

Softphone is a software program for making telephone calls over the Internet using a general purpose computer. It is designed with a display panel and buttons with which the user can interact.
A typical softphone has all standard telephony features such as DND, Mute, DTMF, Flash, Hold, Transfer etc.
Most frequently used softphones are x-lite and micro-sip for windows; twinkle, Linephone, QuteCom and Yate for Linux.





On Linux systems, Twinkle is the best choice. It is simple to use and have too many features to list here. For all features visit their webpage.

http://www.twinklephone.com/

Twinkle can be installed on Ubuntu systems using software center.




After Installation

In settings , change the sip-port of twinkle from 5060 to something else, because this is the port used by FreeSwitch.



1. Create a profile.



2. Enter the details necessary to connect to server. Default password for each user is 1234.



3. And if all details are correct, then you are successfully connected to server.
4. Now try to call 5000 and if you can listen to some recorded message then
everything went fine :)



Similar to 1001, there are more users that are by-default created on the
server starting from 1001 to 1019.

Install softphone (Twinkle, X-lite) on another system in the network and
create a profile for another user (1002 lets say). Connect to user and make a
call to 1001.

If you are trying to communicate over internet (not Intranet) then there are few other advance setting that need to be changes which may vary from network to network.




Dialplan

Dialplans are used to route a dialed call to its appropriate endpoint, which can be a traditional extension, voicemail, interactive voice response (IVR) menu or other compatible application.

In FreeSwitch dialplans are stored in conf/dialplans directory, with each context stored in subdirectory beneath it.



public.xml handles all incoming calls. Rules are written to match the number/pattern and respective action is taken. All outgoing calls are handled by default.xml file.

Directory - /usr/local/freeswitch/conf/dialplan

Dialplans can be separated into 'contexts' allowing you to have separate dialplans for different types of calls. For example, to ease security concerns, you might have two dialplans, one that handles calls originating from the
public phone network (PSTN) and one that handles calls originating from internal extensions.

When a call arrives at the FreeSWITCH, Sofia is the first responder. It gathers information about the call, and decides which dialplan to invoke.Dialplan


Sample Dialplan





Context :

Contexts are a logical grouping of extensions. You may have multiple extensions contained within a single context.

Extensions :
Extensions are destinations for a call. This is the meat of FreeSWITCH routing dialed numbers. They are given a name and contain a group of conditions, that if met, will execute certain actions.Dialplan


Conditions

Dialplan conditions are typically used to match a destination number to an extension. They have, however, much more power than may appear on the surface. FreeSWITCH has a set of built-in variables used for testing. In this example, the built-in variable destination_number is compared against the regular expression ^500$. This comparison is 'true' if is set to 500.




Call Recording for Inbound Calls.

For inbound calls it is easiest to enable recording right on the Local_Extension.

Follow the steps:

1. Open conf/dialplan/default.xml and locate the Local_Extension dialplan entry. Add these lines right after the line with the answer application:



2. Save the file, then run fs_cli and press F6 or issue the reloadxml command. Now all internal phone to phone calls are being recorded.

Call Recording for Outbound Calls.

For outbound calls we need to do something a bit different because we don’t
necessarily know that the call will actually be answered.

1. Open the dialplan file that contains your outbound route. Add these lines right
before your bridge application:




2. Save the file, then run fs_cli and press F6 or issue the reloadxml command.


Leave a comment in case of any query.

2 comments:

  1. Its extremely instructive, intelligent and quality substance. I wish all of you good fortunes for your coming sites and posts. Continue sharing! site design service

    ReplyDelete
  2. An IVR application gives pre-recorded voice responses to suitable circumstances, keypad signal rationale, access to important information and, possibly, the capacity to record voice data for later taking care of. Utilizing PC telephony joining (CTI), IVR applications can hand off a call to an individual who can see information identified with the guest at a showcase.

    IVR phone system

    ReplyDelete