Professional Documents
Culture Documents
1.1 Audience
Reader of this document should have ZCSE certification2 and a detailed understanding of the Auto
Attendant scripting tool in the MX Admin User Interface. In addition the reader should be familiar with
at least one of the scripting languages mentioned in the introduction and a working knowledge of how to
use SQL queries to access information in a database. It is also highly recommended that the reader take
the IVR training course offered by Zultys which covers the topics in this document in detail.
1
Refer to the MX Administrator’s Manual for a detailed description of the Auto Attendant.
2
Zultys Certified Systems Engineer (ZCSE) training is provided by Zultys and teaches the fundamentals required as a basis for
understanding the material covered in this document.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 1 of 53
Advanced Auto Attendant Guide
2. The ability to create and modify variables providing a means to receive data from enterprise
databases.
3. Automatic script generation to aid partners in writing supporting applications on the Web server
that interact with the IVR. Such applications are responsible for data retrieval from databases and
other sources based on parameters passed from the MX. These Web server scripts pass
information back to the MX in VoiceXML snippets..
The basic architecture of the IVR solution is shown in Figure .
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 2 of 53
Advanced Auto Attendant Guide
VAR_NUMBER Includes all numeric characters and the decimal point 3.1415
(‘.’)
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 3 of 53
Advanced Auto Attendant Guide
All variable types can participate in “Dialog switching” within the AAA script.. Note that there is no
type BOOLEAN. It is recommended to use variable of VAR_INTEGER type equal to 1 for TRUE and 2
for FALSE as is common for “Yes or No” interfaces.
__CALL_ID__ VAR_STRING Unique identifier for a call (which can be used for
correlating the internal MX CDR database information
with an external database.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 4 of 53
Advanced Auto Attendant Guide
Action Description
Go to Unconditional transition to a specified dialog
Transfer Script execution is terminated and the phone call is transferred
to a specified extension
Transfer to Attendant Script execution is terminated and the phone call is transferred
to a pre-configured system attendant
Transfer to VM Caller is transferred to an MX user’s voice mail box where they
may leave a message for the user with a given extension. Once
the call is transferred, the script execution is terminated.
Dial by name Invokes a search for a user on the MX system by first name, last
name, or both.
Disconnect Script execution is terminated and the phone call is
disconnected.
Web Server request Request is sent to an external web server. Script execution is
continued for specified dialog after a response is received from
the web server.
Assign to variable Script transitions to a specified dialog with a variable being
assigned a specified value.
Change language Allows the script to switch between the various language packs
that have been installed on the MX for pronunciation of
variables
Fax on Demand Sends a specified fax to a specified phone number
3.4 Prompts
The dialogs and actions executed by a script are typically accompanied by various prompts. A prompt is
a sequence of audio files in .wav format which are specified by the author of the script. There are a
number of system standard .wav files that are present on any MX which can be used for prompts. To
pronounce a variable, the MX dynamically forms the required sequence of .wav files that correspond to
a specific pronunciation type. For example, if variable V1 is assigned to 23, and it is required to
pronounce in the prompt AS_INTEGER, then the sequence of {“twenty.wav”, “three.wav”} will be
substituted using system standard .wav files. The same variable pronounced using the type of
AS_DIGITS results in the sequence of {“two.wav”, “three.wav”} being substituted using system
standard .wav files. Pronunciation types are closely related to variable types, as it shown in Table 4
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 5 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 6 of 53
Advanced Auto Attendant Guide
3
This option is available only if a TTS Server is configured.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 7 of 53
Advanced Auto Attendant Guide
If the TTS server is successful in generating a .wav file in response to the request, it returns simple html
page with the following in the BODY of the file: “Response = OK”, “result = 1” and a URL with the
path to the .wav file specified as “file=<path>” .An example of a response is shown in Figure 3.
Zultys recommends the TTS solutions and voices from Acapela (http://www.acapela-group.com/) and
Neospeech (www.neospeech.com) as these are used internally by Zultys. Acapela supports European
languages and Neospeech supports US English and the Asian languages.
<HTML>
<HEAD/>
<BODY>
Response = OK
<br><HR>
result = 1<br>
file = http://tts.zultys-support.com/sounds/kate7773471114564526.wav
<br><HR>
argv[0] = C:\Inetpub\wwwroot\TTSSample.exe<br>argv[1] = 777<br>
argv[2] = 347<br>
argv[3] = 1234<br>
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 8 of 53
Advanced Auto Attendant Guide
argv[4] = 100<br>
argv[5] = hello<br><br>
<HR>Response time = 62.5 ms<br>
</BODY>
</HTML>
Figure 3 Example of Real-Time response from TTS server
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 9 of 53
Advanced Auto Attendant Guide
Figure 5 – Dynamic Fax On Demand to request fax files from a web server
With Dynamic Fax on Demand a caller hears a recorded message which reads the list of fax documents
that have been made available in a certain directory on a web server. The caller can choose a document
to be faxed, enter the number of the fax machine where the document should be sent and then go on
hook. The MX automatically dials the fax number entered and faxes the appropriate document. The
example shown in Figure 5 indicates how faxes can be received from an external web server.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 10 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 11 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 12 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 13 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 14 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 15 of 53
Advanced Auto Attendant Guide
The script execution begins with the Advanced AA pronouncing the .wav files specified in the Prompts
list.
The variable used as an input source is the __ANI__ system variable (which contains the calling party
phone number, if available). This is done by selecting the Variable or Dialog radio button and choosing
_ANI_ from the list. The switching conditions are specified in the Actions table. If __ANI__ is not
received the “No Input” condition will be true and the dialog Language will be entered because of the
GoTo action. Otherwise, the No Match condition will be satisfied and the Web Server Request action
will be executed to initiate looking up the _ANI_ in the database.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 16 of 53
Advanced Auto Attendant Guide
parameter for the script as pANI, and then Request tab of Web Server Request action should look like
one shown on Figure 10.
Note: If the checkbox under the Variable column is not selected. the string “__ANI__” will be sent to
the web server instead of the calling party number.
The AAA sends the parameters to the web server using POST (if the Use Post Method checkbox is
checked) or GET HTTP methods. In the latter case the parameters are joined to the URL string, so you
should take into account the maximum length message that your web server can receive.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 17 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 18 of 53
Advanced Auto Attendant Guide
Note: The output parameters returned by the web script are temporary variables which are not available
outside of this action.
Note: If required you can assign the value of an output parameter to several variables. In other words
the left column in the Response tab can contain multiple different Script Parameters with the same
variable assigned to each.
The predefined variables __ERR_CODE__ and __ERR_DETAILS__ are returned and used
automatically and do not need to be explicitly specified.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 19 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 20 of 53
Advanced Auto Attendant Guide
Figure 12 – Root Dialog, Web Server Request action, Web Script generation
You can skip this operation by selecting “None” in the Script Type field.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 21 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 22 of 53
Advanced Auto Attendant Guide
51
52 #=== }}}}}
53
54 #=======================================================
55 # Output variables checking.
56 #=======================================================
57 if (!(defined $OP_caller_info && isvalidinteger($OP_caller_info))) {
58 $ERR_CODE__ = "3";
59 $ERR_DETAILS__ = "Invalid value '$OP_caller_info' for parameter 'OP_caller_info'";
60 }
61 if (!(defined $OP_language && isvalidinteger($OP_language))) {
62 $ERR_CODE__ = "3";
63 $ERR_DETAILS__ = "Invalid value '$OP_language' for parameter 'OP_language'";
64 }
65 print qq|<?xml version="1.0"?>|;
66 print qq|<vxml version="2.0">|;
67 print qq| <catch event="error.semantic.ecmascript">|;
68 print qq| <var name="__ERR_CODE__" expr = "6" />|;
69 print qq| <var name="__ERR_DETAILS__" expr = "'Returned VXML execution error'" />|;
70 print qq| <return namelist="__ERR_CODE__ __ERR_DETAILS__" />|;
71 print qq| </catch>|;
72 print qq| <var name="__ERR_CODE__" expr = "$ERR_CODE__" />|;
73 print qq| <var name="__ERR_DETAILS__" expr = "'| . convert2vxml($ERR_DETAILS__) . qq|'" />|;
74 print qq| <var name="OP_caller_info" expr = "$OP_caller_info" />|;
75 print qq| <var name="OP_language" expr = "$OP_language" />|;
76 print qq| <form id="DB_Test">|;
77 print qq| <block>|;
78 print qq| <return namelist="__ERR_CODE__ __ERR_DETAILS__ OP_caller_info OP_language" />|;
79 print qq| </block>|;
80 print qq| </form>|;
81 print qq|</vxml>|;
82
83 #=======================================================
84 # Used functions. DO NOT EDIT!
85 #=======================================================
86
87 sub convert2vxml {
88 $_ = shift;
89 s/&/&/g;
90 s/\\/\\\\/g;
91 s/</</g;
92 s/>/>/g;
93 s/"/\\"/g;
94 s/chr(8)/\\b/g;
95 s/chr(9)/\\t/g;
96 s/chr(10)/\\n/g;
97 s/chr(11)/\\v/g;
98 s/chr(12)/\\f/g;
99 s/chr(13)/\\r/g;
100 s/'/\\'/g;
101 return $_;
102 }
103
104 sub isvaliddate {
105 my $input = shift;
106 my $DataPattern = '^(?:(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.]((?:19|20)\d\d))$';
107 if ($input =~ m!$DataPattern!) {
108 # At this point, $3 holds the year, $1 the month and $2 the day of the date entered
109 if ($2 == 31 and ($1 == 4 or $1 == 6 or $1 == 9 or $1 == 11)) {
110 return 0; # 31st of a month with 30 days
111 } elsif ($2 >= 30 and $1 == 2) {
112 return 0; # February 30th or 31st
113 } elsif ($1 == 2 and $2 == 29 and not ($3 % 4 == 0 and ($3 % 100 != 0 or $3 % 400 == 0))) {
114 return 0; # February 29th outside a leap year
115 } else {
116 return 1; # Valid date
117 }
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 23 of 53
Advanced Auto Attendant Guide
118 } else {
119 return 0; # Not a date
120 }
121 }
122 sub isvalidtime {
123 my $input = shift;
124 my $TimePattern = '^(([0-1][0-9]|2[0-3]):[0-5][0-9])$';
125 if ($input =~ m!$TimePattern!) {
126 return 1;
127 }
128 return 0;
129 }
130 sub isvalidnumber {
131 my $input = shift;
132 my $NumberPattern = '^([-+]?([0-9]*\.)?[0-9]+)$';
133 if ($input =~ m!$NumberPattern!) {
134 return 1;
135 }
136 return 0;
137 }
138 sub isvalidinteger {
139 my $input = shift;
140 my $IntegerPattern = '^([-+]?[0-9]+)$';
141 if ($input =~ m!$IntegerPattern!) {
142 return 1;
143 }
144 return 0;
145 }
146 sub isvalidstring {
147 my $input = shift;
148 return 1;
149 }
The breakdown of the script Refill_1.pl is shown in Table 5 . The script text should not be modified
except to inserting the user’s procedure in the appropriate place. Otherwise, problems with compatibility
between versions can arise.
Line 1 Specifies the location of the Perl interpreter on the processing machine. Not used in
Windows.
Lines 2-6 Commented information about date of script generation and version of software
used.
Lines 8-9 Perl script tuning. Warning results in the generation of warnings and strict requires
that all variables be declared before they are used.
Line 10 Imports the Perl CGI module that will handle the bulk of the CGI processing.
Line 11 Turns off buffering so that the output is sent immediately from the server.
Lines 13-16 Declaration of working variables. Variables $ERR_CODE__ and $ERR_DETAILS__ will
contain a numeric code and a text description of the last error and $cgi, an object of CGI
class, will be used for the retrieval of input parameters.
Lines 21-26 This is a piece of code for handling the only input parameter passed to this script,
pANI. A variable with the same name as the input parameter ($pANI) is introduced.
Note that all information that is known about this parameter from the XML script
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 24 of 53
Advanced Auto Attendant Guide
Next you should copy the file into a directory known to your web server and call the script by requesting
the next URL in your browser. As an example:
http://localhost/cgi-bin/Refill_1.pl?pANI=4083280450
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 25 of 53
Advanced Auto Attendant Guide
Note that with this approach we can only pass parameters using the GET method. Parameters should be
separated from the script name by using the ‘?’ symbol, and separated from each other using the ‘&’. In
return the web browser should display a page similar to the one shown in Figure 15.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 26 of 53
Advanced Auto Attendant Guide
a third party. For our example this web page is shown in Figure 16. The parameters can be passed both
by the GET and POST methods depending on the selection in Figure 25. After pressing the Send button
the corresponding script will be invoked and the web browser will display the corresponding output
VoiceXML script..
#=== {{{{{
if ($ERR_CODE__ == 0) {
use Refill_1_sup;
($OP_caller_info, $OP_Language,$ERR_CODE__,$ERR_DETAILS__) = Refill_1($pANI);
}
#=== }}}}}
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 27 of 53
Advanced Auto Attendant Guide
Lines 12-13 Connects to a database using the connect method of class DBI. This attempts to
open a connection to the local MySQL server’s database named test. The user is
root and the password is thepassword. The connect method returns a database
handle if it is successful and leaves the variable $dbh undefined otherwise.
Lines 14-15 Preparation and execution of SQL statement. Two fields are selected from the
patient table in the database based on the caller’s caller ID (ANI). The first
argument indicates whether the caller is able to use the IVR, while the second
defines whether or not the caller is a Spanish speaker.
Lines 16-26 If the previous step is successful the results are analyzed here. There may be no
patient with the given caller ID (ANI) or there may be more than one patient with
the same caller ID (ANI) . The output variable $ivrable is set to 0 if at least one of
the patients prefers not use the IVR. The variable $spanish is set to 1 if any patient
speaks Spanish. The variables are left unchanged if no patient was found for the
given ANI.
It is required to set the value of $err to 0 here since this a successful subroutine
execution.
Line 28 Closes the connection to the database.
Line 30 Subroutine returns an array of results. Note that $DBI:errstr contains the last
database error description.
1 use warnings;
2 use strict;
3 use DBI;
4
5 sub Refill_1 {
6
7 my $ivrable = 1;
8 my $spanish = 0;
9 my $err = 4;
10 my $ani=shift;
11
12 my $dbh = DBI->connect('dbi:mysql:test','root',’thepassword');
13 if ($dbh) {
14 my $sth = $dbh->prepare("SELECT pat_ivr_refill_allowed, pat_spanish_pcm_pde
FROM patient
WHERE pat_phone=\"$ani\" OR pat_phone2=\"$ani\"");
15 if ($sth && $sth->execute()) {
16 my ($pers_ivrable, $pers_spanish);
17 $sth->bind_col(1, \$pers_ivrable);
18 $sth->bind_col(2, \$pers_spanish);
19
20 while ($sth->fetch) {
21 $ivrable = 0 if ($pers_ivrable ne "Y");
22 $spanish = 1 if ($pers_spanish eq "Y");
23 }
24
25 $sth->finish();
26 $err = 0;
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 28 of 53
Advanced Auto Attendant Guide
27 }
28 $dbh->disconnect;
29 }
30 return ($ivrable, $spanish, $err, $DBI::errstr);
31 }
32 1;
4.2.4 DBReq_1 and Language Dialogs and the Change Language Action
These dialogs are used to switch script execution between the English and Spanish languages. The
DBReq_1 dialog (shown in Figure 19) performs this switch based on the value of the iDBCallerInfo
variable.
To enable this behavior Variable or Dialog is selected as the Input source and variable iDBCallerInfo is
selected from the pull down menu. Depending on the value of iDBCallerInfo the script will transition to
an English dialog or a Spanish dialog. The change to a Spanish dialog is accomplished with a
ChangeLanguage action or within the Language dialog with a GoTo action.
The script reaches the Language dialog only if the caller’s language can not be determined
automatically. The Language dialog explicitly asks the caller to press “1” to switch to English, or “2” to
switch to Spanish. A screen shot of this dialog is shown in Figure 21.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 29 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 30 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 31 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 32 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 33 of 53
Zultys Technologies
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 34 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 35 of 53
Zultys Technologies
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 36 of 53
Advanced Auto Attendant Guide
#! /usr/bin/perl
#=======================================================
# Generated by ScriptGen v1.38 (build 126, "OS_BUILD")
# at Mon Oct 03 18:43:51 2005
#=======================================================
use warnings;
use strict;
use CGI qw(:all);
my $cgi = new CGI;
#Variables ERR_CODE__ and ERR_DETAILS are reserved for errors indication
my $ERR_CODE__="0";
my $ERR_DETAILS__="";
#=======================================================
# Input Parameters Section. DO NOT EDIT!
#=======================================================
#Name: pPrescrId
my $pPrescrId = $cgi->param("pPrescrId");
if (!(defined $pPrescrId)) {
$ERR_CODE__ = "2";
$ERR_DETAILS__ = "Input parameter 'pPrescrId' is undefined";
}
#=======================================================
# Output Parameters Section. DO NOT EDIT!
#=======================================================
#Name: pDBResult
#Variable: iDBResult
#Type: Integer
#Comment:
0=OK,1=Unknown,2=NotFound,3=Discontinued,4=TooSoon,5=Expired,6=NoRefillsLeft,10=unknown
my $pDBResult="";
#Name: pPatientLastName
#Variable: sPatientLastName
#Type: String
#Comment: Patient's last name
my $pPatientLastName="";
#Name: pPatientFirstName
#Variable: sPatientFirstName
#Type: String
#Comment: Patient's first name
my $pPatientFirstName="";
#Name: pPickupDate
#Variable: dPickupDate
#Type: Date
#Comment: Prescription pick-up date
my $pPickupDate="";
#Name: pPickupTime
#Variable: tPickupTime
#Type: Time
#Comment: Prescription pick-up time
my $pPickupTime="";
#Name: pFaxNumb
#Variable: sDoctorFax
#Type: String
#Comment: Doctor's fax number
my $pFaxNumb="";
#Name: pFaxLocation
#Variable: sFaxURL
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 37 of 53
Advanced Auto Attendant Guide
#Type: String
#Comment: Path to prepared fax file
my $pFaxLocation="";
#=======================================================
#=== PLEASE INSERT THE CODE HERE FOR ASSIGNING THE REAL VALUES
#=== TO FOLLOWING VARIABLES:
#=== $pDBResult, $pPatientLastName, $pPatientFirstName, $pPickupDate, $pPickupTime, $pFaxNumb,
$pFaxLocation
#=== SET $ERR_CODE__ = "5" (i.e. "User Defined Error")
#=== AND $ERR_DETAILS__ TO EXPLANATION STRING IF A WRONG CONDITION SHOULD ARISE.
#=== {{{{{
if ($ERR_CODE__ == 0) {
use Refill_1_sup;
($pDBResult,$pPatientLastName,$pPatientFirstName,$pPickupDate,$pPickupTime,$pFaxNumb,
$pFaxLocation,$ERR_CODE__,$ERR_DETAILS__) = Refill_2($pPrescrId);
}
#=== }}}}}
#=======================================================
# Output variables checking.
#=======================================================
if (!(defined $pDBResult && isvalidinteger($pDBResult))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$pDBResult' for parameter 'pDBResult'";
}
if (!(defined $pPatientLastName && isvalidstring($pPatientLastName))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$pPatientLastName' for parameter 'pPatientLastName'";
}
if (!(defined $pPatientFirstName && isvalidstring($pPatientFirstName))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$pPatientFirstName' for parameter 'pPatientFirstName'";
}
if (!(defined $pPickupDate && isvaliddate($pPickupDate))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$pPickupDate' for parameter 'pPickupDate'";
}
if (!(defined $pPickupTime && isvalidtime($pPickupTime))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$pPickupTime' for parameter 'pPickupTime'";
}
if (!(defined $pFaxNumb && isvalidstring($pFaxNumb))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$pFaxNumb' for parameter 'pFaxNumb'";
}
if (!(defined $pFaxLocation && isvalidstring($pFaxLocation))) {
$ERR_CODE__ = "3";
$ERR_DETAILS__ = "Invalid value '$pFaxLocation' for parameter 'pFaxLocation'";
}
print qq|<?xml version="1.0"?>|;
print qq|<vxml version="2.0">|;
print qq| <catch event="error.semantic.ecmascript">|;
print qq| <var name="__ERR_CODE__" expr = "6" />|;
print qq| <var name="__ERR_DETAILS__" expr = "'Returned VXML execution error'" />|;
print qq| <return namelist="__ERR_CODE__ __ERR_DETAILS__" />|;
print qq| </catch>|;
print qq| <var name="__ERR_CODE__" expr = "$ERR_CODE__" />|;
print qq| <var name="__ERR_DETAILS__" expr = "'| . convert2vxml($ERR_DETAILS__) . qq|'" />|;
print qq| <var name="pDBResult" expr = "$pDBResult" />|;
print qq| <var name="pPatientLastName" expr = "'| . convert2vxml($pPatientLastName) . qq|'"
/>|;
print qq| <var name="pPatientFirstName" expr = "'| . convert2vxml($pPatientFirstName) . qq|'"
/>|;
print qq| <var name="pPickupDate" expr = "'| . convert2vxml($pPickupDate) . qq|'" />|;
print qq| <var name="pPickupTime" expr = "'| . convert2vxml($pPickupTime) . qq|'" />|;
print qq| <var name="pFaxNumb" expr = "'| . convert2vxml($pFaxNumb) . qq|'" />|;
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 38 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 39 of 53
Advanced Auto Attendant Guide
If the prescription has expired or there are no refills are left (iDBResult = 5 and 6, respectively), then the
AskIfContactDoctor dialog is executed.
The call is transferred to an Attendant if there are any problems with the retrieved data not matching the
defined values.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 40 of 53
Advanced Auto Attendant Guide
Fax sending is performed in “background mode”, i.e. a script does not wait until the operation is
executed. The number of attempts to send a fax and the time interval between attempts are specified in
MX system settings. The results can be tracked using CDR reports.
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 41 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 42 of 53
Advanced Auto Attendant Guide
In the ContactPhone dialog the caller is asked to enter a contact phone number. In the DeliveryOptions
dialog the caller selects their preferred method of obtaining the refill (1-pickup, 2-delivery, 3-by mail).
This is shown in Figure 30 below:
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 43 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 44 of 53
Zultys Technologies
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 45 of 53
Zultys Technologies
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 46 of 53
Zultys Technologies
#=== {{{{{
if ($ERR_CODE__ == 0) {
use DBUpdate_sup;
($the_date,$the_time,$ERR_CODE__,$ERR_DETAILS__) =
DBUpdate_sub($prescr_id,$phone,$delivery,$previousResult);
}
#=== }}}}}
1 use warnings;
2 use strict;
3 use DBI;
4
5 sub DBUpdate_sub {
6
7 my $ivrable = 1;
8 my $spanish = 0;
9 my $err = 4;
10 my $ani=shift;
11
12 my $dbh = DBI->connect('dbi:mysql:test','root',’thepassword');
13 if ($dbh) {
14 my $sth = $dbh->prepare("SELECT pat_ivr_refill_allowed, pat_spanish_pcm_pde
FROM patient
WHERE pat_phone=\"$ani\" OR pat_phone2=\"$ani\"");
15 if ($sth && $sth->execute()) {
16 my ($pers_ivrable, $pers_spanish);
17 $sth->bind_col(1, \$pers_ivrable);
18 $sth->bind_col(2, \$pers_spanish);
19
20 while ($sth->fetch) {
21 $ivrable = 0 if ($pers_ivrable ne "Y");
22 $spanish = 1 if ($pers_spanish eq "Y");
23 }
24
25 $sth->finish();
26 $err = 0;
27 }
28 $dbh->disconnect;
29 }
30 return ($ivrable, $spanish, $err, $DBI::errstr);
31 }
32 1;
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 47 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 48 of 53
Advanced Auto Attendant Guide
rx
PK rx_id drug
PK drug_abbrev
FK1 pat_id
rx_status
drug_trade_name
prev_refill
drug_generic_name
expired
drug_refill_reminder
FK2 drug_abbrev
drug_discontinued
patient
doctor
PK pat_pers_id
PK doc_code
pat_lname
doc_lname
pat_fname
doc_fname
pat_phone
doc_title
FK1 pat_usual_doctor_code
doc_phone
pat_refill_reminder
doc_fax
pat_ssn
doc_call_fax_pref
pat_spanish_pcm_pde
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 49 of 53
Advanced Auto Attendant Guide
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 50 of 53
Advanced Auto Attendant Guide
7 Table of Contents
1 Introduction .........................................................................................................................1
1.1 Audience ....................................................................................................................................................... 1
2 IVR Architecture in Brief......................................................................................................1
2.1 Examples in this document ........................................................................................................................... 3
3 Brief Introduction to the AAA Scripting Tool ........................................................................3
3.1 Types of Variables ........................................................................................................................................ 3
3.2 Predefined Variables..................................................................................................................................... 4
3.3 Dialogs and Actions ...................................................................................................................................... 4
3.4 Prompts ......................................................................................................................................................... 5
3.5 Using an External TTS Server ...................................................................................................................... 7
3.5.1 Communicating with the TTS Server ............................................................................................................ 7
3.5.2 Configuring Access to the TTS Server.......................................................................................................... 9
3.6 Dynamic Fax On Demand........................................................................................................................... 10
4 Example - Drug Refill System ...........................................................................................11
4.1 Drug Refill System - State Machine ............................................................................................................ 11
4.2 Drug Refill System –Script Variables .......................................................................................................... 14
4.2.1 Root Dialog ................................................................................................................................................. 15
4.2.2 Web Script................................................................................................................................................... 22
4.2.3 Using Script Output in Voice Scenario........................................................................................................ 29
4.2.4 DBReq_1 and Language Dialogs and the Change Language Action ........................................................ 29
4.2.5 English Dialog – Main System Menu .......................................................................................................... 33
4.2.6 AnalyzeDB Dialog ....................................................................................................................................... 39
4.2.7 AskIfContactDoctor Dialog Demonstrating the Fax on Demand Action ..................................................... 40
4.2.8 Refill Delivery .............................................................................................................................................. 42
5 Appendix A. Database Scheme ........................................................................................49
6 Appendix B. Language codes passed to a TTS Server script ...........................................50
7 Table of Contents..............................................................................................................51
8 List of Tables.....................................................................................................................52
9 List of Figures....................................................................................................................52
10 Colophon...........................................................................................................................53
10.1 Software ...................................................................................................................................................... 53
10.2 Fonts ........................................................................................................................................................... 53
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 51 of 53
Advanced Auto Attendant Guide
8 List of Tables
Table 1 – Types of Variables......................................................................................................3
Table 2 - Pre-defined Variables..................................................................................................4
Table 3 - Pre-defined Actions....................................................................................................5
Table 4 – Pronounciation Modifiers ............................................................................................7
Table 5: Breakdown of script Refill_1.pl ...................................................................................25
Table 6 – Language Codes Passed to a TTS Server Script.....................................................50
9 List of Figures
Figure 1 – IVR Solution Overview ..............................................................................................2
Figure 2- Example – Using external TTS servers.......................................................................8
Figure 3 Example of Real-Time response from TTS server .......................................................9
Figure 4 – Configuring Access to Real-Time TTS Server...........................................................9
Figure 5 – Dynamic Fax On Demand to request fax files from a web server ....................10
Figure 6 – Drug Refill Application State Machine .....................................................................13
Figure 7- Script Properties Screen ...........................................................................................15
Figure 8 – Root Dialog ...........................................................................................................15
Figure 9 – Root Dialog, GoTo Action....................................................................................16
Figure 10 – Root Dialog, Web Server Request action, Request parameters.....................18
Figure 11 – Root Dialog, Web Server Request action, Response parameters.........................20
Figure 12 – Root Dialog, Web Server Request action, Web Script generation ........................21
Figure 13 Script Generation Parameters for Refill_1.pl ............................................................24
Figure 14 – Temporary assignment of output variables to dummy values ...............................25
Figure 15 – Script Output .........................................................................................................26
Figure 16 – Script Input Parameters ........................................................................................26
Figure 17 – Modification of Refill_1.pl ......................................................................................27
Figure 18 – Refill_1_sup.pm Module........................................................................................29
Figure 19 – DBReq_1 Dialog ...................................................................................................30
Figure 20 – Change Language Action......................................................................................31
Figure 21 – Language Dialog ................................................................................................32
Figure 22 – English Dialog – Sample Drug Store Main Menu.............................................33
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 52 of 53
Advanced Auto Attendant Guide
10 Colophon
10.1 Software
This document was created in Microsoft Word 2002. The figures were imported from Microsoft Visio
2002.
10.2 Fonts
The following the list of paragraph styles and fonts used in this document:
• Heading 1 (1)– Arial, 16 pt, bold
• Heading 2 (1.1) – Arial, 14 pt, bold, italic
• Heading 3 (1.1.1) – Arial, 13 pt, bold
• Heading 4 (1.1.1.1) – Times New Roman, 12 pt, bold
• Heading 5 (1.1.1.1.1) – Times New Roman, 11 pt, bold, italic
• Body text – Times New Roman, 12 pt
• Caption (Figures and Tables) – Arial, 10 pt, bold
• Footer – Arial, 8 pt
• Header – Arial, 12 pt, bold
• TOC1 – Arial, 12 pt
• TOC2 – Arial, 10 pt
• TOC3 – Arial, 10 pt
2 October 2007 Document 95-10098-03 — IVR - Advanced Auto Attendant Guide Page 53 of 53