The following is a definition for the term IVR from Wikipedia:
* "In telephony, interactive voice response, or IVR, is a phone technology that allows a computer to detect voice and touch tones using a normal phone call. The IVR system can respond with pre-recorded or dynamically generated audio to further direct callers on how to proceed. IVR systems can be used to control almost any function where the interface can be broken down into a series of simple menu choices. Once constructed IVR systems generally scale well to handle large call volumes."
Usage
Sample usage of IVR can be: a caller dials a telephone number. This number is answered by an IVR system. The IVR system checks if the time is in the business range, executes an application that play backs recorded audio files explain the options available to the caller. The caller has one or more choices to select options using keys or spoken words. After that upon to the choosen option, the caller can be route to a queue, where the queue members will help the caller with the necessary information.
IVR system can be also used in various kinds of ordering. For example in the pizza restaurants. There is "self-serve channels" for pizza ordering, where customers can call in on one number and if they want the exact same pizza as last time, they can just press the option for that. There can be a whole list of all foods, which the restaurant offers.
Lets say that you are calling in a big company, where there is hundred employees. Some friend told you, that you have to contact with "George". You are dialing the number, and some recorded voice says to you: "Welcome to the main office of X company. You can contact with our personal by saying his name. Please do it, after the beep signal. After that you will be immediately redirect to this person. Have a nice day by your kindly IVR system!"
In the most of the countries there is a telephone number for emergency cases. Behind this number, there can be an IVR system, which is waiting for your choice. The choices can be: 1 for Police station, 2 for Fire station, 3 for Ambulance service, 4 for the local Hospital. The fourth option is very interesting. The Asterisk system can look in the caller's ID and route the call to the most near city hospital.
In a matter of fact, the direct talking with a real human, in these type of situations, maybe is better idea.
Recording prompts
For your IVR configuration you will need first to record some sound messages.
You can record your own sound files using the Asterisk. For this purpose you should add an extension for the recording in the extensions.conf file. In our example, you can dial the extension 100, after the beep you can start recording your message.
To end the recording press "#". The message is recorded in .gsm format and is called recording.gsm in the /var/lib/asterisk/sounds directory. Asterisk plays back the message after you pressed "#"(after 2 seconds).
Here we are using Wait(), Record(), Playback() and Hangup() applications. You can see their descriptions by typing "core show application <application>" in Asterisk 1.4, or use "show application <application> (this will be removed in future).
Let's make more clearness: Wait(2) - waits 2 seconds, then the dialplan continues to the next priority. The 2 seconds are to be sure that the channel is up and ready for recording.
Record(file:gsm) - records from the channel into a file with format gsm. This application sets a channel variable named RECORDED_FILE, which contains the name of recorded filename.
You can use NoOp() application to see what contains the RECORDED_FILE variable.
exten => s,n,NoOp(${RECORDED_FILE})
Playback() application - plays the recording file. This application sets the following channel variable - PLAYBACKSTATUS. The result is SUCCESS or FAILED.
Hangup() application - hang up the calling channel.
Implementing a IVR using menu structure
The following is an example for an IVR system. You dial any number in the range 0[1-9] and you enter the IVR system. First there is checking if it is business hours and if you are, you will be send in the ivr-lang context, after that you will get the greeting message and during the message you can press a key from one to three to choose your language. According the number you pressed, you will be directed to the right extension (context).
ChanIsAvail() application checks if via ZAP/1 can be sent a call, if it can be, it dials "234234234" through ZAP/1. If the Zap channel is not available, it play backs unavailable audio message. The same situation is with the [friend-2] context. With this difference that it checks if the SIP/choice2 peer is known and registered, if it is not it dials the mainchief.
User Comments
max (litnimax at asteriskpbx dot ru) 20 December 2008 15:10:30 Russian IVR prompts are available for free from http://www.pbxware.ru/products/ivr
joel (sandovaljoel at hotmail dot com) 13 November 2008 17:17:09 i have an ivr that search in a database, a client digits your account number but if that number is less than two digits the ivr stay playing 'please digits your acount number' again and again, please help me , im novice on it here is my extension
faheem (faheemahmed007 at gmail dot com) 14 October 2008 21:14:42 hi
i have a problem when i dial IVR and push button it gives me an error of communicating entry error try again later..please help me out send me the settings.
my settings are:
exten => _2.,1,Answer
exten => _2.,2,Goto,Menu|s|1
[macro-senddtmf]
exten => s,1,SendDTMF(09)
..
Regards:
Faheem ahmed
faheem (faheemahmed007 at gmail dot com) 21 February 2008 19:14:01 hi
i want to know about IVR
faheem (faheemahmed007 at gmail dot com) 21 February 2008 19:13:47 hi
i want to know about IVR
Syed Bilal Masaud (syedbilalmasaud at gmail dot com) 30 October 2007 13:13:32 How to play some highly stereo file in asterisk , because when ever i try to play its sound quality on phone is not good as expected , please suggest some thing to produce crispy sound on IVR, suppose if i want to play a good drum song its sound quality gone bad
eeee (ffff at gmail dot com) 22 October 2007 07:47:52 Good site for IVR systems