IVRs
Roxanne Davila (Deactivated)
Aaron Bailey
The IVR (Interactive Voice Response) acts like a flow chart. At each step in the flow chart an action is preformed and then the caller is moved to the next step either automatically or by having the caller select some option (0 for operator for example).
Version: 4.3.0.6
The IVR section is one of Voiceware’s most flexible and customizable features. As such no one set of setup instructions can be given.
How to
This IVR will allow you dial an extension and have the system tell you what extension you are calling from. This is useful in new installs to ensure that each room has the proper extension.
Create a new IVR and name it “Say Extension”
Make the first step Play Sound of “silence/1”. Set the “then” to create new state “Say Digits”
Set the next step to “AGI Command” action and enter “SAY DIGITS ${CALLERID(num)} ''” (without the quotes) into the field. NOTE there are two single quotes not a double quote at the end of the command.
Check the “Expanded variables” check box
Set the “Then” to Create New State and name the state “Pause”
Configure the new state to play the sound “silence/2” and then go to state “Hangup”
Save the state and then set up a Dial Plan entry for the new IVR
This IVR is intended to assist in discovering what a phones speed dial button is set to. This is handy in an existing hotel where guest room phone’s speed dials have been set and forgotten.
Create a new IVR and name it “Say Speed Dial”
Set the first state to play the custom sound “SaySpeedDialPrompt” then stock sound “beep”.
Next change the “then” to “Wait for keypress” and check the Capture Digits with the following options:
Variable: A
Max Digits: 10
Next State: [Create new state] Read Back
Mode: Digits
Next create the last state of Say Digits and use the command AGI Command, in the field enter “SAY DIGITS ${A} ''” (without the quotes). NOTE there are two single quotes not a double quote at the end of the command.
Check Expand Variables
Set the “Then” should be Goto State Hangup
// Simple weather poll from openweathermap.org API
//var zipCode = agiChannel.getVariable("zip");
var zipCode = '80020';
var units = agiChannel.getVariable("units");
if (!units)
units = 1;
//var units = 1; // 1 = imperial, 2 = metric
//var units = 1; // 1 = imperial, 2 = metric
//var zipAPIKey = 'UQ0Lu8uMG807xzD464UisaeeXGl11XqPke4ihqTmJN9XRhUDeTdo8qEcWzPqPh3f';
var owAPIKey = '9593537c52c0b00d78dfe2528095b518';
// This is our simplified function to make requests and retrieve the data
// should be called by anything that makes a JSON request.
function getJsonData(url) {
var conn = new java.net.URL(url).openConnection();
conn.setRequestProperty("User-Agent", "(https://phonesuite.com/voiceware, jroberson@phonesuite.com)");
var stream = conn.getInputStream();
var resultString = '';
var data = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, stream.available())
var bytes = stream.read(data);
while(bytes != -1) {
resultString += new java.lang.String(data, 0, bytes);
java.util.Arrays.fill(data, 0);
bytes = stream.read(data);
}
var result = JSON.parse(resultString.substr(0, resultString.lastIndexOf("}")+1));
stream.close();
return result;
}
// Get our lat/lon from zipcodeapi
// lat, lng are the members we need.
//var zipURL = 'https://www.zipcodeapi.com/rest/'+zipAPIKey+'/info.json/'+zipCode+'/degrees';
//var zipData = getJsonData(zipURL);
// now get our gridpoint forecast and other data
//var wxURL = 'https://api.openweathermap.org/data/2.5/onecall?lat='+zipData.lat+'&lon='+zipData.lng+'&exclude=minutely,hourly&units='+(units == 1? 'imperial' : 'metric')+'&appid='+owAPIKey;
var wxURL = 'https://api.openweathermap.org/data/2.5/weather?zip='+zipCode+'&units='+(units == 1? 'imperial' : 'metric')+'&appid='+owAPIKey;
var wxData = getJsonData(wxURL);
var current = [];
var lat = wxData.coord.lat;
var lon = wxData.coord.lon;
current['temp'] = Math.floor(wxData.main.temp);
current['feel'] = Math.floor(wxData.main.feels_like);
current['humi'] = Math.floor(wxData.main.humidity);
current['wind'] = Math.floor(wxData.wind.speed);
current['wdir'] = degToCard(wxData.wind.deg);
current['cond'] = wxData.weather[0].id;
current['tmax'] = Math.floor(wxData.main.temp_max);
current['tmin'] = Math.floor(wxData.main.temp_min);
agiChannel.streamFile('temperature');
agiChannel.streamFile('is-currently');
//agiChannel.streamFile('the-weather-at');
//agiChannel.sayTime(wxData.dt);
agiChannel.streamFile(wxIdToSound(current.cond));
agiChannel.sayNumber(current.temp);
agiChannel.streamFile("degrees");
agiChannel.streamFile((units == 1? "fahrenheit": "celsius"));
agiChannel.streamFile(cardToSound(current.wdir));
agiChannel.streamFile("wx/winds");
agiChannel.sayNumber(current.wind);
agiChannel.streamFile((units == 1? "miles-per-hour": "kilometers-per-hour"));
agiChannel.streamFile("daylight");
agiChannel.streamFile("high");
agiChannel.streamFile("temperature");
agiChannel.sayNumber(current.tmax);
agiChannel.streamFile("degrees");
agiChannel.streamFile("low")
agiChannel.streamFile("tonight");
agiChannel.sayNumber(current.tmin);
agiChannel.streamFile("degrees");
agiChannel.streamFile(wxIdToSound(current.cond));
//Utility Function(s)
function cardToSound(card) {
switch(card) {
case "NNW":
case "N":
case "NNE":
return "north";
case "NE":
return "northeast"
case "ENE":
case "E":
case "ESE":
return "east";
case "SE":
return "southeast";
case "SSE":
case "S":
case "SSW":
return "south";
case "SW":
return "southwest";
case "WSW":
case "W":
case "WNW":
return "west";
case "NW":
return "northwest";
}
}
function degToCard(num) {
var val = Math.floor((num / 22.5) + 0.5);
var arr = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"];
return arr[(val % 16)];
}
function wxIdToSound (wxId) {
if (wxId >= 200 && wxId <= 232)
return "thunderstorm";
else if (wxId >= 300 && wxId <= 321)
return "wx/mist";
else if (wxId >= 500 && wxId <= 531)
return "rainy";
else if (wxId >= 600 && wxId <= 622)
return "snowy";
else if (wxId >= 701 && wxId <= 731)
return "";
else if (wxId == 741)
return "fog";
else if (wxId >= 751 && wxId <= 771)
return "";
else if (wxId == 781)
return "tornado";
else if (wxId == 800)
return "clear";
else if (wxId >= 801 && wxId <= 802)
return "scattered&clouds";
else if (wxId >= 803 && wxId <= 804)
return "cloudy";
else
return "error";
}
Video
Visual Overview
Also known as auto attendants, IVRs are automatic call processing. They can be used to play a simple greeting, or preform a complex check of time, day or night mode, and holidays to play different voice prompts and direct callers to different endpoints both internal and external.
IVRs can be edited and sorted into folders for easy of use. Below is a common IVR example.
There are many uses for an IVR and attempting to cover even a small fraction would be beyond the scope of this documentation. We encurrage you to experiment around with IVRs and feel free to reach out to Support@Phonesuite.com for help.
Line by Line Explanation
Each item in the help page will have an expand along with the information from the help page.
This is the name of the IVR and should reflect its purpose. For example most properties will have a “Main AA” and maybe separate IVR’s for additional lines such as “Reservations” or “Guest Information”.
Clicking this button makes this IVR available for use as a wakeup call. Using an IVR as a wakeup call has the advantage of giving the guest the options to press one to order room service, press two to hear the local forecast, etc…
Enter the name of this step in the IVR system. The name of the step should be descriptive and have a unique name so that it will be easier to build the IVR path and adjust later.
Select from the drop down what happens at this step; this can include playing a sound, forward to another extension, or ending the call. The most common action will be playing a sound (i.e. a voice prompt) and transferring the call out of the IVR. A full list of Actions and their related uses are as follows:
Acknowledge Wakeup Call: This action sets a wakeup call as “received” and will stop further wakeup call attempts for that specific wakeup call.
AGI (Asterisk Gateway Interface) Command: This is an advanced feature normally only used by Phonesuite personal. A list of available AGI commands is listed in Appendix D and examples of AGI command use are available in the How To section (see both below). Note that prepending a single _ character to a variables name in Set will cause that variable to be inherited by channels created by the main channel. I.e. when using Dial(Local/...); once inherited these variables will not be further inherited. Prepending two _ characters will cause them to be inherited indefinitely. For more information see What are Asterisk variables and how to use them .
Check Night Mode: This action check if the system is in night mode and will act differently depending on the status. Day mode, and each night mode, has its own dropdown box for actions to take regarding that state.
Check VIP Flag: A simple true/false condition that can be used to route calls from a VIP guest differently than normal guests.
Choose Next State at Random: Can be used to randomize the sound prompt a caller hears for example. This could be used in testing new IVR setups or the like.
Conditional: This allows the setup of an “If than” or logic statement. For example if “CALLERID(num)” is “303” then send the caller one way, if not send them another. This logic system is very powerful in allowing different types of calls (based on customer input or calling number) to be handled differently.
a) Both Yes and No have a dropdown for what action should be taken in each caseForward: Used to forward the caller to an extension or outside phone number.
a) Screening IVR: when the extension or phone number being transferred to picks up the call they will hear this IVR allowing them whatever options were programmed into that IVR. For example if there is a forward to extension 200 with screening IVR then when a call is forwarded whoever picks up ext 200 will hear the screening IVR giving them an option to accept or reject the call if that’s how the IVR was setup.b) Expended Variables: Advanced feature, normally not used
Hangup: this action ends the call or ends the IVR if the call has already been transferred. It is important to end all IVRs at the Hangup state.
Interact with Database: Here database updates, selects, or inserts can be accomplished. It is beyond the scope of this manual to describe in detail how to setup or maintain databases.
Modify Caller ID: Here a caller ID name or number can be modified before being presented to the front desk staff.
Play Sound: Used most to play a prompt for the user (“press 1 for operator, 2 for bookings, etc…). However this can be any sound like system date and time or other information.
a) The next dropdown selects where the sound is located, this is similar to a file selection menu.b) The last dropdown allows selection of the actual sound file. The play button next to the sound can be used to listen to the sound selected. Finally the plus button can be used to add another sound to play after the first one.
c) AMD (Answering Machine Detection): this is not used and should be left unchecked.
Return: Used to return the call to the previous IVR (if the caller was in a different IVR previously) or to end the call if the caller was not in an IVR previously.
Script: This option allows programming of the IVR via JavaScript.
a) Name: Name the script so it can be identified easily.b) Script: Enter the java script code in this box.
Note: This action is useful for leaving notes within the system either for the IVR itself or for general system information.
Send Email: This action can be used to send an email.
a) Email From: Enter the from address here. This can be VWSupport@Phonesuite.comb) Email To: Enter the to email address
c) Subject: The emails subject heading, this can include variables
d) Message Body: The contents of the message itself, this can also include variables
Send To: Used to send the caller to another IVR, an extension, user, or queue. This action is used commonly to send the caller to the front desk after selecting the correct voice menu option (see Then below for more information).
a) If Queue is selected as the send to location two additional options appear. Handled and Not Handled allow the IVR’s creator to tell the IVR what to do if the call is accepted by the Queue or rejected by it (for more information why a Queue might reject a call see Queues à Join Empty). Normally if the call is accepted the IVR will end in hangup, if the call is rejected the caller need to be sent to another location, possibly a voicemail box.Set Language: If a Spanish version of the voice prompts has been recorded this action can change between English and Spanish for example.
a) Use the dropdown to select the language, currently the only available languages are English, French, German, and Spanish.Set Night Mode: This action will set the system to night mode. This might be useful if the hotel management needs to set night mode remotely. When this IVR step is dialed the system will tell them what state the system is currently in and they can then press a digit (i.e.1) to put the system into that night mode.
a) Static Mode: If this box is checked no log in will be required, if checked it will require the caller to log in using their extension number and pin number.Set Variable: Here a variable can be set manually for use later in an IVR. This is an advanced feature who’s use is not recommended outside direct support form Phonesuite
Snooze 5 & 10 mins [only available in wakeup enabled IVRs]: These two actions allow a wakeup call to be delayed or snoozed for 5 or 10 minutes depending on the selection.
Start & Stop Recording: Begins or ends call recording.
Switch: This action will match the value entered against the variable defined. It then allows different actions based on possible matches. For example, one could use the variable “CALLERID(num)” and then enter all the elevator extensions how-to have them routed differently than normal extensions.
Time Periods: This option allows calls to be routed differently depending on the time. This can be used to play a one IVR during normal business hours, and a different one when the hotel is closed. Note that a time period must be set before this feature can be used, these are set using the “Time Periods” link on the left side of the page. See below for further information on setting up a time period.
Time Conditional: This feature can be used to route calls differently based on time of day. For example if the golf shop closes at 5pm a condition can be set in here to route a customer to different locations based on time of day. In practice: send to the golf store if it is between 8 and 5, and send to the operator if the caller is calling outside those hours.
a) Set an action for both Yes and No (i.e. where the call will go if it is in between the entered time and where it will go if it is not).
After the action is preformed the next thing to happen is selected from the “Then” dropdown. This is normally “Go to state” which sends the call to the next step of the IVR or ends the IVR by terminating in Hangup. It can also wait for a key press and do different things based on the number they press (like play a new voice prompt, or transfer the caller to an extension). To set actions based on key press check the box next to a number and set what action is to take place when the caller presses that number. For example checking 7 and choosing “hang up” will end the call if the caller presses 7 at this step in the IVR. Additional options include:
Allow extension dialing: Allows admin extension to be dialed (i.e. SIP phones with a User account assigned). A dropdown also allows only extensions with Reachable from IVRs enabled (see the Dial Plan chapter) enabled or to allow dialing of any system extension.
DUNDi: Not used, leave unchecked.
Capture digits: This option will take digits entered by the caller and place them into a variable that can be used later in the IVR. Note that variable memory will only be retained inside this IVR and will not be remembered between IVRs or at a later time.
Variable: A name for the variable, a simple name with no spaces is recommended
Max Digits: The maximum number of digits that will be placed into the variable
Min Digits: The minimum number of digits that will be placed into the veriable
Next State: Defines the next state (or step) of the IVR once the digits are captured
Allow Speech: Not used, do not check
Mode: Allows the format of the numbers to be selected. Options include Digits, Numbers, or Dollars and Cents. These are only used to help the system understand what type of data is being entered
Keypress Timeout: Length of time the system will wait for a key press after the sound file ends.
Timeout Replays: A dropdown allowing the section of the number of times the system will reply the sound file if no key press is made within the keypress timeout (above) window.
Timeout State: Here a section can be made as to where the caller should be sent should they fail to enter a valid key press and all replays have played.
Fail State: Location the caller should be sent should the IVR have some error and is unable to either play a sound or accept the information entered.
Not used, leave unchecked.
Not used, leave at “Do Nothing”.
Sidebar
View IVRs:
Clicking this will display a list of the IVRs that have been set up within the system, this is the default view of the IVRs page.
Add IVR:
This will allow a new IVR to be set up, this link is exactly the same as clicking the “Add IVR” button on the main page.
Create Folder:
This creates a new folder which can be named. This is used like a normal folder system and is intended to be used simply to keep the IVRs organized.
Time Periods:
Time Periods are a way of setting specific days and times to use in the IVR, these are most used for annual holidays. Each step in this process is outlined below.
Add the name of the time period (i.e. “Holidays”).
The name of this specific rule (i.e. Charismas Hours).
Here selection can be made as to whether this rule should apply for a date and time, just a date (the full day) or just a time. Normally date only or date and time is chosen. Setting up rules for time of day can be better accomplished with the time periods action.
The dates that this rule should be in effect.
The time this rule should be in effect (i.e. from 11:00PM (closing time) to 6:00AM (opening time)). In addition a date range can be selected and then only certain days of the week be enabled. This can be used to set a holiday every Thursday in the month of January for example.
Night Modes:
This screen allows Night Modes to be renamed or deleted.
Databases:
A Java database link can be established here, this link can then be used in an IVR. Setting up Java databased is beyond the scope of this manual and thus will not be covered here. Please also note that if a Java database is setup it must reside on a separate server, it can’t be hosted on the Voiceware server.
Scripts:
Here a Javascript can be written and saved for use in any IVR.
Logout:
Here the current user can log out to allow a different user to log in.
To edit the wakeup call IVR start by editing any other IVR in the system. Next change the URL “id=x” to “id=0” and press enter. This will load the default wakeup call for the system. From here you can make any adjustments that would normally be possible in an IVR (i.e. new sound files, new menu trees, etc…). Take care when editing this because it will be used for all wakeup calls thus errors will have a high impact on the hotel.