Creating a Basic Script

Table of Contents

Designing a Basic Script
SNU Script Variables
The Start Step
The Accept Step
The Play Prompt Step
The Label Step (GetUser)
The Name To User Step
The Get Digit String Step
The Authenticate User Step
The Recording Step
The Menu Step
The Closing Steps of the SNU.aef Script

Designing a Basic Script


You can use the Cisco Customer Response Applications (CRA) Editor to create a number of basic scripts.

This chapter describes the steps used to create a Spoken Name Upload (SNU) script, SNU.aef, which is included with the Cisco CRA Editor.

The SNU.aef script allows users to record their names over the phone so that the script can play back their spoken names to prospective callers.

This script contains good examples of the use of steps in the Contact, Prompt, and User palettes. It also demonstrates the use of the If and Set steps from the General palette.

Figure 3-1 shows how the SNU.aef script appears in the Design pane of the CRA Editor window.


Figure 3-1   SNU.aef Script Overview in the Design Pane


The SNU.aef script performs the following tasks:

1. Accepts the call and plays a welcoming prompt.

2. Prompts the caller to enter a name, using either DTMF (Dual Tone Multi-Frequency) digits or speech.

3. Compares the caller input to names in a directory.

4. If a match is found, prompts the caller to enter a Personal Identification Number (PIN).

5. Authenticates the user using the PIN.

6. Records the name of the caller.

7. Allows the caller to confirm the recording, or to try again.

8. Plays a final prompt to say good-bye to the caller, and then terminates the call.


Note   In designing scripts, remember that any step that requires caller input can fail to receive an acceptable response, which is why even a simple script often requires a number of steps and output branches to handle errors and failures.

This chapter contains the following sections:Figure 3-1Figure 3-1

SNU Script Variables

The designer begins the broadcast.aef script design process by using the Variable pane of the CRA Editor to define script variables.


Note   For more information about defining variables, see the "The Variable Pane" section on.

Figure 3-2 shows the variables of the SNU.aef script as they appear in the Variable pane of the CRA Editor window.


Figure 3-2   Variables Listed in the Variable Pane


Table 3-1 describes the variables used in the SNU.aef sample script.

Table 3-1   Variable Descriptions

Variable Name Variable Type Value Function

pin

String

Stores PIN digits entered by the user in the Get Digit String step. Used by the Authenticate User step to authenticate user.

(See The Get Digit String Step and The Authenticate User Step.)

user

User

null

Stores the values associated with this particular user. First assigned a value by the Name To User step, and used by various other steps.

(See The Name To User Step, and The Authenticate User Step.)

recording

Document

null

Stores the audio file recorded by the caller.

(See The Recording Step.)

finalPrompt

Prompt

Prompt played back to the caller at the conclusion of the call. The value is dynamically assigned by various steps in the script.

(See The Timeout Output Branch, and The Unsuccessful Output Branch.)

triesAuthentication

Integer

0

Stores the number of times authentication has been attempted.

(See The Fail Output Branch.)

triesMaxAuthentication

Integer

3

Stores the maximum number of attempts the script will make to authenticate the caller.

(See The Fail Output Branch.)

triesRecord

Integer

0

Stores the number of times that recording has been attempted.

(See The Key 2 Output Branch.)

triesMaxRecord

Integer

3

Stores the maximum number of attempts the script will make to record the name of the caller.

(See The Key 2 Output Branch.)

currentRecording

Document

null

Stores a recorded name.

(See The Get User Info Step.)

fullName

String

Stores the full name of the user. Used by the Create Generated Prompt step.

(See The If Step.)

triesGetDigit

Integer

0

Stores the number of times the script has attempted to get PIN digits.

(See The True Output Branch.)

triesMaxGetDigit

Integer

3

Stores the maximum number of retries the script attempts to get PIN digits.

(See The True Output Branch.)

spelledPrompt

Prompt

Stores the name of the user, as created by the Create Container Prompt step.

(See The If Step and The Get Digit String Step.)

The Start Step

A designer begins every CRA script by choosing File > New from the CRA Editor menu bar. The Start step appears automatically in the Design pane of the CRA Editor window. The Start step has no properties and does not require a customizer. It is not shown in any palette.

The Accept Step

The designer continues the SNU.aef script by dragging an Accept step from the Contact palette (in the Palette pane) to the Design pane of the CRA Editor window, as shown in Figure 3-1 .

A script uses an Accept step to accept a contact. (A contact can be a telephone call, an e-mail message, or an HTTP request. In the SNU.aef script, the contact is a call.)

Figure 3-3 shows the customizer window for the Accept step.


Figure 3-3   Accept Customizer Window


To use the Accept customizer window to configure the Accept step, the designer clicks the Contact drop-down arrow to choose a contact, and then clicks OK.

The Accept customizer window closes, and the name of the Contact variable appears next to the Accept step icon in the Design pane of the CRA Editor.

The default Contact is "--Triggering Contact--", which simply means that whichever contact triggers the execution of the script is the triggering contact for this step.

The Play Prompt Step

The designer continues the SNU.aef script by dragging a Play Prompt step from the Media palette to the Design pane, as shown in Figure 3-1 .

Next, the designer configures this Play Prompt step to play back to the caller the system prompt SP[SNU\welcomeSpokenName.wav], which plays "Welcome to the Cisco Spoken Name Upload Application."

Figure 3-4 shows the configured Prompt tab of the Play Prompt customizer window.


Figure 3-4   Play Prompt Customizer Window—Configured Prompt Tab


The designer configures the Play Prompt step as follows:

  • General tab
    • Contact—Triggering Contact

The step operates on the contact that triggers the execution of the script.

  • Interruptible—Yes

External events can interrupt the playing of the prompt. (At this point the script has not yet queued the call, so this configuration has no effect.)

  • Prompt tab
    • Prompt—SP[SNU\welcomeSpokenName.wav]

SNU\welcomeSpokenName.wav is the prompt that the Play Prompt step plays back to welcome the caller.

Because the .wav file that serves as the welcoming prompt already exists as a system prompt, the designer does not need to define it as a variable; instead, the designer enters the prompt directly by clicking the Expression Editor (...) button and entering the name in the text field of the Expression Editor dialog box that appears. (See Figure 3-5 .)


Figure 3-5   Expression Editor Dialog Box



Note    For more information about using the Expression Editor, see the "Expressio ns" section.

  • Barge in—Yes

The caller can interrupt the prompt playback.

  • Continue on Prompt Errors—Yes

In the event of a prompt error, the script continues to play back the next prompt in the sequence or waits for caller input.

  • Input tab
    • Flush Input Buffer—No

The system does not erase previously entered input before capturing new caller input.


Note   For more information about configuring the Play Prompt step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Label Step (GetUser)

The designer continues the SNU.aef script by dragging a Label step from the General palette to the Design pane. (The Label step will have the name GetUser, as shown in Figure 3-1 .)

The designer configures the Label step to provide a target for subsequent steps, if it becomes necessary to send the caller back for further attempts to successfully execute the Name To User step.

The designer configures the Label customizer window by entering the name GetUser in the Enter Label Name text field, and then clicking OK.

The designer will configure the subsequent Name To User step to send the script to the Label with this name, if necessary.


Note   For more information about configuring the Label step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Name To User Step

The designer continues the SNU.aef script by dragging a Name To User step from the Media palette to the Design pane.

Next, the designer configures the Name To User step to prompt the caller to enter a name and then compare the name received with a directory of names to find out if the name given by the caller exists in the directory.

The designer configures the three tabs of the Name To User customizer window as follows:

  • General tab
    • Result User—user

The user variable stores the values associated with this particular user. (The subsequent Get User Info step under the Successful output branch uses the user variable to find out whether or not a current recording exists for this name.)

  • Announce When Number of Matches Less Than—4

If the number of matches is less than 4, the script prompts the user to choose the correct entry from the list of matches. If the number of matches is greater than or equal to 4, the script prompts the user to enter additional letters to reduce the number of matches.


Note    This property applies only if the caller is inputting DTMF digits and is not using an ASR (Automatic Speech Recognition) channel.

  • Operator—No

The caller does not have the choice to ask to speak to an operator, and therefore the Operator output branch of the Name To User step does not appear in the script.

  • Interruptible—No

No external event is allowed to interrupt the execution of the Name To User step.

  • Prompt tab
    • Prompt—Default Prompt

The script plays back to the caller the default prompt included with the Name To User step. The default prompt plays a prompt that starts "Spell the last name followed by the first name. . . ." (The designer can also choose a customized prompt or choose no prompt playback.)

  • Barge In—Yes

The caller is allowed to enter a name without having to listen to the entire playback of the prompt.

  • Continue on Prompt Errors—Yes

In the event of a prompt error, the script continues to play back the next prompt in the sequence or simply waits for input from the caller.

  • Input tab
    • Input Length—10

The value 10 is the minimum number of digits required before the step automatically checks for a user match. (This property applies only to non-ASR channels.)

  • Terminating Key—#

The caller can press the "#" key to indicate completion of input.

  • Cancel Key—*

The caller can press the "*" key to start over. (The cancel key works only until the number of maximum retries is reached.)

  • Maximum Retries—3

The step makes three attempts to receive valid input before executing the Unsuccessful output branch.

  • Initial Timeout (in sec)—5

The system waits 5 seconds for initial input from the caller before executing the Unsuccessful output branch.

  • Interdigit Timeout (in sec)—3

The system waits 3 seconds after receiving initial input from the caller for the caller to enter the next digit, before executing the Unsuccessful output branch. (This property does not apply for ASR channels.)

  • Flush Input Buffer—Yes

The system erases previously entered input before capturing new caller input.


Note   For more details on configuring the Name To User step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Name To User step in this script has three output branches (see Figure 3-6 ):

  • Successful—Executes when the step makes a successful match between the name entered by the caller and a name in the directory.
  • Timeout—Executes when the step reaches the maximum number of retries and the last attempt times out while waiting for input from the caller.
  • Unsuccessful—Executes when the step does not make a successful match between the name entered by the caller and a name in the directory, or because the last attempt failed because the caller pressed the cancel key.

Figure 3-6   Name To User Step Output Branches


The following sections describe the three output branches of the Name To User step:

The Successful Output Branch

If the Name To User step makes a successful match between the name entered by the caller and a name in the user directory, the script executes the Successful output branch of the Name To User step.

Figure 3-7 shows the first two steps under the Successful output branch of the Name to User step.


Figure 3-7   Name To User Step—Successful Output Branch


The designer configures the Successful output branch to authenticate the user and record a spoken name.

The Successful output branch contains the following steps:

1. The Get Info step

2. The If step

3. The Label step (GetPin)

4. The Get Digit String step

The first two steps of the Successful output branch collect the name of the caller, which is used in the fourth step of the branch to address the caller by name.

The third step (the GetPin step) provides a target for the script in the event the step reaches the timeout limit, so that the script can continue to attempt to receive the PIN number (with the subsequent Get Digit String step) until the step reaches the maximum number of retries.

The fourth and final step (the Get Digit String step) asks for the PIN number of the caller, to make sure the caller has the authority to record this name.

(Because of its multiple output branches, the Get Digit String step is discussed in a separate section, The Get Digit String Step.)

This section contains the following topics:

The Get User Info Step

The designer begins to build the Successful output branch of the Name To User step by dragging a Get User Info step from the User palette and dropping it into the Successful icon under the Name To User step in the Design pane.

Next, the designer configures the Get User Info step to retrieve the information stored in the user variable (associated with this contact by the previous Name To User step) to be used by the If step to determine which branch of the If step to execute.

Figure 3-8 shows the configured Get User Info customizer window.


Figure 3-8   Configured Get User Info Customizer Window


The designer configures the Get User Info customizer window to retrieve the information stored in the currentRecording variable, which is a Document variable that holds a recorded name.

To configure the Get User Info customizer window, the designer highlights the Spoken Name attribute and clicks Set. Then, in the Get User dialog box that appears, the designer chooses the currentRecording variable from the drop-down menu and clicks OK. The Get User dialog box closes, and currentRecording appears next to the Spoken Name attribute in the list box of the Get User Info customizer window.


Note   For more information about configuring the Get User Info step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The If Step

Because the script designer cannot know in advance whether a recording of the spoken name of any particular caller exists at the time of any particular call, the designer uses the If step to provide script logic for each of the two possibilities: that a recording of the spoken name exists, and that a recording of the spoken name does not exist.

The designer continues building the Successful output branch of the Name To User step by dragging an If step from the General palette and dropping it into the Successful icon under the Name To User step in the Design pane.

The designer configures the If step to evaluate the value of the currentRecording variable (supplied by the previous Get User Info step).

Figure 3-9 . shows the configured If customizer window.


Figure 3-9   Configured If Customizer Window


The If step evaluates the Boolean expression "currentRecording!= null", which means that the currentRecording variable is not null.

  • If the Boolean expression "currentRecording!= null" is true, the name of the caller is available for use by the Get Digit String step. In this case, the True output branch of the If step executes.
  • If the Boolean expression "currentRecording!= null" is false, the name of the caller is not available for use by the Get Digit String step. In this case, the False output branch of the If step executes.
The True Output Branch

If the If step locates a spoken recording of the name of the caller, the script executes the True output branch, as shown in Figure 3-7 .

The designer configures the True output branch of the If step to create a prompt that uses the recording of the spoken name.

The designer uses a Create Container Prompt step to create a concatenated prompt that includes the currentRecording variable.

Figure 3-10 shows the configured Create Container Prompt customizer window.


Figure 3-10   Configured Create Container Prompt Customizer Window


The designer configures the Create Container Prompt customizer window as follows:

  • Output Prompt—spelledPrompt

This prompt will contain the recorded name of the caller as stored in the currentRecording variable.

  • Prompt Container Type—Concatenated Prompt

This step creates a concatenated prompt containing the prompts listed int he Prompts list box.

  • Prompts—currentRecording

The currentRecording variable stores the recorded name of the caller.

  • Override Language—(blank)

The designer does not choose to override the language context of the call.

The False Output Branch

If the If step cannot locate a spoken recording of the name of the caller, the script executes the False output branch, as shown in Figure 3-7 .

The designer configures the False output branch of the If step to generate the name, using the spelling generator of the Create Generated Prompt step.

The designer uses a Get User Info step to retrieve the information contained in the fullName variable, in order to make this information available to the Create Generated Prompt step.

Figure 3-11 shows the configured Create Generated Prompt customizer window.


Figure 3-11   Configured Create Generated Prompt Customizer Window


The designer configures the Create Generated Prompt customizer window as follows:

  • Output Prompt—spelledPrompt

This is the prompt that the script will play back to the caller, containing the name of the caller as generated by this step.

  • Generator Type—spelling

This step uses the spelling generator type to spell out the name of the caller.

  • Constructor Type—(string)

The (string) constructor type appears automatically when the designer chooses the spelling generator type.

  • Argument/Value list box
    • Argument—string

The string argument appears automatically when the designer chooses the spelling generator.

  • Value—fullName

The fullName variable provides the information that the spelling generator uses to create the spelledPrompt prompt.

  • Override Language—(blank)

The designer does not choose to override the language context of the call.


Note   For more information about configuring the If step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Label Step (GetPin)

The designer continues building the Successful output branch of the Name To User step by dragging a Label step from the General palette and dropping it into the Successful icon under the Name To User step in the Design pane. (The Label step will have the name GetPin, as shown in Figure 3-1 .)

This Label step provides a target for a subsequent Goto step, in order to give callers more attempts at successfully entering digits by using the Get Digit String step that follows this label step.

The designer configures the Label customizer window by entering the name GetPin in the Enter Label Name text field, and then clicking OK.


Note   For more information about configuring the Label step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

If the script reaches this Label step, the Get Digit String executes. (See The Get Digit String Step.)

The Timeout Output Branch

If the Name To User step does not receive caller input before reaching the timeout limit, the script executes the Timeout output branch of the Name To User step. (See Figure 3-12 .)


Figure 3-12   Name To User Step—Timeout and Unsuccessful Output Branches


The designer configures the Timeout output branch to play back a prompt that informs the caller that the call was unsuccessful. The script plays a good-bye prompt, and then terminates the call.

As shown in Figure 3-1 , the designer uses the Create Container Prompt step to create a prompt called finalPrompt that the Play Prompt step plays at the end of the script, after which a Terminate step terminates the call.

The designer configures the Create Container Prompt step in similar fashion to the previous Create Container Prompt step (see The True Output Branch), with the exception that the designer chooses finalPrompt as the output prompt of the Create Container Prompt step.

The Goto step, named Bye, sends the script to the Label step named Bye, under which the final sequence of steps conclude the call. (See The Closing Steps of the SNU.aef Script.)

The Unsuccessful Output Branch

If the Name To User step does not make a successful match between the name entered by the caller and a name in the user directory, the script executes the Unsuccessful output branch of the Name To User step, as shown in Figure 3-12 .

Just as with the Timeout output branch, the designer configures the Unsuccessful output branch to play back a prompt that informs the caller that the call was unsuccessful. The script plays a good-bye prompt, and then terminates the call.

As shown in Figure 3-1 , the designer uses the Create Container Prompt step to create a prompt called finalPrompt that the Play Prompt step plays at the end of the script, after which a Terminate step terminates the call.

The designer configures the Create Container Prompt step in similar fashion to the previous Create Container Prompt step (see The True Output Branch), with the exception that the designer chooses finalPrompt as the output prompt of the Create Container Prompt step.

The Goto step, named Bye, sends the script to the Label step named Bye, under which the final sequence of steps conclude the call. (See The Closing Steps of the SNU.aef Script.)

The Get Digit String Step

The designer finishes building the Successful output branch of the Name To User step by dragging an Get Digit String step from the Media palette and dropping it into the Successful icon under the Name To User step in the Design pane.

The designer configures the Get Digit String step to authenticate the caller, before allowing the caller to record a name.

The Get Digit String step asks for the PIN number of the caller (to make sure the caller has the authority to record this name), using a concatenated prompt that addresses the caller by name and then asks the caller to enter a PIN number.

After adding the Get Digit String step to the Design pane of the CRA Editor, the designer configures properties in the four tabs of the Get Digit String customizer window as follows:

  • General tab
    • Contact—Triggering Contact

The Get Digit String step operates on the contact that triggered this script.

  • Result Digit String—pin

The pin the variable stores the digits entered by this caller. (The subsequent Authenticate User step uses this pin variable.)

  • Interruptible—No

External events cannot interrupt the execution of this step.

  • Prompt tab
    • Prompt—spelledPrompt + DP[150] + SP[SNU\enter_pin.wav]

This expression is the prompt that the Get Digit String step plays back. (This prompt plays back the name of the caller, a silence of 150 milliseconds, and the system prompt, which plays "please enter your PIN".

  • Barge In—Yes

The caller can enter a PIN without first having to listen to the playback of the entire prompt.

  • Continue on Prompt Errors—Yes

In the event of a prompt error, the script continues to play back the next prompt in the sequence or waits for input from the caller.

  • Input tab
    • Input Length—25

The value 25 is the minimum number of digits required before the step automatically checks for a user match. (This property applies only to non-ASR channels.)

  • Terminating Key—#

The caller can use the "#" key to indicate completion of input.

  • Cancel Key—*

The caller can use the "*" key to cancel and to start over. (The cancel key works only until the script reaches the number of maximum retries.)

  • Maximum Retries—0

The number of times the step retries to receive valid input before executing the Unsuccessful output branch is 0.

  • Initial Timeout (in sec)—5

The system waits 5 seconds for initial input from the caller before executing the Unsuccessful output branch.

  • Interdigit Timeout (in sec)—3

The system waits 3 seconds after receiving initial input for the caller to enter the next digit, before executing the Unsuccessful output branch. (This property does not apply for ASR channels.)

  • Flush Input Buffer—Yes

The script erases previously entered input before capturing new caller input.

  • DTMF Buffer on Retry—Yes

The script clears the DTMF buffer and erases previously-entered digits when the step retries to get input from the caller. (However, because the designer configured this step for 0 retries, this attribute has no effect on the execution of the step.)

  • Filter tab
    • All options are checked except "*" and "#"

The script considers numbers from 0 to 9 to be valid entries, and does not consider the cancel key "*" and the terminating key "#" to be valid digits to collect.


Note   For more information about configuring the Get Digit String step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

Figure 3-13 shows the three output branches under the Get Digit String step.


Figure 3-13   Get Digit String Step—Output Branches


This section contains the following topics:

The Successful Output Branch

If the Get Digit String step successfully receives a PIN number, the script executes the Successful output branch.

The designer configures the Successful output branch of the Get Digit String step to attempt to authenticate the user. If this process is successful, the caller is then given the chance to record a name.

For a description of the steps under the Successful output branch of the Get Digit String step, see The Authenticate User Step.

The Timeout Output Branch

If the Get Digit String step reaches the timeout limit before receiving input from the caller, the script executes the Timeout output branch.

The designer configures the Timeout output branch of the Get Digit String step give the caller further chances to enter a valid PIN number, until the script reaches the maximum number of retries, after which the Unsuccessful output branch executes.

Figure 3-14 shows the scripting under the Timeout output branch of the Get Digit String step.


Figure 3-14   Get Digit String Step—Timeout Output Branch


The designer uses the first If step to evaluate the expression pin==" ".


Note   For details on configuring the If step, see "The If Step" section on page 3-16.

If the expression is true, and the pin variable is empty, this means that the Get Digit String step has timed out without the caller having entered PIN information. In this case, the True output branch under this If step executes.

If the expression is false, the pin variable does contains PIN information, which means that the caller has already entered PIN information.

In this case, the False output branch executes, and a Goto step sends the script to the Label step named Authenticate, which is located directly above the Authenticate User step, as shown in Figure 3-14 .


Tip Using the If step in this way is a trick that you can use to allow the caller to enter the PIN without a terminating key and wait for the timeout to let the system deal with the digits collected so far. This trick works well only if the maximum number of retries is set to 0, as it is in this example.

The designer uses the first If step under the Timeout output branch of the Get Digit String step to determine whether or not PIN information exists.

If no PIN information exists, then the True output branch executes, and the designer then uses a second If step to determine whether or not the script has reached the maximum number of retries in the attempt to obtain PIN input information from the caller.

The following sections describe the scripting under the True and False output branches of this second If step:

The True Output Branch

If the first If step determines that the caller has not entered PIN information, the script executes the True output branch.

The designer configures the True output branch of the first If step to give the caller more opportunities to enter PIN information, until the maximum number of retries limit is reached.

The designer uses a second If step, placed under the True output branch of the first If step, to evaluate the expression "triesGetDigit < triesMaxGetDigit"; or, the value of triesGetDigit is less than triesMaxGetDigit.

The triesGetDigit variable is an Integer variable that has an initial value of 0. The triesMaxGetDigit variable is an Integer variable with a value of 3.

The following steps execute under the True output branch, as shown in Figure 3-14 ):

  • The Set step—Adds 1 to the value of triesGetDigit.

The designer configures the Set customizer window by first choosing thetriesGetDigit variable from the Variable drop-down menu. Then in the Assign text field, the designer enters the expression triesGetDigit + 1.

This means that each time the script reaches this Set step, the value of the triesGetDigit variable is increased by 1. After three attempts, the value of triesGetDigit is 3, which is equal to the value of triesMaxGetDigit, so the False output branch of this If step executes.

  • The Play Prompt step—Plays the system prompt, SP[SNU\still_there.wav], which asks if the caller is still connected, followed by a silence of 500 milliseconds.
  • The Goto step—Sends the script to the Label named GetPin, above the Get Digit String step (see Figure 3-14 ), in order to give the caller more attempts at entering a PIN number. (See The Label Step (GetPin).)

The False Output Branch

If the second If step reaches the maximum number of retries, the script executes the False output branch.

The designer configures the False output branch of the second If step to create a final prompt to play back to the caller before ending the call.

The designer uses a Create Container Prompt step to create a prompt named finalPrompt that contains the system prompt, SP[SNU\error_try_later.wav], which informs the caller that an error has occurred and asks the caller to call back later.

Next, a Goto step sends the script to the Label named Bye, located above the closing steps of the script (see The Closing Steps of the SNU.aef Script below), where the designer uses a Play Prompt step to play finalPrompt before the script terminates the contact.

The Unsuccessful Output Branch

If the Get Digit String step does not receive valid input, the script executes the Unsuccessful output branch.

The designer configures the Unsuccessful output branch of the Get Digit String step to provide a prompt that informs the caller that the call was unsuccessful, and the script moves to the final steps that terminate the contact.

Figure 3-15 shows the scripting under the Unsuccessful output branch of the Get Digit String step.


Figure 3-15   Get Digit String Step—Unsuccessful Output Branch


The designer uses the Create Container Prompt step to specify that the prompt finalPrompt contains the system prompt, SP[SNU\error_try_later.wav], which informs the caller that an error has occurred and asks the caller to call back later.

Next, a Goto step sends the script to the Label named Bye, located above the closing steps of the script (see The Closing Steps of the SNU.aef Script below), where a Play Prompt step plays finalPrompt before the script terminates the contact.

The functionality in this branch of the Get Digit String step is the same as the Create Container Prompt step and the Goto step under the False output branch of the If step. (See The False Output Branch.)

The Authenticate User Step

The designer places a Label step under the Successful output branch of the Get Digit String step. This Label step, named Authenticate, will serve as a target for the subsequent Goto step under the Timeout output branch of the Get Digit String step. (See The Timeout Output Branch.), and provides callers with another opportunity to be authenticated after having already entered PIN information.

The designer finishes building the Successful output branch of the Get Digit String step by dragging an Authenticate User step from the User palette and dropping it onto the Label step (Authenticate) under the Get Digit String step in the Design pane.

The designer configures the Authenticate User step to authenticate the user, based on the PIN information entered by the caller.

Figure 3-16 shows the configured Authenticate User customizer window.


Figure 3-16   Configured Authenticate User Customizer Window


The designer configures the Authenticate User step to compare the value of the pin variable with information contained in the user variable (as configured in the User Administration web page of the CRA Administration web interface).


Note   For more information about configuring the Authenticate User step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

If the match is made, the Success output branch executes. If not, the Fail output branch executes.

The following sections contain these topics:

The Success Output Branch

If the Authenticate User step successfully authenticates the user, the script executes the Success output branch.

The designer configures the Success output branch of the Authenticate Use step to offer the caller the opportunity to record a name.

Figure 3-17 shows the scripting under the Success output branch of the Authenticate User step.


Figure 3-17   Authenticate User Step—Success Output Branch


For a description of the scripting under the Success output branch of the Authenticate User step, see The Recording Step.

The Fail Output Branch

If the Authenticate User step does not successfully authenticate the user, the script executes the Fail output branch.

The designer configures the Fail output branch of the Authenticate Use step to allow the caller to retry entering a valid PIN number until the script reaches the maximum number of retries.

Figure 3-18 shows the scripting under the Fail output branch of the Authenticate User step.


Figure 3-18   Authenticate User Step—Fail Output Branch


As in the scripting under the Timeout output branch of the Get Digit String step (see The Timeout Output Branch), the designer uses an If step to determine whether or not the script has reached the maximum number of retries.

In this case, the If step evaluates the expression "triesAuthentication < triesMaxAuthentication"; or the value of triesAuthentication is less than triesMaxAuthentication.

The triesAuthentication variable is an Integer variable that has an initial value of 0. The triesMaxAuthentication variable is an Integer variable with a value of 3.

This If step has two output branches:

The True Output Branch

If the maximum number of retries has not been reached, the script executes the True output branch.

The designer configures the True output branch of the If step to provide the caller with more opportunities to be authenticated.

The following steps execute under the True output branch of the If step, as shown in Figure 3-18 ):

  • The Play Prompt step—Plays the system prompt, SP[SNU\error_auth.wav], which informs the caller that the authentication failed, followed by a silence of 500 milliseconds.
  • The Set step—Adds 1 to the value of triesAuthentication. After three attempts, the value of triesAuthentication is 3, which is equal to the value of triesMaxAuthentication, so the False output branch of this If step executes.
  • Goto—Sends the script to the Label named Get User above the Name to User step (as shown in Figure 3-14 ), in order to give the caller another chance to enter a name. (See The Label Step (GetUser).)

The False Output Branch

If the script has reached the maximum number of retries, the script executes the False output branch.

The designer configures the False output branch of the If step to create a final prompt to be played back to the caller, and then to send the script to the closing steps.

The following steps execute under the False output branch of the If step, as shown in Figure 3-18 ):

  • The Create Container Prompt step—Creates a concatenated prompt named finalPrompt that contains the two system prompts, SP[SNU\error_auth.wav] and SP[SNU\error_try_later.wav], which inform the caller that authentication failed, and ask the caller to call back later.
  • The Goto step—Sends the script to the Label named Bye, located above the closing steps of the script (see The Closing Steps of the SNU.aef Script below), where a Play Prompt step plays finalPrompt before the script terminates the contact.

The Recording Step

The designer first places a Label step, named Record, under the Success output branch of the Authenticate User step. This Label step will provide a target for the scripting under the Key 2 output branch of the subsequent Menu step (see The Menu Step) to give callers another opportunity to record a name.

The designer then continues the SNU.aef script, once the caller has been authenticated, by dragging a Recording step from the Media palette and dropping it on the Success output branch of the Authenticate User step.

Next, the designer configures the Recording step to offer the caller the opportunity to record a name.

The designer configures properties in the three tabs of the Recording customizer window as follows:

  • General tab
    • Contact—Triggering Contact

The step operates on the contact that triggered the execution of the script.

  • Result Document—recording

The recording variable stores the audio file recorded by this caller.

  • Media Type—Voice (uncompressed)

The type of media to be recorded is uncompressed voice.


Note    CRA 3.0 currently supports only uncompressed voice.

  • Recording Duration—10

The script gives the caller 10 seconds to record a name.

  • Interruptible—No

External events cannot interrupt the execution of this step.

  • Prompt tab
    • Prompt—Customize prompt

The step plays back a customized prompt to the caller.

The box underneath the Prompt box indicates that the prompt is a concatenation of three system prompts: SP[SNU\rec_name.wav] + SP[SNU\finished.wav] + SP[SNU\pound.wav].

  • Start Tone—Default Prompt

The script plays back a system prompt providing a default start tone to alert the caller that the recording is about to begin.

  • Barge In—Yes

The caller is allowed to respond without first having to listen to the entire playback of the prompt.

  • Continue on Prompt Errors—Yes

In the event of a prompt error, the script continues to play back the next prompt in the sequence or waits for input from the caller.

  • Input tab
    • Terminating Key—#

The caller can use the "#" key to indicate completion of input.

  • Cancel Key—*

The caller can use the "*" key to cancel and start over. (The cancel key works only until the script reaches the maximum number of retries.)

  • Maximum Retries—0

The number of times the step retries to receive valid input before executing the Unsuccessful output branch is 0.

  • Flush Input Buffer—Yes

The system erases previously entered input before capturing new caller input.


Note   For more information about configuring the Recording step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Recording step has two output branches, Successful and Unsuccessful, described in the following sections:

The Successful Output Branch

If the Recording step successfully records the spoken name of the caller, the script executes the Successful output branch.

The designer configures the Successful output branch of the Recording step to play the recording back to the caller.

Figure 3-19 shows the scripting under the Successful output branch of the Recording step.


Figure 3-19   Recording Step—Successful Output Branch


The designer uses a Play Prompt step to play the recording back to the caller. To accomplish this, the designer configures the Play Prompt step to play a system prompt combined with the value of the recording variable, which stores the recording that results from the Recording step.

The Menu step then offers the caller the choice of approving the current recording or making another recording attempt. (For a description of the scripting under the Menu step, see The Menu Step.)

The Unsuccessful Output Branch

If the Recording step does not successfully record the spoken name, the script executes the Unsuccessful output branch.

The designer configures the Unsuccessful output branch of the Recording step to create the final prompt that is played back to the caller, and to move the script to the closing steps.

Figure 3-20 shows the scripting under the Unsuccessful output branch of the Recording step.


Figure 3-20   Recording Step—Unsuccessful Output Branch


As in previous Unsuccessful output branches (see, for example, The Unsuccessful Output Branch), the designer uses a Create Container Prompt step to create a prompt named finalPrompt that contains two system prompts, SP[SNU\error_rec.wav] + SP[SNU\error_try_later.wav], which inform the caller that an error in recording has occurred, and ask the caller to call back later.

Next, a Goto step sends the script to the Label named Bye, located above the closing steps of the script (see The Closing Steps of the SNU.aef Script below), where a Play Prompt step plays finalPrompt before the script terminates the contact.

The Menu Step

The designer continues the icd.aef script by dragging a Menu step from the ICD palette and dropping it on the Play Prompt step under the Successful output branch of the Recording step.

Next, the designer configures the Menu step to give callers the option to re-record a name.

The designer configures properties in the three tabs of the Menu customizer window as follows:

  • General tab
    • Contact—Triggering Contact

The step operates on the contact that triggered the execution of the script.

  • Options—Key 1 and Key 2

The designer creates two branches under the Menu step, providing the caller the choice to approve the recording or re-record a name.

  • Interruptible—Yes

External events can interrupt the execution of this step.

  • Prompt tab
    • Prompt—SP[SNU\menu_re_rec.wav]

This system prompt offers the caller the choice to re-record a name.

  • Barge In—Yes

The caller can respond without first having to listen to the entire playback of the prompt.

  • Continue on Prompt Errors—Yes

In the event of a prompt error, the script continues to play back the next prompt in the sequence or waits for caller input.

  • Input tab
    • Timeout (in sec)—3

The script executes the Timeout output branch if the script receives no input within 3 seconds.

  • Maximum Retries—3

The step attempts 3 times to receive valid input before executing the Unsuccessful output branch.

  • Flush Input Buffer—Yes

The script erases previously entered input before capturing new user input.


Note   For more information about configuring the Menu step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Menu step in this script has the following output branches (see Figure 3-21 ):

  • Key 1—Executes if the caller accepts the recording.
  • Key 2—Executes if the caller does not accept the recording.
  • Timeout—Executes if the step reaches the timeout limit without receiving input.
  • Unsuccessful—Executes if the step receives invalid input

Figure 3-21   Menu Step—Output Branches


The following sections describe the scripting under each of these output branches:

The Key 1 Output Branch

If the caller decides to accept the recording, the script executes the Key 1 output branch.

The designer configures the Key 1 output branch of the Menu step to store the new recorded name of the caller in the system, and then to move the script to the closing steps.

Figure 3-22 shows the scripting under the Key 1 output branch of the Menu step.


Figure 3-22   Menu Step—Key 1 Branch


The designer uses the Set User Info step to associate the value of the variable recording (as created by the Recording step) with the Spoken Name attribute of the user variable.

Figure 3-23 shows the configured Set User Info customizer window.


Figure 3-23   Configured Set User Info Customizer Window


The Set User Info step has the following two output branches (see Figure 3-22 ):

  • Success—If the Set User Step succeeds, a Create Container Prompt step creates a prompt finalPrompt, which plays the system prompt SP[SNU\store_success.wav], informing the caller that the recording has been successfully stored.

A Goto step then sends the script to the Label named Bye, which executes the closing steps of the script.

  • Fail—If the Set User Step fails, a Create Container Prompt step creates a prompt finalPrompt, which plays two system prompts SP[SNU\error_general.wav] + SP[SNU\error_try_later], which inform the caller that an error has occurred and ask the caller to call back later.

A Goto step then sends the script to the Label named Bye, which executes the closing steps of the script.

The Key 2 Output Branch

If the caller decides to re-record a name, the script executes the Key 2 output branch.

The designer configures the Key 2 output branch of the Menu step to provide the caller with more opportunities to record a name.

Figure 3-24 shows the scripting under the Key 2 output branch of the Menu step.


Figure 3-24   Menu Step—Key 2 Branch


As in previous sections of the script, the designer uses an If step to give the caller multiple chances to record a name, until the script reaches the maximum number of retries. (For examples of the use of the If step, see The Timeout Output Branch and The Fail Output Branch.)

In this case, the If step evaluates the expression "triesRecord < triesMaxRecord"; or the value of the triesRecord variable is less than the triesMaxRecord variable.

The triesRecord variable is an Integer variable that has an initial value of 0. The triesMaxRecord variable is an Integer variable with a value of 3.

This If step has the following two output branches:

The True Output Branch

If the caller has not reached the maximum number of retries in the attempt to record a name, the script executes the True output branch of the Key 2 output branch of the Menu step.

The designer configures the True output branch to give the caller more opportunities to record a name, until the maximum number of retries limit is reached.

The following steps execute under the True output branch of the If step (see Figure 3-24 ):

  • The Set step—Adds 1 to the value of triesRecord. After three attempts, the value of triesRecord is 3, which is equal to the value of triesMaxRecord, so the False output branch of this If step executes.
  • The Goto step—Sends the script to the Label named Record (see Figure 3-19 ), in order to give the caller further chances to record. (See The Recording Step.)

The False Output Branch

If the caller has reached the maximum number of retries and has not recorded a name, the script executes the False output branch of the Key 2 output branch of the Menu step.

The designer configures the False output branch to create a final prompt that will be played back to the caller, and then moves the script to the closing steps.

The following steps execute under the False output branch of the If step (see Figure 3-24 ):

  • The Create Container Prompt step—Creates a prompt finalPrompt, which plays the system prompts SP[SNU\error_try_later], asking the caller to try again later.
  • The Goto step—Sends the script to the Label named Bye, which executes the closing steps of the script.

The Timeout and Unsuccessful Output Branches

The scripting under both the Timeout and Unsuccessful output branches of the Menu step (see Figure 3-25 ) is the same as that under the False output branch of the If step in the previous section (see The False Output Branch).

The designer uses the following scripting under both the Timeout and Unsuccessful output branches of the Menu step:

  • Create Container Prompt step—Creates a prompt finalPrompt, which plays the system prompt SP[SNU\error_try_later], asking the caller to try again later.
  • A Goto step then sends the script to the Label named Bye, which executes the closing steps of the script.

Figure 3-25   Menu Step—Timeout and Unsuccessful Output Branches


The Closing Steps of the SNU.aef Script

The designer closes the SNU.aef script by using steps that mark the contact as handled, play back a final prompt to the caller, terminate the connection, and end the script.

Figure 3-26 shows the steps used to close the script.


Figure 3-26   Closing Steps of the SNU.aef Script


The designer uses the following steps to close the script:

The Set Contact Info Step

The designer uses the Set Contact Info step to mark the contact as Handled, which is important for reporting purposes.

Figure 3-27 shows the configured Set Contact Info customizer window.


Figure 3-27   Configured Set Contact Info Customizer Window


To configure the Set Contact Info step, the designer highlights the Handled attribute and clicks Set. An "X" appears in the Value column of the Set Contact Info list box.


Note   For more information on configuring the Set Contact Info step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Set Step

The designer uses the Set step to set the value of finalPrompt (to be played by the subsequent Play Prompt step) to combine the previous value of the finalPrompt variable with SNU\goodbye.wav], which tells the caller good-bye.


Note   For more information on configuring the Set step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The Play Prompt Step

The designer configures the Play Prompt step to play finalPrompt back to the caller.


Note   For an example of configuring the Play Prompt step, see The Play Prompt Step 3-7.

The Terminate Step

The designer uses the Terminate step to terminate the contact by disconnecting the call.


Note   For more information on configuring the Terminate step, refer to the Cisco Customer Response Applications Editor Step Reference Guide.

The End Step

The designer uses the End step to complete processing and free all allocated resources.

This step has no properties and does not require a customizer.