Cisco Unity Express 3.1 Guide to Writing and Editing Scripts
Script Editor Overview

Table Of Contents

Script Editor Overview

Concepts for Writing Scripts

Variables

Parameters

Operators

Expressions

Flow Control Steps

Error Handling for Scripts

Prompts

Trigger

AA Sample Script

Selecting the IVR Option

Script Design

Validating and Testing a Script

Scripting Techniques

Terms

Additional References

Documents Related to Cisco Unity Express

Related Cisco IOS Documents

Technical Assistance

Obtaining Documentation, Obtaining Support, and Security Guidelines


Script Editor Overview


This guide provides an overview using the Cisco Unity Express 3.1 Script Editor for writing Auto Attendant (AA) scripts. The guide also includes a line-by-line description of the AA sample script and a script step reference.

The Interactive Voice Response option is a separately licensed option that integrates with Cisco Unity Express. The functionality described for IVR is available only if you have purchased a separate IVR software license.

Scripts enable you to customize the Cisco Unity Express AA and IVR features. Scripts work to receive input, make decisions, and perform tasks. By using the Cisco Unity Express Script Editor, you identify variables to receive user input, create conditions that require decisions (or branches), and determine which tasks to perform, based on those decisions.

A script stored on the router module runs in response to a request from a user or a predetermined condition. The scripts allow callers to receive recorded audio messages and prompts for further action. For example, if a caller calls a business during nonbusiness hours, the caller can hear either a recorded message stating the business's hours of operation or hear a prompt to leave a message. The message and prompt are the result of the Cisco Unity Express software running a script.

A more advanced use of scripts could involve checking an account balance at a bank. For example, a caller is prompted to enter an account number by using a telephone keypad, and the caller then receives an audio message stating the account balance.

This chapter contains the following sections:

Concepts for Writing Scripts

Scripting Techniques

Terms

Additional References

Obtaining Documentation, Obtaining Support, and Security Guidelines

Concepts for Writing Scripts

This section provides information on the main concepts that are used in writing scripts.

Variables

Use variables in your program to hold data. You must provide a name and a type for each variable that you want to use in your script. Use the variable name to refer to the data that the variable contains. The type of variable determines what types of data (text, integers, and so on) it can hold and what operations can be performed on it.

Parameters

A parameter is a property of a variable that allows the variable to be visible to the administrator through the Cisco Unity Express web interface. The administrator can then change the variable without having to edit the script and then upload it to the Cisco Unity Express module again.

Operators

In addition to performing an operation, an operator returns a value. The return value and its type depend on the operator and the types of data the operator is operating on. For example, the increment operator (increment step) adds 1 to a value.

Expressions

Variables and operators are the basic building blocks of scripts. You can combine variables and operators to form expressions that compute, return values, and control the flow of a script.

Flow Control Steps

A flow control step directs the order in which the script is run. The If, Switch, and Goto steps are examples of flow control steps.

Without flow control steps, the script runs these steps in the sequential order in which they appear in the Design pane from top to bottom. You can use flow control in your scripts to conditionally run steps, to repeatedly run a block of steps, and to otherwise change the normal, sequential flow of the script.

Control steps direct the script to proceed in a specific way. For example, you might want a set of steps to run only if certain conditions are met.

Flow control is accomplished by following these steps:

If: If the following condition x is met, perform the following task, y.

Switch: Matches a condition to one of several tasks.

Goto: When a script reaches a Goto step, the script stops running and continues at the indicated next point in the script.

Error Handling for Scripts

Error handling provides a way for a script to stop running in a predetermined sequence, or to continue running when it receives unexpected results or when a task does not complete successfully.

Prompts

Prompts exist as audio files on the router and have the file extension .wav, as in greeting.wav. The Cisco Unity Express Script Editor uses the following two types of prompts:

System prompts: Used internally by Cisco modules and Cisco sample scripts.

User prompts: Defined by the user, and managed by the administrator through Voice Mail > Prompts on the Cisco Unity Express GUI administrator interface or by calling in to Administration via Telephone (AvT).

Trigger

A trigger is a specific event or condition that causes an application to run. There can be several triggers for a single application. A number of triggers are created automatically in Cisco Unity Express.

For example, a call to extension 1000 causes Cisco Unified Communications Manager Express (formerly known as Cisco Unified CallManager Express) to route the call to Cisco Unity Express, which then looks for a trigger for the call and starts the associated application.

AA Sample Script

The auto attendant (AA) sample script uses the sample script aa_sample1.aef, which is included with the Cisco Unity Express Script Editor, to illustrate basic procedures for configuring auto attendant scripts. For details on the auto attendant script, see the Auto Attendant Script Example chapter.

Selecting the IVR Option

The functionality described for the Cisco Unity Express IVR software is available only if you have purchased a separate IVR software add-on package.

The Cisco Unity Express IVR software allows a telephone caller to select options from a voice menu and to otherwise interact with the Cisco Unity Express system. After the system plays a pre-recorded voice prompt, the caller presses a number on a telephone keypad to select an option.

To select the IVR option, complete the following steps:


Step 1 Choose Tools > Options from the Cisco Unity Express toolbar. The Cisco Unity Express Options window, shown in Figure 1, appears.

Figure 1 Cisco Unity Express Options Window

Step 2 In the Hostname field, enter the DNS hostname or IP address of your host.

Step 3 Check the Enable IVR steps check box.

Step 4 Click OK.

The Palette pane includes the additional IVR steps you need to create your script.


Script Design

Designing a script involves describing the call flow, mapping script steps to the call flow, validating the script, and testing the script in the system.

The following simple scenario illustrates scripting techniques. Table 1lists and describes the call flow script steps of this scenario. In this case, the script:

1. Answers a call.

2. Checks for an emergency alternate greeting.

3. Checks if this time is during regular business hours.

4. Checks for unexpected user or script actions.

5. Plays a custom greeting and transfers the caller to the operator if the current time is not during regular business hours.

6. Plays a menu prompt that allows the caller to dial 1 for dial-by-name, 2 for dial-by-extension, or 0 for an operator if the current time is during regular business hours.

Use the dial-by-extension option to transfer a caller to a number in a specified range, not to transfer the caller to any number dialed.

7. Checks for the number of times the caller has been rerouted to the Main Menu.

8. Add to the Menu step if necessary.

9. Handles error conditions.

A call flow is a description of events that occur during a call. Describing a call flow in detail allows you to recognize the script editor steps to use and avoid logic flaws in your script. In the call flow for this scenario, extensions are in the range of 200 to 299. You can add additional error handling branches. For example, if the caller tries multiple unsuccessful transfers, the script plays a "Try again later" prompt and disconnects the call.

Table 1 Mapping Call Flow to Script Steps 

 
Call Flow
Script Step

Step 1 

Answer the call.

Use the Accept step in the Contact group to answer the call.

Step 2 

Check whether there is an alternate greeting prompt.

If there is an alternate greeting prompt, play it.

Play a Delay Prompt for half a second (DP[500]) to avoid any perceived clipping of the audio prompt. If audio cut-through to the PSTN does not happen fast enough, the caller may not hear the beginning of the prompt.

Step 3 

Check whether today is a holiday.

If today is a holiday, play a holiday prompt and go to the Main menu.

Step 4 

Look for prompt exceptions.

Exceptions are unexpected user or script actions. A prompt exception indicates that the script is trying to play a prompt that does not exist. Use an UndefinedPromptException step to check for this condition. This exception occurs only if the step that plays the prompt has its Continue On Prompt Errors property set to No. If this property is set to Yes, the prompt is not played and no exception is generated.

Step 5 

Check whether the current time is during business hours and play the appropriate (open or closed) prompt. Proceed to the Main menu.

Play initial prompt.

Use the holiday step to check whether today is a holiday and to determine what to do next.

Use a business hours step to check whether the call is received during business hours. If the call is received during business hours, play the initial greeting prompt. Otherwise, play the closed greeting. Business hours can be configured through the Cisco Unity Express web administrator.

Step 6 

The Main Menu plays a prompt to allow callers to enter an extension at any time. The caller can press 1 to find the party in the directory, or press 0 to reach the operator. Because all valid extensions start with 2, pressing 2 branches to the dial-by-extension step.

Use a label step to create a Main Menu section.

Step 7 

Check how many times the caller has been to the Main Menu. Tracking the number of times the caller has been to the Main Menu helps to prevent the caller from getting stuck in a loop and provides more useful options to the caller.

Use an If step to create a counter.

The counter keeps track of how many times the caller has been to the Main Menu section (three times in our example). The counter works by comparing two variables: Attempts and MaxRetries.

Use the Variables pane to set up your variables. Attempts is created as an integer variable with an initial value of 0. MaxRetries is set up as an integer whose initial value is 3.

Use the Increment step at the end of the Main Menu to add 1 to the Attempts current value. Each time the caller goes to the Main Menu, the Attempts variable is incremented by 1. If Attempts is incremented to a value of 3, the If step executes its True branch.

Step 8 

Play the Main Menu prompt.

Use the Menu step to add a basic menu prompt. For example, "If you know your party's extension, please dial it now. For spell-by-name, press 1, for an operator press 0, to repeat these options, press 9."

Change the Maximum Retries for the Menu step to 0. Otherwise, the caller hears the system prompt "Are you still there?" each time this step times out.

The Unsuccessful branch is reached when the caller presses something other than 1, 2, 9, or 0. Play the "The extension entered is invalid" prompt. The script continues to the Increment step and then to the GoTo step, where script execution returns to the Main Menu label step.

To ensure that the audio prompt stops when the caller enters a digit on Media steps, such as Menu or Play, check the Barge In field in the Prompt properties of the step. The Interruptible field in the General properties is not applicable in Cisco Unity Express.

Step 9 

Handle error conditions by adding error branches.

If the call cannot be successfully completed, the script continues to the error handling section labeled Sorry. It plays a prompt: "Sorry, we are unable to complete your call at this time. Please try again later." The Terminate step then disconnects the call.

You can add more error handling branches. For example, if the caller tries multiple unsuccessful transfers, the script plays a "Try again later" prompt and disconnects the call.

Validating and Testing a Script

To debug your script, verify its operation in various scenarios, such as regular user input, timeout, and anticipated error conditions.

Before uploading a script, use the Cisco Unity Express Script Editor Validate tool and check that the Validation Succeeded message appears. Any errors appear in the Debug pane. Double-click them to find the error condition in the script.

After uploading the script to the Cisco Unity Express system, use the default traces to troubleshoot problems. Use the EXECUTING_STEP filter to display only the script steps, as they are run, in the trace. Use the clear trace command to clear previous trace messages before using the show trace command. For example:

clear trace
Make a test call.
show trace buffer long | include EXECUTING_STEP

Scripting Techniques

When Maximum Retries on the NameToUser step is set to 0 or 1, you must use a Terminating Key character. Without the Terminating Key character, the step does not go to the Successful branch of this step. Instead, the step always goes to the Timeout branch, even if there is a match.

You must create all variables in a script before you can use them. If you create a variable and you later delete it, use the Validate tool to find it.

Set the Parameter of a variable property to make the variable available to the Cisco Unity Express administrator through the web page.

Alternately, do not set the Parameter of a variable property to prevent it from being accidentally changed through the web page.


Note You cannot assign a system prompt to a prompt variable when you define it. You must use the Set step or the Create Prompt step to assign a system prompt to a variable.


Terms

Table 2 contains the most commonly used terms in initially writing scripts, see the Glossary page for more definitions.

Table 2 Common Script Terms 

Term
Description

Application

A completed script.

auto attendant

The Cisco Unity Express feature that allows automatic handling of calls through the use of scripted applications.

Contact

A call that reaches the auto attendant.

Interactive Voice Response

The Cisco Unity Express data processing technology that allows a caller to use a phone line to interact with information stored on a Cisco module.

Parameter

A property of a variable that allows the variable to be modified outside the script editor.

Prompt

Audio file with a ,wav extension. These are the system prompts, greetings, and so on.

Script

One or more steps run in a sequence. A script file has an .aef extension.

Step

Basic building block in a script. Each step is the most basic unit in a script.

Subflow

Equivalent to a procedure or subroutine. Independent scripts that can be reused within a script or by other scripts.

Trigger

Event that causes a script to run.

Variable

Variables store user-defined data or the data resulting from the completion of a step.


Additional References

The following sections provide references related to Cisco Unity Express.

Documents Related to Cisco Unity Express

Related Topic
Document Title

Cisco Unity Express administration

Cisco Unity Express 3.1 GUI Administrator Guide

Cisco Unity Express 3.1 Command Reference

Cisco Unity Express 3.1 Installation and Upgrade Guide

Release Notes for Cisco Unity Express 3.1

Cisco Unity Express voice-mail subscriber information

Cisco Unity Express User Guides

Cisco modules hardware installation

Cisco Network Modules Hardware Installation Guide

AIM Installation Quick Start Guide: Cisco 2600, 3600, and 3700 Series

Replacing Compact Flash Memory on Cisco AIM-CUE Advanced Integration Modules

AIM-CUE Slot Restriction on Cisco 3745 Routers

Cisco Unity Express software copyrights and licenses

Cisco Unity Express Software Copyrights and Licenses

Technical support documentation for Cisco Unity Express

Cisco Unity Express Troubleshoot and Alerts

Cisco Unified Communications Manager

Note See the Cisco Unity Express Compatibility Matrix for the Cisco Unified Communications Manager versions compatible with Cisco Unity Express 3.1.

Cisco Unified Communications Manager Maintenance and Operations Guides

Cisco Unified Communications Manager Express

Note See the Cisco Unity Express Compatibility Matrix for the Cisco Unified CME versions compatible with Cisco Unity Express 3.1.

Cisco Unified Communications Manager Express System Administrator Guide

Cisco Unified Communications Manager Express Command Reference

Cisco Unity

Networking in Cisco Unity Guide

Cisco hardware platforms

Cisco 2800 Series Hardware Installation

Cisco 3800 Series Hardware Installation


Related Cisco IOS Documents

Related Topic
Document Title

Cisco IOS configuration

Cisco IOS Debug Command Reference, Release 12.4T

Cisco IOS Voice Command Reference

Note For general voice configuration topics, see the Cisco IOS Voice Configuration Library, Release 12.4.

Cisco IOS voice troubleshooting information

Cisco IOS Voice Troubleshooting and Monitoring Guide


Technical Assistance

Description
Link

The Cisco Technical Support & Documentation website contains thousands of pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/techsupport


Obtaining Documentation, Obtaining Support, and Security Guidelines

For information on obtaining documentation, obtaining support, providing documentation feedback, security guidelines, and also recommended aliases and general Cisco documents, see the monthly What's New in Cisco Product Documentation, which also lists all new and revised Cisco technical documentation, at:

http://www.cisco.com/en/US/docs/general/whatsnew/whatsnew.html