cc/td/doc/product/access/acs_serv
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

TCL IVR API Version 2.0 Programmer's Guide

TCL IVR API Version 2.0 Programmer's Guide

Version 07/24/00

This document contains information about the Tool Command Language (TCL) Interactive Voice Response (IVR) Application Programming Interface (API) Version 2.0 that you can use to create TCL scripts that control calls coming into or going out of the gateway. It provides an annotated example of a TCL IVR script and includes instructions for testing and loading a TCL IVR script.

This document helps developers writing voice application software for Cisco voice interfaces, such as the Cisco AS5x00 series. This includes independent software vendors (ISVs), in-house corporate developers, system integrators, and Original Equipment Manufacturers (OEMs).


Note Using Acrobat Reader to view the PDF version of this document is recommended; this displays more accurately the intended formatting, such as page numbering, the delineation between pages, and the fonts used to express the different elements of a command's syntax.

This document includes the following sections:

Overview of IVR and TCL

IVR is a term that is used to describe systems that provide information in the form of recorded messages over telephone lines in response to user input in the form of spoken words or, more commonly, dual tone multifrequency (DTMF) signaling. For example, when a user makes a call with a debit card, an IVR application is used to prompt the caller to enter a specific type of information, such as a PIN. After playing the voice prompt, the IVR application collects the predetermined number of touch tones (digit collection), forwards the collected digits to a server for storage and retrieval, and then places the call to the destination phone or system. Call records can be kept and a variety of accounting functions performed.

In essence, the IVR application (or script) is a voice application designed to handle calls on a voice gateway, which is a router that is equipped with voice features and capabilities.

The prompts used in an IVR script can be either static or dynamic:

For example, dynamic prompts are used to inform the caller of how much time is left in their debit account, such as:
"You have 15 minutes and 32 seconds of call time left in your account."
The above prompt is created using eight individual prompt files. They are: youhave.au, 15.au, minutes.au, and.au, 30.au, 2.au, seconds.au, and leftinyouraccount.au. These audio files are assembled dynamically by the underlying system and played as a prompt based on the selected language and prompt file locations.

The Cisco Interactive Voice Response (IVR) feature, available in Cisco IOS Release 12.0(6)T and later, provides IVR capabilities using TCL 1.0 scripts. These scripts are signature locked, and can be modified only by Cisco. The IVR feature allows IVR scripts to be used during call processing. The scripts interact with the IOS software to perform various call-related functions. Starting with
Cisco IOS Release 12.1(3), no longer is any TCL script lock in place, thus customers can create and change their own TCL scripts.

TCL is an interpreted scripting language. Because TCL is an interpreted language, scripts written in TCL do not have to be compiled before they are executed. TCL provides a fundamental command set, which allows for standard functions such as flow control (if, then, else) and variable management. By design, this command set can be expanded by adding extensions to the language to perform specific operations.

Cisco has created a set of extensions, called TCL IVR commands, that allows users to create IVR scripts using TCL. Unlike other TCL scripts, which are invoked from a shell, TCL IVR scripts are invoked when a call comes into the gateway.

The remainder of this document assumes that you are familiar with TCL and how to create scripts using TCL. If you are not, we recommend that you read TCL and the TK Toolkit by John Ousterhout (published by Addison Wesley Longman, Inc).

Overview of TCL IVR API Version 2.0

This overview contains sections that describe the prerequisites, restrictions, benefits, features, and the developer support program for this application programming interface.

Prerequisites

The open TCL IVR feature is currently supported on the Cisco AS5300 voice platform only. In order to use the open TCL IVR feature, you need the following:

1. Cisco AS5300 universal access server (voice platform).

2. Cisco IOS Release 12.1(3) or later.

3. TCL Version 7.1 or later.

Calls can come into a gateway using analog lines, ISDN lines, a VoIP link, or a Voice over Frame Relay (VoFR) link. TCL IVR scripts can provide full functionality for calls received over analog or ISDN lines. The functionality provided for calls received over VoIP or VoFR links varies depending on the release of Cisco IOS software being used. For example, if you are using
Cisco IOS Release 12.0, you cannot play prompts or tones, and you cannot collect tones.


Note TCL IVR API Version 2.0 is a separate product from TCL IVR API Version 1.0.

Restrictions

If a TCL 2.0 script is used with the TCL Interpreter 8.0.5, the minimum memory requirement is
64 megabytes for the Cisco 2600 and Cisco 3600 series platforms, starting with
Cisco IOS Release 12.1(3)T. Additional memory is needed only if you use TCL 2.0 scripts with TCL interpreter 8.0.5. At this time, the unlocked TCL scripts are not supported on the Cisco 2600 and the Cisco 3600 series platforms. This memory requirement applies regardless of whether the TCL scripts are locked or unlocked.

Benefits

TCL IVR API Version 2.0 has the following benefits:

leg collect digits 1 callInfo 
leg collect digits 2 callInfo 
leg setup 295786 setupInfo $callID5 
puts "\n This will be excuted immediately i.e. before the collect digits or call setup is actually complete" 
In the preceding script example, digit collection is initiated on legs 1 and 2 and a call setup process is started using the callID5 as the incoming leg. The script has issued each of the commands and will later receive events regarding their completion. None of these commands ever requires that any other command wait until it is finished processing.

Features Supported

TCL IVR API Version 2.0 commands provide access to the following facilities and features:

For more information, see the "TCL IVR API Command Reference" section.

Developer Support

Developers using this guide may be interested in joining the Cisco Developer Support Program. This new program has been developed to provide you with a consistent level of support that you can depend on while leveraging Cisco interfaces in your development projects.

A signed Developer Support Agreement is required to participate in this program. For more details, and access to this agreement, please visit us at: http://www.cisco.com/warp/public/779/servpro/programs/ecosystem/devsup, or contact developer-support@cisco.com

How TCL IVR Version 2.0 Works

With TCL IVR Version 2.0, the script can be divided into three parts: the initialization procedures, the action functions, and the Finite State Machine (FSM).

When an execution instance of a script is created for handling the call and the call finishes, the execution instance of the script is not deleted but is instead held in cache. The next incoming call will use this cached execution instance, if it is available. Therefore, any global variables that were defined by the script when the first call was handled are used to handle the next call. The script should re-initialize any call-specific variables in the action function for ev_setup_indication or ev_handoff.
Variables that need to be initialized once and that will never change during the call can be initialized in the main code of the script. For example, reading in configuration parameters is a one-time process and does not need to occur for every call. Therefore, it is more efficient to include these variables in the main code.
The starting state of the FSM is the state that the FSM is in when it receives a new call (indicated by an ev_handoff or ev_setup_indication event). This state is defined when the state machine table is registered using the fsm define command. From this point on, the events that are received from the system drive the state machine and the script invokes the appropriate action procedure based on the current state and the events received as defined by the set variable commands.
The FSM supports two wildcard states and one wildcard event:
For example to create a default handler for any unhandled event, you could use:
set callfsm(any_state,ev_any_event)"defaultProc,same_state"
To instruct the script to close a call if it receives a disconnect on any call leg, you could use:
set callfsm(any_state,ev_disconnected) "cleanupCall,CLOSE_CALL"
 
In the following example, by default if the script receives an ev_disconnected event, it closes the call. However, if the script is in the media_playing state and receives an ev_disconnected event, it waits for the prompt to finish and then closes the call.
set callfsm(any_state,ev_disconnected) "cleanupCall,CLOSE_CALL"
set callfsm(MEDIA_PLAYING,ev_disconnected) "doSomthingProc,MEDIA_WAIT_STATE"
set callfsm(MEDIA_WAIT_STATE,ev_media_done) "cleanupCall,CLOSE_CALL"
 
For more information about events, see the "Events" section.

When the gateway receives a call, the gateway hands the call to an application that is configured on the system. If the application is a TCL script that uses the TCL IVR API Version 2.0, an execution instance of the application (or script) is created and executed.

When the script is executed, the TCL interpreter reads the procedures in the script and executes the main section of the script (including the initialization of global variables). At this point, the fsm define command registers the state machine and the start state. This initialized execution instance is handed the call. From then on (until the call close command), when an event is received, the appropriate action procedure is called according to the current state of the call and the event received by the script.

An execution instance can handle only one call. Therefore, if the system is handling 10 calls using the same script, there will be 10 instances of that script. In between calls, the execution instances are cached to handle the next call. These cached execution instances are removed when the application is reloaded. Cached execution instances are also removed if a CLI parameter or attribute-value (AV)-pair is changed, removed, or added, or if an application is unconfigured.


Note With the previous version of the TCL IVR API, every execution instance of a script ran under its own Cisco IOS process. As a result, handling 100 calls required 100 processes, each one running an execution instance of the script. With the TCL IVR API Version 2.0, multiple execution instances share the same Cisco IOS process. However, multiple Cisco IOS processes can be spawned to share the load--depending on the resources on the system and the number of calls.

How to Use TCL IVR Scripts

This section of the document includes information on how to create and use TCL IVR scripts. This section includes the following topics:


Note Sample TCL IVR scripts can be found at http://www.cisco.com/cgi-bin/tablebuild.pl/tclware.

Writing an IVR Script Using TCL Extensions

Before you write an IVR script using TCL, you should familiarize yourself with the TCL extensions for IVR scripts. You can use any text editor to create your TCL IVR script. Follow the standard conventions for creating a TCL script and incorporate the TCL IVR commands as necessary.

A sample script is provided in this section to illustrate how the TCL IVR API Version 2.0 commands can be used.


Note If the caller hangs up, the script stops running and the call legs are cleared. No further processing is done by the script.

Standard TCL Commands Used in TCL IVR Scripts

The following standard TCL commands can be used in TCL IVR scripts:

append

array

break

case

catch

concat

continue

error

eval

expr

for

foreach

format

global

history

if

incr

info

join

lappend

lindex

linsert

list

llength

lrange

lreplace

lsearch

lsort

proc

puts

regexp

regsub

rename

return

set

split

string

switch

tcl_trace

unset

uplevel

upvar

while

For additional information about the standard TCL commands, see the TCL and the TK Toolkit by John Ousterhout (published by Addison Wesley Longman, Inc).

TCL IVR Commands At a Glance

In addition to the standard TCL commands, you can use the TCL extensions for IVR scripts that Cisco has created. Also, Cisco modified the existing puts TCL command to perform specific tasks. The TCL IVR API Version 2.0 commands are as follows:
Command Description

aaa authenticate

Sends an authentication request to an external system, typically a Remote Access Dial-In User Services (RADIUS) server.

aaa authorize

Sends an authorization request to an external system, typically a RADIUS server.

call close

Marks the end of the call, releases all resources associated with that call, and frees the execution instance to handle the next call.

connection create

Connects two call legs.

connection destroy

Destroys a connection.

fsm define

Registers a state machine specified by a TCL array and its start state.

fsm setsate

Specifies the next state of the FSM after completion of the current action procedure.

handoff appl

Hands off the call leg to another application. The call leg cannot be returned using the handoff return command.

handoff callappl

Hands off the call leg to another application and waits for the call leg to return.

handoff return

Returns the call leg to the application.

infotag get

Retrieves information from a call leg, script, or system.

infotag set

Allows you to set information in the system.

leg collectdigits

Moves the call into Digit Collect mode and collects the digits.

leg connect

Sends a call connect message to the incoming call leg.

leg disconnect

Disconnects one or more call legs that are not part of a connection.

leg proceeding

Sends a call proceeding message to the incoming call leg.

leg setup

Initiates an outgoing call setup to the destination number.

leg setupack

Sends a call setup acknowledgement back to the incoming call leg.

media pause

Pauses the prompt playing on a specific call leg.

media play

Plays a prompt on a specific call leg.

media resume

Resumes play of a prompt on a specific call leg.

media seek

Seeks forward or backward in the current prompt.

media stop

Stops the prompt playing on a specific call leg.

playtone

Plays a specific tone or one according to the status code provided on a call leg.

puts

Prints the parameter to the console. Used for debugging.

requiredversion

Verifies the current version of the TCL IVR API.

timer left

Returns the time left on an active timer.

timer start

Starts a timer for a call on a specific call leg.

timer stop

Stops the timer.

For more on each command, see the "TCL IVR API Command Reference" section.

Prompts in TCL IVR Scripts

TCL IVR API Version 2.0 allows two types of prompts: memory-based and RTSP-based prompts.

As mentioned earlier, through the use of dynamic prompts, TCL IVR API Version 2.0 also provides some basic TTS functionality, like playing numbers, dollar amounts, date, and time. It also allows you to classify prompts using different languages so that when the script is instructed to play a particular prompt, it automatically plays the prompt in the active or specified language.


Note When setting up scripts, it is recommended not to use RTSP with very short prompts or dynamic prompts, because of poor performance.

Sample TCL IVR Script

The following example shows how to use the TCL IVR API Version 2.0 commands. We recommend that you start with the header information. This includes the name of the script, the date that the script was created and by whom, and some general information about what the script does.

We also recommend that you include a version number for the script, using a three-digit system, where the first digit indicates a major version of the script , the second digit is incremented with each minor revision (such as a change in function within the script), and the third digit is incremented each time any other changes are made to the script.

The following sample script does the following: plays dial-tone, collects digits to match a dial-plan, places an outgoing call to the destination, conferences the two call legs, and destroys the conference call legs and the disconnect call legs, when anyone hangs up.

# app_session.tcl
# Script Version 1.0.1
#------------------------------------------------------------------ 
# August 1999, Saravanan Shanmugham 
# 
# Copyright (c) 1998, 1999 by cisco Systems, Inc. 
# All rights reserved. 
#------------------------------------------------------------------ 
# 
# This tcl script mimics the default SESSION app 
# 
# 
# If DID is configured, place the call to the dnis. 
# Otherwise, output dial-tone and collect digits from the 
# caller against the dial-plan. 
# 
# Then place the call. If successful, connect it up. Otherwise, 
# the caller should hear a busy or congested signal. 
  
# The main routine establishes the state machine and then exits. 
# From then on, the system drives the state machine depending on the 
# events it recieves and calls the appropriate TCL procedure. 
 
  

Next, we define a series of procedures.

The init procedure defines the initial parameters of the digit collection. In this procedure:

proc init { } { 
    global param 
  
    set param(interruptPrompt) true 
    set param(abortKey) * 
    set param(terminationKey) # 
  
} 
 

The act_Setup procedure is executed when an ev_setup_indication event is received. It gathers the information necessary to place the call. In this procedure:

proc act_Setup { } { 
    global dest 
    global beep 
  
    set beep 0 
    leg setupack leg_incoming 
  
    if { [infotag get leg_isdid] } { 
        set dest [infotag get leg_dnis] 
        leg proceeding leg_incoming 
        leg setup $dest callInfo leg_incoming 
        fsm setstate PLACECALL 
    } else { 
  
        playtone leg_incoming tn_dial 
  
        set param(dialPlan) true 
        leg collectdigits leg_incoming param 
      } 
  
} 

The act_GotDest procedure is executed when an ev_collectdigits_done event is received. It determines whether the collected digits match the dial plan, in which case the call should be placed. In this procedure:

proc act_GotDest { } { 
    global dest 
  
    set status [infotag get evt_status] 
  
    if {  $status == "cd_004" } { 
        set dest [infotag get evt_dcdigits] 
        leg proceeding leg_incoming 
        leg setup $dest callInfo leg_incoming 
  
    } else { 
        puts "\nCall [infotag get con_all] got event $status collecting destination" 
        call close 
    } 
} 
  

The act_CallSetupDone procedure is executed when an ev_setup_done event is received. It determines whether there is a time limit on the call. In this procedure:

proc act_CallSetupDone { } { 
    global beep 
  
    set status [infotag get evt_status] 
  
    if { $status == "ls_000"} { 
  
        set  creditTimeLeft [infotag get leg_settlement_time leg_outgoing] 
  
        if { ($creditTimeLeft == "unlimited") || 
             ($creditTimeLeft == "uninitialized") } { 
            puts "\n Unlimited Time" 
        } else { 
            # start the timer for ... 
            if { $creditTimeLeft < 10 } { 
                set beep 1 
                set delay $creditTimeLeft 
            } else { 
                set delay [expr $creditTimeLeft - 10] 
            } 
            timer start leg_timer $delay leg_incoming 
        } 
    } else { 
        puts "Call [infotag get con_all] got event $status while placing an outgoing call" 
        call close 
    } 
} 
  

The act_Timer procedure is executed when an ev_leg_timer event is received. It is used in the last 10 seconds of credit time and warns the user that time is expiring and terminates the call when the credit limit is reached. In this procedure:

proc act_Timer { } { 
    global beep 
    global incoming 
    global outgoing 
  
    set incoming [infotag get leg_incoming] 
    set outgoing [infotag get leg_outgoing] 
  
    if { $beep == 0 } { 
        #insert a beep ...to the caller 
        connection destroy con_all 
        set beep 1 
    } else { 
        media play leg_incoming flash:out_of_time.au 
        fsm setstate CALLDISCONNECTED 
    } 
} 
  

The act_Destroy procedure is executed when an ev_destroy_done event is received. It plays a beep to the incoming call leg.

proc act_Destroy { } {

media play leg_incoming flash:beep.au

}

  

The act_Beeped procedure is executed when an ev_media_done event is received. It creates a connection between the incoming and the outgoing call legs.

proc act_Beeped { } {

global incoming

global outgoing

connection create $incoming $outgoing

}

The act_ConnectedAgain procedure is executed when an ev_create_done event is received. It resets the timer on the incoming call leg to 10 seconds.

proc act_ConnectedAgain { } {

timer start leg_timer 10 leg_incoming

}

  

The act_Ignore procedure reports "Event Capture."

proc act_Ignore { } {

# Dummy

puts "Event Capture"

}

The act_Cleanup procedure is executed when an ev_disconnected event is received and when the state is CALLDISCONNECTED. It closes the call.


Note When the script receives an ev_disconnected event, the script has 15 seconds to clear the leg with the leg disconnect command. After 15 seconds, a timer expires, the script is cleaned up, and an error message is displayed to the console. This avoids the situation where a script might not have cleared a leg after a disconnect.

proc act_Cleanup { } {

call close

}

Finally, we put all the procedures together in a main routine. The main routine defines a TCL array that defines the actual state transitions for the various state and event combinations. It registers the state machine that will drive the calls. In the main routine:

init 
  
#---------------------------------- 
#   State Machine 
#---------------------------------- 
  set TopFSM(any_state,ev_disconnected) "act_Cleanup,same_state" 
  set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup,GETDEST" 
  set TopFSM(GETDEST,ev_collectdigits_done) "act_GotDest,PLACECALL" 
  set TopFSM(PLACECALL,ev_setup_done)  "act_CallSetupDone,CALLACTIVE" 
  set TopFSM(CALLACTIVE,ev_leg_timer) "act_Timer,INSERTBEEP" 
  set TopFSM(INSERTBEEP,ev_destroy_done) "act_Destroy,same_state" 
  set TopFSM(INSERTBEEP,ev_media_done)  "act_Beeped,same_state" 
  set TopFSM(INSERTBEEP,ev_create_done)    "act_ConnectedAgain,CALLACTIVE" 
  set TopFSM(CALLACTIVE,ev_disconnected)   "act_Cleanup,CALLDISCONNECTED" 
  set TopFSM(CALLDISCONNECTED,ev_disconnected) "act_Cleanup,same_state" 
  set TopFSM(CALLDISCONNECTED,ev_media_done)  "act_Cleanup,same_state" 
  set TopFSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state" 
  set TopFSM(CALLDISCONNECTED,ev_leg_timer) "act_Cleanup,same_state" 

Initialization and Setup of the State Machine

  
  fsm define TopFSM  CALL_INIT 

Testing and Debugging Your Script

It is important to thoroughly test a script before it is deployed. To test a script, you must place it on a router and place a call to activate the script. When you test your script, make sure that you test every procedure in the script and all variations within each procedure.

You can view debugging information applicable to the TCL IVR scripts that are running on the router. The debug voip ivr command allows you to specify the type of debug output you want to view. To view debug output, enter the following command in privileged Exec mode:

[no] debug voip ivr [states | error | tclcommands | callsetup | digitcollect | script | dynamic | applib | settlement | all]

For more information about the debug voip ivr command, see the Interactive Voice Response Version 2.0 on Cisco VoIP Gateways document on CCO.

The output of any TCL puts commands is displayed if script debugging is on.

Possible sources of errors are:

In most cases, an error such as these causes the underlying infrastructure to disconnect the call legs and clean up.

Loading Your Script

To associate an application with your TCL IVR script, use the following command:

(config)# call application voice application_name script_url

Once you have associated an application with your TCL IVR script, you can use the following form of the command to configure parameters:

(config)# call application voice application_name script_url [parameter value]

In this command:

For more information about the call application voice command, see the Interactive Voice Response Version 2.0 on Cisco VoIP Gateways document on CCO.

In the following example, the application named "test" is associated with the TCL IVR script called newapp.tcl, which is located at tftp://keyer/debit_audio/:

(config)# call application voice test tftp://keyer/debit_audio/newapp.tcl


Note If the script cannot be loaded, it is placed in a retry queue and the system periodically retries to load it.

For more information about the call application voice command, see the Interactive Voice Response Version 2.0 on Cisco VoIP Gateways document on CCO.

If you modify your script, you can reload it using only the script name as shown below:

(config)# call application voice load script_name

For more information about the call application voice load command, see the Interactive Voice Response Version 2.0 on Cisco VoIP Gateways document on CCO.

Associating Your Script with an Inbound Dial Peer

To invoke your TCL IVR script to handle a call, you must associate the application configured with an inbound dial peer. To associate your script with an inbound dial peer, enter the following commands in configuration mode:

(config)# dial-peer voice number voip

(conf-dial-peer)# incoming called-number destination_number

(conf-dial-peer)# application application_name

In these commands:

For example, the following commands indicate that the application called "newapp" should be invoked for calls that come in from an IP network and are destined for the telephone number of 125.

(config)# dial-peer voice 3 voip
(conf-dial-peer)# incoming called-number 125
(conf-dial-peer)# application newapp
 

For more information about inbound dial peers, see the Cisco IOS software documentation.

Displaying Information About IVR Scripts

To view a list of the voice applications that are configured on the router, use the show call application voice command. A one-line summary of each application is displayed.

show call application voice [ [name] | [summary] ]

In this command:

The following is an example of the output of the show call application voice command:

router# show call application voice session2

Idle call list has 0 calls on it.

Application session2

The script is read from URL tftp://dirt/sarvi/scripts/tcl/app_session.tcl

The uid-len is 10 (Default)

The pin-len is 4 (Default)

The warning-time is 60 (Default)

The retry-count is 3 (Default)

It has 0 calls active.

The TCL Script is:

------------------

# app_session.tcl

#------------------------------------------------------------------

# August 1999, Saravanan Shanmugham

#

# Copyright (c) 1998, 1999 by cisco Systems, Inc.

# All rights reserved.

#------------------------------------------------------------------

#

# This tcl script mimics the default SESSION app

#

#

# If DID is configured, just place the call to the dnis

# Otherwise, output dial-tone and collect digits from the

# caller against the dial-plan.

#

# Then place the call. If successful, connect it up, otherwise

# the caller should hear a busy or congested signal.

# The main routine just establishes the state machine and then exits.

# From then on the system drives the state machine depending on the

# events it recieves and calls the appropriate tcl procedure

#---------------------------------

# Example Script

#---------------------------------

proc init { } {

global param

set param(interruptPrompt) true

set param(abortKey) *

set param(terminationKey) #

}

proc act_Setup { } {

global dest

global beep

set beep 0

leg setupack leg_incoming

if { [infotag get leg_isdid] } {

set dest [infotag get leg_dnis]

leg proceeding leg_incoming

leg setup $dest callInfo leg_incoming

fsm setstate PLACECALL

} else {

playtone leg_incoming tn_dial

set param(dialPlan) true

leg collectdigits leg_incoming param

}

}

proc act_GotDest { } {

global dest

set status [infotag get evt_status]

if { $status == "cd_004" } {

set dest [infotag get evt_dcdigits]

leg proceeding leg_incoming

leg setup $dest callInfo leg_incoming

} else {

puts "\nCall [infotag get con_all] got event $status while placing an outgoing call"

call close

}

}

proc act_CallSetupDone { } {

global beep

set status [infotag get evt_status]

if { $status == "CS_000"} {

set creditTimeLeft [infotag get leg_settlement_time leg_outgoing]

if { ($creditTimeLeft == "unlimited") ||

($creditTimeLeft == "uninitialized") } {

puts "\n Unlimited Time"

} else {

# start the timer for ...

if { $creditTimeLeft < 10 } {

set beep 1

set delay $creditTimeLeft

} else {

set delay [expr $creditTimeLeft - 10]

}

timer start leg_timer $delay leg_incoming

}

} else {

puts "Call [infotag get con_all] got event $status collecting destination"

call close

}

}

proc act_Timer { } {

global beep

global incoming

global outgoing

set incoming [infotag get leg_incoming]

set outgoing [infotag get leg_outgoing]

if { $beep == 0 } {

#insert a beep ...to the caller

connection destroy con_all

set beep 1

} else {

media play leg_incoming flash:out_of_time.au

fsm setstate CALLDISCONNECTED

}

}

proc act_Destroy { } {

media play leg_incoming flash:beep.au

}

proc act_Beeped { } {

global incoming

global outgoing

connection create $incoming $outgoing

}

proc act_ConnectedAgain { } {

timer start leg_timer 10 leg_incoming

}

proc act_Ignore { } {

# Dummy

puts "Event Capture"

}

proc act_Cleanup { } {

call close

}

init

#----------------------------------

# State Machine

#----------------------------------

set TopFSM(any_state,ev_disconnected) "act_Cleanup,same_state"

set TopFSM(CALL_INIT,ev_setup_indication) "act_Setup,GETDEST"

set TopFSM(GETDEST,ev_digitcollect_done) "act_GotDest,PLACECALL"

set TopFSM(PLACECALL,ev_setup_done) "act_CallSetupDone,CALLACTIVE"

set TopFSM(CALLACTIVE,ev_leg_timer) "act_Timer,INSERTBEEP"

set TopFSM(INSERTBEEP,ev_destroy_done) "act_Destroy,same_state"

set TopFSM(INSERTBEEP,ev_media_done) "act_Beeped,same_state"

set TopFSM(INSERTBEEP,ev_create_done) "act_ConnectedAgain,CALLACTIVE"

set TopFSM(CALLACTIVE,ev_disconnected) "act_Cleanup,CALLDISCONNECTED"

set TopFSM(CALLDISCONNECTED,ev_disconnected) "act_Cleanup,same_state"

set TopFSM(CALLDISCONNECTED,ev_media_done) "act_Cleanup,same_state"

set TopFSM(CALLDISCONNECTED,ev_media_done) "act_Cleanup,same_state"

set TopFSM(CALLDISCONNECTED,ev_disconnect_done) "act_Cleanup,same_state"

set TopFSM(CALLDISCONNECTED,ev_leg_timer) "act_Cleanup,same_state"

fsm define TopFSM CALL_INIT

Using URLs in IVR Scripts

With IVR scripts, you use URLs to call the script and to call the audio files that the script plays. The VoIP system uses Cisco IOS File System (IFS) to read the files, so any IFS supported URLs can be used, which includes TFTP, FTP, or a pointer to a device on the router.


Note There is a limit of 32 entries in Flash memory, so you may not be able to copy all your audio files into Flash memory.

URLs for Loading the IVR Script

The URL of the IVR script is a standard URL that points to the location of the script. Examples include:

URLs for Loading Audio Files

URLs for audio files are different from those used to load IVR scripts. With URLs for audio files:

Tips for Using Your TCL IVR Script

This section provides some answers to frequently asked questions about using TCL IVR scripts.

    1. How do I get information from my RADIUS server to the TCL IVR script?

    2. What happens if my script encounters an error?

TCL IVR API Command Reference

This section provides an alphabetical listing of the new TCL IVR API commands. The following is provided for each command:

For information about returns and events, see the "Events" section.

aaa authenticate

The aaa authenticate command validates the authenticity of the user. This command sends the account number and password to the appropriate server for authentication.

Syntax

aaa authenticate account password [avSend]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

When the command has finished, the script receives an ev_authenticate_done event.

Example

aaa authenticate $account $password

Usage Notes

Note Cisco IOS Release 12.1(2) is the first release incorporating the argument avSend.
Example 1:
set avsend(h323-credit-amount) 25.0
 
Example 2 (using two values for h323-ivr-out):
set avsend(h323-ivr-out,0) "payphone:true"
 
set avsend(h323-ivr-out,1) "creditTime:3400"

aaa authorize

The aaa authorize command sends a RADIUS authorization request. Typically, this command is used to provide additional information to the RADIUS server (destination and origination numbers) after a user has been successfully authenticated. It sends the authorization request to the RADIUS server after the IVR application prompts the user to enter the destination number.

Syntax

aaa authorize account password ani destination {legID | info-tag} [avSend]

Arguments

The arguments of this command are:

The account and password arguments are the same as those specified in the aaa authenticate command. The destination and ani arguments provide additional information to the external server.

Return Values

None

Command Completion

When the command finishes, the script receives an ev_authorize_done event.

Example

aaa authorize $account $password $ani $destination $legid

Usage Notes

Note Cisco IOS Release 12.1(2) is the first release incorporating the argument avSend.
Example 1:
set avsend(h323-credit-amount) 25.0
 
Example 2 (using two values for h323-ivr-out):
set avsend(h323-ivr-out,0) "payphone:true"
 
set avsend(h323-ivr-out,1) "creditTime:3400"

call close

The call close command marks the end of the call and frees the execution instance of the script to handle the next call. This command causes the system to clean up the resources associated with that call. If conference legs exist, this command destroys the connection and clears all the call legs. If leg collectdigits is active on any of the call legs, the digit collection process is terminated and the call is cleared.

Syntax

call close

Arguments

None

Return Values

None

Command Completion

Immediate

Example

proc act_Disconnected {} {

call close

}

set FSM(any_state,ev_disconnected) "act_Disconnected, CALL_CLOSED"

Usage Notes

The call close command marks the end of the call and the end of the script. This command causes the system to clean up the resources.

connection create

The connection create command connects two call legs.

Syntax

connection create {legID1 | info-tag1} {legID2 | info-tag2}

Arguments

The arguments of this command are:

Return Values

This command returns the following:

Command Completion

When this command finishes, the script receives an ev_create_done event.

Example

set connID [connection create $legID1 $legID2]

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

connection destroy

The connection destroy command destroys the connection between the two call legs.

Syntax

connection destroy {connectionID | info-tag}

Arguments

The arguments of this command are:

Return Values

None

Command Completion

When this command finishes, the script receives an ev_destroy_done event.

Example

connection destroy $connID

Usage Notes

The individual call legs are not disconnected; only the connection between the call legs is destroyed.

fsm define

The fsm define command registers a state machine for the script. The state machine is specified using a TCL array that lists the state event transition along with the appropriate action procedure.

Syntax

fsm define statemachine_array start_state

Arguments

The arguments of this command are:

set statemachine_array(current_state,current_event) "actionFunction,next_state"

Return Values

None

Command Completion

Immediate

Example

#----------------------------------

# State Machine

#----------------------------------

set FSM(CALL_INIT,ev_setup_indication) "act_Setup,DEST_COLLECT"

set FSM(DEST_COLLECT,ev_disconnect_done) "act_DCDone,CALL_SETTING"

set FSM(DEST_COLLECT,ev_disconnected) "act_DCDisc,CALL_DISCONNECTING"

set FSM(CALL_SETTING,ev_callsetup_done) "act_PCDone,CALL_ACTIVE"

set FSM(CALL_SETTING,ev_disconnected) "act_PCDisc,CALL_SETTING_WAIT"

fsm define FSM CALL_INIT

fsm setstate

The fsm setstate command allows you to specify the state that the FSM will move to after completion of the action procedure.

Syntax

fsm setstate StateName

Arguments

The argument of this command is:

Return Values

None

Command Completion

None

Example

#Check for DNIS, if there is DNIS you want to go to Call setup right away

set legID [infotag get evt_legs]

set destination [infotag get leg_dnis $legID]

if {destination != ""} {

          callProceeding $legID

          set callInfo(alertTimer) 30

          call setup $destination callInfo leg_incoming

          #Moves to CALL_SETTING state

          fsm setstate CALL_SETTING

} else {

          leg setupack $legID

          playtone $legID TN_DIAL

          set DCInfo(dialPlan) true

          # Assumption: As per the state machine moves to DIGIT_COLLECT}

          leg collectdigits $legID DCInfo

}

Usage Notes

handoff appl

The handoff appl command hands off the specified call leg (and all call legs connected to it) to the specified application and does not expect it to return.

Syntax

handoff appl {legID | info-tag} app-name [argstring]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

None

Example

handoff appl leg_outgoing new_app "DIAL_PEER=25"

handoff appl leg_outgoing melody_app "SONG=hello_world.au;VOLUME=25"

Usage Notes

handoff callappl

The handoff callappl command hands off the specified call leg (and all call legs connected to it) to the specified application and can wait for the leg to be returned by the destination application.

Syntax

handoff callappl {legID | info-tag} app-name [argstring]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

When the application has completed its processing, the script receives an ev_returned event. This event indicates that all the call legs have been accounted for. This means that they have either been returned or disconnected.

Example

handoff callappl leg_outgoing other_app "DIAL_PEER=25"

handoff callappl leg_outgoing melody_app "SONG=hello_world.au;VOLUME=25"

Usage Notes

handoff return

The handoff return command returns the call leg (and all connected call legs) to the application that handed the specified call leg to this application using the handoff callappl command.

Syntax

handoff return {legID | info-tag} [argstring]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

handoff return leg_outgoing "RESULT=25"

handoff return leg_outgoing "SONG=hello_world.au;VOLUME=25"

Usage Notes

infotag get

The infotag get command retrieves information from a call leg, call, script, or system. The information retrieved is based on the info-tag specified.

Syntax

infotag get info-tag [parameter-list]

Arguments

The arguments of this command are:

Return Values

The information requested.

Command Completion

Immediate

Example

set dnis [infotag get leg_dnis]

set language [infotag get med_language]

set leg_list2 [infotag get leg_legs]

Usage Notes

Some info-tags have specific scopes of access. For example, you cannot call evt_dcdigits while handling the ev_setup_done event. In other words, if the previous command is leg setup and the ev_setup_done event has not yet returned, then you cannot execute an infotag get evt_dcdigits command, or the script terminates with error output. For more information, see the "Information Tags" section.

infotag set

The infotag set command allows you to set information in the system. This command works only with info-tags that are writable.

Syntax

infotag set {info-tag [parameters]} value

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

infotag set med_language prefix ch

infotag set med_location ch 0 tftp://www.cisco.com/mediafiles/Chinese

leg collectdigits

The leg collectdigits command instructs the system to collect digits on a specified call leg against a dial plan, a list of patterns, or both.

Syntax

leg collectdigits {legID | info-tag} [param [match]]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

When the command finishes, the script receives an ev_collectdigits_done event, which contains the success or failure code and the digits collected. For more information about the success and failure codes, see the "Status Codes" section.

Examples

Example 1 - Collect digits to match dialplan:

set params(interruptPrompt) true

set params(dialPlan) true

leg collectdigits $legID params

Example 2 - Collect digits to match a pattern:

set pattern(1) "99.....9*"

set pattern(2) "88.....9*"

leg collectdigits $legID params pattern

Usage Notes

leg connect

The leg connect command sends a signaling level CONNECT message to the incoming call leg.

Syntax

leg connect {legID | info-tag }

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Examples
leg connect leg_incoming
leg connect $legID
Usage Notes

leg disconnect

The leg disconnect command disconnects one or more call legs that are not part of any connection.

Syntax

leg disconnect {legID | info-tag} [cause_code]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

When the command finishes, the script receives an ev_disconnect_done event.

Examples

leg disconnect leg_incoming

leg disconnect leg_outgoing

leg disconnect leg_all

leg disconnect 25

leg disconnect $callId

leg disconnect [info-tag get evt_legs]

Usage Notes

leg proceeding

The leg proceeding command sends a call proceeding message to the incoming call leg. The gateway is responsible for translating this message into the appropriate protocol message (depending on the call leg) and sending them to the caller.

Caution The ISDN state machine actually connects the incoming call on a setup acknowledgement.
Syntax

leg proceeding {legID | info-tag}

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

leg proceeding leg_incoming

Usage Notes

leg setup

The leg setup command requests the system to place an outgoing call to the specified destination numbers.

Syntax

leg setup {destination | array-of-destinations} callinfo {legID | info-tag}

Arguments

The arguments of this command are:

Return Value

None

Command Completion

When the command finishes, the script receives an ev_setup_done event.

Example

set callInfo(alertTime) 25

leg setup 9857625 callInfo leg_incoming

set destinations(1) 9787659

set destinations(2) 2621336

leg setup destinations callInfo leg_incoming

Usage Notes
The above information can be obtained from evt_legs and evt_connections info-tags. For more information about info-tags, see the "Information Tags" section.
If unsuccessful, this command returns nothing or a single leg ID. You might get the incoming or the outgoing leg ID, because the incoming leg that was passed might have been disconnected. Again, these are exception cases, that may happen due to supplementary services processing or H.450 services.

leg setupack

The leg setupack command sends a setup acknowledgement message on the specified incoming call leg.

Syntax

leg setupack {legID | info-tag}

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

leg setupack leg_incoming

Usage Notes

media pause

The media pause command temporarily pauses the prompt that is currently playing on the specified call leg.

Syntax

media pause {legID | info-tag}

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

media pause $legID

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

media play

The media play command plays the specified prompt on the specified call leg.

Syntax

media play {legID | info-tag} url-list

Arguments

The arguments of this command are:

Return Values

None

Command Completion

When the command finishes, the script receives an ev_media_done event. If a seek is done on this playing stream and the seek goes beyond the end of the prompt, the script still receives an ev_media_done event. However, if the prompt is terminated by a media stop command, the script does not receive an ev_media_done event.

Examples

media play $legID "_welcome.au" "%a$amt %s1000 en_enter_dest.au"

media play $legID "flash:message1.au rtspu://realplayer.com/audio/weather.ra"

set prompts "flash:prompt1.au ftp://dirt/sarvi/welcome.au %a285"

media play $legID $prompts _hello.au flash:welcome.au

media play $legID %c1 _welcome.au %c2 _welcome.au %c3 _welcome.au

media play $legID %i3

Usage Notes

media resume

The media resume command resumes play of the prompt that is currently paused on the specified call leg.

Syntax

media resume {legID | info-tag}

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

media resume $legID

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

media seek

The media seek command does a relative seek on the prompt that is currently playing. This command moves the prompt forward the specified number of seconds within the message.

Syntax

media seek {legID | info-tag} time-in-seconds

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

media seek $legID +25

media seek $legID -10

Usage Notes

media stop

The media stop command stops the prompt that is currently playing on the specified call leg.

Syntax

media stop {legID | info-tag}

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate. However, the script receives an ev_media_done event if the prompt completed prior to being stopped.

Example

media stop $legID

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

playtone

The playtone command plays a tone on the specified call leg. If a conference is in session, the digital signaling processor (DSP) stops sending data to the remote end while playing a tone. This command is typically used to give the caller a dial tone if the script needs to collect digits.

Syntax

playtone {legID | info-tag} {Tone | StatusCode}

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

playtone leg_incoming [getInfo evt_status]

playtone leg_all tn_oos

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

puts

The puts command outputs a debug string to the console if the IVR state debug flag is set (using the debug voip ivr script command).

Syntax

puts string

Arguments

The argument of this command is:

Return Values

None

Command Completion

None

Example:

puts "Hello $name"

requiredversion

The requiredversion command verifies that the script is running the correct version of the TCL IVR API.

Syntax

requiredversion majorversion.minorversion

Arguments

The arguments of this command are:

Return Values

None

Command Completion

None

Example

requiredversion 2.5

Usage Notes

If the version of the script does not match the major version specified or is not equal to or greater than the minor version specified, the script terminates and an error is displayed at the console.

timer left

The timer left command returns the number of seconds left on an active timer.

Syntax

timer left type [legID | info-tag]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

Immediate

Example

set time [timer left call_timer0]

set time [timer left leg_timer $legID2]

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

timer start

The timer start command starts a timer for a specified number of seconds for the whole call or for specified call leg.

Syntax

timer start type time [legID | info-tag]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

When the timer expires, the script receives an ev_call_timer0 or an ev_leg_timer event.

Example

timer start call_timer0 30

timer start leg_timer 65 $legID2

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

timer stop

The timer stop command stops a timer.

Syntax

timer stop type [legID | info-tag]

Arguments

The arguments of this command are:

Return Values

None

Command Completion

None

Example

timer stop call_timer0

timer stop leg_timer $legID2

Usage Notes

If the specified call leg is invalid, the script terminates and displays an error to the console, and the call is cleared.

Events

The following events can be received by the TCL IVR script. Any events received that are not included below are ignored.
Event

Description

ev_any_event

A special wildcard event that can be used in the state machine to represent any event that might be received by the script.

ev_authorize_done

Indicates the completion of the aaa authorize command. You can use the evt_status info-tag to determine the authorization status (whether it succeeded or failed).

ev_authenticate_done

Indicates the completion of the authentication command. You can use the evt_status info-tag to determine the authentication status (whether it succeeded or failed).

ev_call_timer0

Indicates that the call-level timer expired.

ev_collectdigits_done

Indicates the completion of the leg collectdigits command on the call leg. You can then use the evt_status info-tag to determine the status of the command completion. You can use the evt_dcdigits info-tag to retrieve the collected digits.

ev_create_done

Indicates the completion of the connection create command. You can use the evt_connection info-tag to determine the ID of the completed connection.

ev_destroy_done

Indicates the completion of the connection destroy command. You can use the evt_connection info-tag to determine the ID of the connection that was destroyed.

ev_digit_end

Indicates that a digit key is pressed and released. You can use the evt_digit info-tag to determine which digit was pressed. You can use the evt_digit_duration info-tag to determine how long (in seconds) the digit was pressed. This can be used to detect long pounds or long digits.

ev_disconnect_done

Indicates that the call leg has been cleared.

ev_disconnected

Indicates that one of the call legs needs to disconnect. Upon receiving this event, the script must issue a leg disconnect on that call leg. You can use the evt_legs info-tag to determine which call leg disconnected.

ev_grab

Indicates that an application that called this script is requesting that the script return the call leg. The script receiving this event can clean up and return the leg with a handoff return command. Whether this is done is at the discretion of the script receiving the ev_grab event.

ev_hookflash

Indicates a hook flash (such as a quick onhook-offhook in the middle of a call), assuming that the underlying platform or interface supports hook flash detection.

ev_handoff

Indicates that the script received one or more call legs from another application. When the script receives this event, you can use the evt_legs and the evt_connections info-tags to obtain a list of the call legs and connection IDs that accompanied the ev_handoff event.

ev_leg_timer

Indicates that the leg timer expired. You can use the evt_legs info-tag to determine which leg timer expired.

ev_media_done

Indicates that the prompt playout either completed or failed. You can use the evt_status info-tag to determine the completion status.

ev_returned

Indicates that a call leg that was sent to another application (using handoff callappl) has been returned. This event can be accompanied by one or more call legs that were created by the called application. When the script receives this event, you can use the evt_legs and the evt_connections info-tags to obtain a list of the call legs and connection IDs that accompanied the ev_returned event. You can use the evt_iscommanddone info-tag to verify that all of the call legs sent have been accounted for, meaning that the handoff callappl command is complete.

ev_setup_done

Indicates that the leg setup command has finished. You can then use the evt_status info-tag to determine the status of the command completion (whether the call was successfully set up or failed for some reason).

ev_setup_indication

Indicates that the system received a call. This event and the ev_handoff event are the events that initiate an execution instance of a script.

Information Tags

Information tags (info-tags) are identifiers that can be used to retrieve information about call legs, events, the script itself, current configuration, and values returned from RADIUS. Some info-tags have one or more parameters that are used to further identify the information to be retrieved, set, or modified.

Info-tags are grouped according to use. The first three characters of the info-tag label indicate the grouping.

This section lists the available info-tags and the following information about each:


Note If an info-tag is specified incorrectly, if any of the parameters are specified incorrectly, or if the info-tag is used outside its intended scope, the script terminates with error output.

aaa_avpair

Description

Returns the value of an AV-pair that was returned by RADIUS.

After an authorize command finishes, the RADIUS server could have returned parameters as av-pairs. This info-tag along with aaa_avpair_exists is used to check if a parameter was returned and if it was, to get the value. Refer to the table in AV Pair Names, for a list of valid VSA avpair names.

Syntax

infotag get aaa_avpair avpair-name

Mode

Read

Scope

Global

Return Type

String, Number, Boolean (1 or 0), or any other value that is configured or returned through RADIUS.

Direct Mapping

None

aaa_avpair_exists

Description

Returns an indication of whether the RADIUS has determined a VSA avpair exists.

After an authorize command completes the RADIUS server could have returned parameters as av-pairs. This info-tag along with aaa_avpair is used to check if a parameter was returned and if it has, to get the value. Refer to the table in AV Pair Names, for a list of valid VSA avpair names.

Syntax

infotag get aaa_avpair_exists avpair-name

Mode

Read

Scope

Global

Return Type

Boolean (1 = true; 0=false)

Direct Mapping

None

AV Pair Names

The info-tag aaa_avpair_exists can be used to check the availability of a VSA. The info-tag aaa_avpair can be used to access the value returned in this VSA. The valid VSA names that can be passed parameters to these commands are the following.
Type Name Description

aaa

h323-ivr-in

A generic VSA for the billing server to send any information to the gateway in the form of an avpair like "color:blue" or "advprompt:rtsp://www.cisco.com/rtsp/areyouready.au"

h323-ivr-out

A generic VSA for the gateway to send any information to the billing server in the form of an avpair like "color:blue" or "advprompt:rtsp://www.cisco.com/rtsp/areyouready.au"

h323-credit-amount

The credit amount remaining in the account is returned.

h323-credit-time

The credit time remaining in the account is returned.

h323-prompt-id

The ID of the prompt is returned.

h323-redirect-number

The number for redirection of a call is returned.

h323-redirect-ip-addr

The IP address for the preferred route is returned.

h323-preferred-lang

The language that the billing system returns as the preferred language of the end user. Currently, three languages are supported; en (english), sp (spanish) and ch (mandarin). You can define additional languages as needed.

h323-time-and-day

The current time and day at the destination.

h323-return-code

This information is returned only after an authorization command is issued. It returns either a numerical value or "Unknown variable name." The numerical value indicates what action the IVR application should take, namely to play a particular audio file to inform the end user of the reason for the failed authorization. If "Unknown variable name" is returned, this indicates that the external AAA server is out of service.

h323-billing-model

Indicates the billing model used for the call. Initial values: 0=Credit, 1=Debit. Note: The debit card application assumes a Debit billing model.

h323-currency

ISO currency to indicate what units to use in playing the remaining balance. Note: the debit card application assumes units of preferred_language_dollar.au and preferred_language_cent.au.


Note If the aaa variable returns "0", this indicates that there is no VSA match to the name returned.

cfg_avpair

Description

Returns the value of an AV-pair that was configured through the CLI.

Syntax

infotag get cfg_avpair avpair-name

Mode

Read

Scope

Global

Return Type

String, Number, Boolean (1 or 0), or any other value that is configured or returned through RADIUS.

Direct Mapping

None

cfg_avpair_exists

Description

Returns an indication of whether the specified parameter or AV-pair was configured through the CLI.

Syntax

infotag get cfg_avpair_exists avpair-name

Mode

Read

Scope

Global

Return Type

Boolean (1 = true; 0=false)

Direct Mapping

None

con_all

Description

Returns or maps to a list of all the connection IDs in the script.

Syntax

infotag get con_all

Mode

Read

Scope

Global

Return Type

Number list

Direct Mapping

Connections

con_ofleg

Description

Gets a list of all the connections the leg is a part of. This does not include those connections that are in Creation or under Destruction. The info-tag should map to just one leg.

Syntax

infotag get con_ofleg {info-tag | legID}

Mode

Read

Scope

Global

Return Type

Number list

Direct Mapping

Connections

evt_connections

Description

Returns a list of connection IDs associated with the event received.

Syntax

infotag get evt_connections

Mode

Read

Scope

ev_handoff
ev_returned
ev_setup_done
ev_create_done
ev_destroy_done

Return Type

Number list

Direct Mapping

Connections

evt_dcdigits

Description

Returns the digits collected by the leg collectdigits command.

Syntax

infotag get evt_dcdigits

Mode

Read

Scope

ev_collectdigits_done

Return Type

String

Direct Mapping

None

evt_digit

Description

Returns the digit key that was pressed.

Syntax

infotag get evt_digit

Mode

Read

Scope

ev_digit_end

Return Type

String

Direct Mapping

None

evt_digit_duration

Description

Returns the duration of the digit that was pressed.

Syntax

infotag get evt_digit_duration

Mode

Read

Scope

ev_digit_end

Return Type

Number

Direct Mapping

None

evt_event

Description

Returns the name of the event received.

Syntax

infotag get evt_event

Mode

Read

Scope

Global

Return Type

String

Direct Mapping

None

evt_iscommanddone

Description

Returns an indication of whether the command has finished.

Syntax

infotag get evt_iscommanddone

Mode

Read

Scope

ev_returned
ev_setup_done
ev_collectdigits_done

Return Type

Boolean (1 = true; 0 = false)

Direct Mapping

None

evt_ho_string

Description

Returns the handoff string when one or more call legs are handed off or returned to the script.

Syntax

infotag get evt_ho_string

Mode

Read

Scope

ev_handoff
ev_returned

Return Type

String

Direct Mapping

None

evt_legs

Description

Returns a list of leg IDs associated with the event received. For information about which legs the evt_legs info-tag returns for a specific event, see the "Events" section.

Syntax

infotag get evt_legs

Mode

Read

Scope

ev_leg_timer
ev_digit_end
ev_hookflash
ev_disconnected
ev_disconnect_done
ev_grab
ev_setup_indication
ev_media_done
ev_handoff
ev_returned
ev_setup_done
ev_collectdigits_done

Return Type

Number list

Direct Mapping

Legs

evt_status

Description

Returns the status of the event received. This info-tag is valid only in the scope of the function handling the event. For a list of possible statuses, see the "Status Codes" section.

Syntax

infotag get evt_status

Mode

Read

Scope

ev_setup_done
ev_collectdigits_done
ev_media_done
ev_disconnected
ev_authorize_done
ev_authenticate_done

Return Type

String

Direct Mapping

None

leg_all

Description

Returns or maps to one or more call legs. This is the union of leg_incoming and leg_outgoing.

Syntax

infotag get leg_all

Mode

Read

Scope

Global

Return Type

Number list

Direct Mapping

Legs

leg_ani

Description

Returns the ANI field of CallInfo.

Syntax

infotag get leg_ani [legID]

If no leg ID is specified, this info-tag returns the ANI field of the first incoming call leg. Not specifying a leg ID works only if there is at least one incoming call leg.

If a leg ID is specified, this info-tag returns the ANI field of that call leg. If the call leg is not valid, the script terminates with error output.

Mode

Read

Scope

Global

Return Type

String

Direct Mapping

None

leg_dnis

Description

Returns the DNIS field of CallInfo.

Syntax

infotag get leg_dnis [legID]

If no leg ID is specified, this info-tag returns the DNIS field of the first incoming call leg. Not specifying a leg ID works only if there is at least one incoming call leg.

If a leg ID is specified, this info-tag returns the DNIS field of that call leg. If the call leg is not valid, the script terminates with error output.

Mode

Read

Scope

Global

Return Type

String

Direct Mapping

None

leg_incoming

Description

Returns or maps to one or more incoming call legs.

Syntax

infotag get leg_incoming

Mode

Read

Scope

Global

Return Type

Number list

Direct Mapping

Legs

leg_inconnection

Description

Gets a list of legs that are part of this connection. The info-tag parameter maps to just one connection.

Syntax

infotag get inconnection {connID | info-tag}

Mode

Read

Scope

Global

Return Type

Number list

Direct Mapping

Legs

leg_isdid

Description

Returns the DID field of CallInfo. This is a Boolean field (1 and 0) that reflects the FinalDestination flag of the call leg.

Syntax

infotag get leg_isdid [legID]

If no leg ID is specified, this info-tag returns the DID field of the first incoming call leg. Not specifying a leg ID works only if there is at least one incoming call leg.

If a leg ID is specified, this info-tag returns the DID field of that call leg. If the call leg is not valid, the script terminates with error output.

Mode

Read

Scope

Global

Return Type

Boolean (1 = true; 0 = false)

Direct Mapping

None

leg_outgoing

Description

Returns or maps to one or more outgoing call legs.

Syntax

infotag get leg_outgoing

Mode

Read

Scope

Global

Return Type

Number list

Direct Mapping

Legs

leg_settlement_time

Description

Returns the minimum of the OSP settlement time (in seconds) associated with the list of specified legs.

Syntax

infotag get leg_settlement_time {legID | info-tag} [minimum]

If you specify minimum, this returns the minimum of the OSP settlement time of the list of legs and the value of the AAA avpair creditTime. This AAA avpair creditTime was returned by a previous aaa authorize command.

If all credit times are uninitialized, "uninitialized" is returned.

If all have unlimited time, or if one is uninitialized and the others have unlimited time, "unlimited" is returned.

Mode

Read

Scope

Global

Return Type

Number

Direct Mapping

None

med_backupserver

Description

Returns or sets the backup server. This is applicable for RTSP-based prompts.

If the script attempts to play a prompt using a URL and the URL fails, it reattempts to play the URL from list of backup servers by replacing the server portion of the URL.

For example, if the script had tried (but failed) to play a prompt from:

rtsp://www.cisco.com:5554/audiofiles/english/anounce.au

and the backup server 0 was configured as:

rtsp://www.real.com/cisco/

then the backup URL attempted would be:

rtsp://www.real.com/cisco/audiofiles/english/anounce.au

There can be a maximum of two backup servers configured (0 and 1).

This info-tag applies only to streams on which you have not played any prompts. Therefore, this is typically used in the one-time initialization section of the script.

Syntax

infotag get med_backupserver index

infotag set med_backupserver index server-URL

Mode

Read/Write

Scope

Global

Return Type

String

Direct Mapping

None

med_language

Description

Returns or sets the current active language for media playout.

This info-tag returns the language index or the language prefix (depending on whether prefix is specified) for the currently active language.

Syntax

infotag get med_language [prefix]

infotag set med_language [index | prefix prefix]

Mode

Read/Write

Scope

Global

Return Type

String/Number

Direct Mapping

None

med_language_map

Description

Returns or sets the mapping between the language index and the language prefix.

This info-tag returns the language index or the language prefix (depending on whether prefix is specified) for the currently active language.

Syntax

infotag get med_language_map [index | prefix prefix]

infotag set med_language_map index prefix

Mode

Read/Write

Scope

Global

Return Type

String/Number

Direct Mapping

None

med_location

Description

Returns or sets the language locations for all the languages the script will use. The language prefix, category, and location are the same as those configurable from the command line interface (CLI).

Syntax

infotag get med_location prefix category

infotag set med_location prefix category location

Mode

Read/Write

Scope

Global

Return Type

String

Direct Mapping

None

med_total_languages

Description

Returns the total number of languages configured.

Syntax

infotag get med_total_languages

Mode

Read

Scope

Global

Return Type

Number

Direct Mapping

None

sys_version

Description

Returns the version of the TCL IVR API.

Syntax

infotag get sys_version

Mode

Read

Scope

Global

Return Type

String

Direct Mapping

None

Status Codes

The evt_status info-tag returns a status code for the event received. This sections lists the possible status codes and their meaning.

Status codes are grouped according to function. The first two characters of the status code indicate the grouping.

Authentication Status

Authentication status is reported in au_xxx format:
Value for xxx Description

000

Authentication was successful.

001

Authentication failed.

Authorization Status

Authorization status is reported in ao_xxx format:
Value for xxx Description

000

Authorization was successful.

001

Authorization failed.

Media Status

Media status is reported in ms_xyy format:
x indicates the command yy indicates the status of the command
Value for x Description Value for yy Description

 0

Status for a media play command.

00

The command was successful and the prompt finished.1

 2

Status for a media stop command.

01

Failure.

 3

Status for a media pause command.

02

Unsupported feature or request.

 4

Status for a media resume command.

03

Invalid host or URL specified.

 5

Status for a media seek command to forward.

04

Received disconnected.

 6

Status for a media seek command to rewind.

05

The prompt was interrupted by a key press.

1Valid for the media play command only, because media_done events are not received for successful completion of other media commands.

Leg Setup Status

Leg setup status is reported in ls_xxx format:
Value for xxx Description

000

The call is active or was successful.

001

The outgoing call leg was looped.

002

The call setup timed out (meaning that the destination phone was alerting, but no one answered). The limit of this timeout can be specified in the leg setup command.

003

The call setup failed due to a lack of resources in the network.

004

The call setup failed because of an invalid number.

005

The call setup failed for reasons other than a lack of resources or an invalid number.

006

The destination was busy.

007

The incoming side of the call disconnected.

008

The outgoing side of the call disconnected.

009

The conferencing or connecting of the two call legs failed.

010

Supplementary services internal failure.

011

Supplementary services failure.

012

Supplementary services failure. Inbound call leg was disconnected.

Digit Collection Status

Digit collection status is reported in cd_xxx format:
Value for xxx Description

001

The digit collection timed out, because no digits were pressed and not enough digits were collected for a match.

002

The digit collection was aborted, because the user pressed an abort key.

003

The digit collection failed, because the buffer overflowed and not enough digits were collected for a match.

004

The digit collection succeeded with a match to the dial plan.

005

The digit collection succeeded with a match to one of the patterns.

006

The digit collection failed, because the number collected was invalid.

007

The digit collection was terminated, because an ev_disconnected event was received on the call leg.

008

The digit collection was terminated, because an ev_grab event was received on the call leg.

009

The digit collection successfully turned on digit reporting to the script.

010

The digit collection was terminated because of an unsupported or unknown feature or event.

Disconnect Cause

Disconnect causes use the format di_xxx where xxx is the Q931 cause code. Possible values are:
Value for xxx Description

000

Uninitialized

001

Unassigned number

002

No route to the transit network

003

No route to the destination

004

Send information tone

005

Misdialed trunk prefix

006

Unacceptable channel

007

Call awarded

008

Preemption

009

Preemption reserved

016

Normal

017

Busy

018

No response from the user

019

No answer from the user

020

Subscriber is absent

021

Call rejected

022

Number has changed

026

Selected user is clearing

027

Destination is out of order

028

Invalid number

029

Facility rejected

030

Response to status inquiry

034

No circuit available

035

Requested VPCI VCI is not available

036

VPCI VCI assignment failure

037

Cell rate is not available

038

Network is out of order

039

Permanent frame mode is out of service

040

Permanent frame mode is operational

041

Temporary failure

042

Switch is congested

043

Access information has been discarded

044

No required circuit

045

No VPCI VCI is available

046

Precedence call blocked

047

No resource available

048

DSP error

049

QoS is not available

050

Facility is not subscribed

053

Outgoing calls barred

055

Incoming calls barred

057

Bearer capability is not authorized

058

Bearer capability is not available

062

Inconsistency in the information and class

063

Service or option not available

065

Bearer capability is not implemented

066

Change type is not implemented

069

Facility is not implemented

070

Restricted digital information only

079

Service is not implemented

081

Invalid call reference value

082

Channel does not exist

083

Call exists and call ID in use

084

Call ID in use

085

No call suspended

086

Call cleared

087

User is not in CUG

088

Incompatible destination

090

CUG does not exist

091

Invalid transit network

093

AAL parameters not supported

095

Invalid message

096

Mandatory Information Element (IE) is missing

097

Message type is not implemented

098

Message type is not compatible

099

IE is not implemented

100

Invalid IE contents

101

Message in incomplete call state

102

Recovery on timer expiration

103

Non-implemented parameter was passed on

110

Unrecognized parameter message discarded

111

Protocol error

127

Internetworking error

128

Next node is unreachable

129

Holst Telephony Service Provider Module (HTSPM) is out of service

160

DTL transit is not my node ID

Related Documentation

http://www.cisco.com/univercd/cc/td/doc/product/access/acs_serv/5300/cfios/cfselfea/0061ivr.htm
http://www.cisco.com/univercd/cc/td/doc/product/software/ios120/120newft/120t/120t3/voip1203.htm
http://www.cisco.com/univercd/cc/td/doc/product/access/nubuvoip/voip5300/index.htm
http://www.cisco.com/univercd/cc/td/doc/product/access/nubuvoip/voip5800/index.htm
http://www.cisco.com/univercd/cc/td/doc/product/access/nubuvoip/voip3600/index.htm
http://www.cisco.com/univercd/cc/td/doc/product/access/acs_serv/5300/iosinfo/ios_mods/0044gw.htm
http://www.cisco.com/univercd/cc/td/doc/product/access/acs_serv/5300/iosinfo/ios_mods/0042gk.htm
http://www.cisco.com/univercd/cc/td/doc/product/access/acs_serv/5300/cfios/cfselfea/0134bowi.htm
http://cco/univercd/cc/td/doc/product/access/acs_serv/vapp_dev/vsaig.htm
http://cco/univercd/cc/td/doc/product/access/acs_serv/vapp_dev/tclivrpg.htm
http://cco/univercd/cc/td/doc/product/software/ios121/121newft/121t/121t3/dt_skyn.htm

Glossary

AAA--Authentication, authorization, and accounting. A suite of network security services that provides the primary framework through which you can set up access control on your Cisco router or access server.

ANI--Automatic number identification. Same as calling party.

API--Application programming interface.

AV-pair--An attribute-value pair used in authentication.

CDR--Call data record.

CLI--Command line interface.

connection--The tying together of two streams or call legs so that the incoming voice stream of one call leg is sent as the outgoing voice stream of the other call leg.

DID--Dial in direct. Calls in which the gateway uses the number that you initially dialed (DNIS) to make the call, as opposed to prompting you to dial additional digits.

DNIS--Dialed number identification service. Same as the called number.

DSP--Digital signaling processor.

DTMF--Dual tone multifrequency. Use of two simultaneous voice-band tones for dialing (such as touch tone).

execution instance--An instance of the TCL interpreter that is created to execute the script.

FSM--Finite State Machine.

gatekeeper--A gatekeeper maintains a registry of devices in the multimedia network. The devices register with the gatekeeper at startup and request admission to a call from the gatekeeper.

The gatekeeper is an H.323 entity on the LAN that provides address translation and control access to the LAN for H.323 terminals and gateways. The gatekeeper can provide other services to the H.323 terminals and gateways, such as bandwidth management and locating gateways.

gateway--A gateway allows H.323 terminals to communicate with non-H.323 terminals by converting protocols. A gateway is the point where a circuit-switched call is encoded and repackaged into IP packets.

An H.323 gateway is an endpoint on the LAN that provides real-time, two-way communications between H.323 terminals on the LAN and other ITU-T terminals in the WAN or to another H.323 gateway.

IFS--Cisco IOS file system.

information-tag--An information identifier used to retrieve and set system variables and information.

ISDN--Integrated Services Digital Network. Communication protocol, offered by telephone companies, that permits telephone networks to carry data, voice, and other source traffic.

IVR--Interactive voice response. When someone dials in, IVR responds with a prompt to get a personal identification number (PIN), and so on.

leg--A control or voice stream to an external endpoint through a telephony, VoIP, VoFR, or other protocol and transport medium.

OSP--Open Settlement Protocol. Protocol used to allow carriers to communicate with third-party settlement servers.

PIN--Personal identification number. Password used with account number for authentication.

POTS--Plain old telephone service. Basic telephone service supplying standard single line telephones, telephone lines, and access to the PSTN.

PSTN--Public Switched Telephone Network. PSTN refers to the local telephone company.

RADIUS--Remote Access Dial-In User Service. Database for authenticating modem and ISDN connections and for tracking connection time.

rotary--The concept of attempting to reach a specific destination by trying one dial peer at a time (if a dial peer match for a destination returns multiple dial peers, meaning multiple routes).

RTSP--Real Time Streaming Protocol.

SPI--Service Provider Interface (such as H.323 SPI, VTSP SPI, and SIP SPI).

TCL--Tool Command Language. TCL is an interpreted script language developed by Dr. John Ousterhout of the University of California, Berkeley, and is now developed and maintained by
Sun Microsystems Laboratories.

Tcl_Eval--An API provided by the TCL interpreter interface to execute a TCL script or procedure.

TTS--Text-to-Speech.

URL--Universal Resource Locator. Standardized addressing scheme for accessing hypertext documents and other services using a browser.

VoFR--Voice over Frame Relay. Voice over Frame Relay enables a router to carry voice traffic (for example, telephone calls and faxes) over a Frame Relay network. When sending voice traffic over Frame Relay, the voice traffic is segmented and encapsulated for transit across the Frame Relay network using FRF.12 encapsulation.

VoIP--Voice over IP. The ability to carry normal telephone-style voice signals over an IP-based network with POTS-like functionality, reliability, and voice quality. VoIP is a blanket term that generally refers to Cisco's open standards-based (for example, H.323) approach to IP voice traffic.


Note For a list of other internetworking terms, see Internetworking Terms and Acronyms document that is available on the Documentation CD-ROM and on the Cisco Connection Online (CCO) at the following URL: http://www.cisco.com/univercd/cc/td/doc/cisintwk/ita/index.htm.

Cisco Connection Online

Cisco Connection Online (CCO) is Cisco Systems' primary, real-time support channel. Maintenance customers and partners can self-register on CCO to obtain additional information and services.

Available 24 hours a day, 7 days a week, CCO provides a wealth of standard and value-added services to Cisco's customers and business partners. CCO services include product information, product documentation, software updates, release notes, technical tips, the Bug Navigator, configuration notes, brochures, descriptions of service offerings, and download access to public and authorized files.

CCO serves a wide variety of users through two interfaces that are updated and enhanced simultaneously: a character-based version and a multimedia version that resides on the World Wide Web (WWW). The character-based CCO supports Zmodem, Kermit, Xmodem, FTP, and Internet e-mail, and it is excellent for quick access to information over lower bandwidths. The WWW version of CCO provides richly formatted documents with photographs, figures, graphics, and video, as well as hyperlinks to related information.

You can access CCO in the following ways:

For a copy of CCO's Frequently Asked Questions (FAQ), contact cco-help@cisco.com. For additional information, contact cco-team@cisco.com.


Note If you are a network administrator and need personal technical assistance with a Cisco product that is under warranty or covered by a maintenance contract, contact Cisco's Technical Assistance Center (TAC) at 800 553-2447, 408 526-7209, or tac@cisco.com. To obtain general information about Cisco Systems, Cisco products, or upgrades, contact 800 553-6387, 408 526-7208, or cs-rep@cisco.com.

Documentation CD-ROM

Cisco documentation and additional literature are available in a CD-ROM package, which ships with your product. The Documentation CD-ROM, a member of the Cisco Connection Family, is updated monthly. Therefore, it might be more current than printed documentation. To order additional copies of the Documentation CD-ROM, contact your local sales representative or call customer service. The CD-ROM package is available as a single package or as an annual subscription. You can also access Cisco documentation on the World Wide Web at http://www.cisco.com, http://www-china.cisco.com, or http://www-europe.cisco.com.

If you are reading Cisco product documentation on the World Wide Web, you can submit comments electronically. Click Feedback in the toolbar and select Documentation. After you complete the form, click Submit to send it to Cisco. We appreciate your comments.





hometocprevnextglossaryfeedbacksearchhelp
Posted: Mon Aug 7 19:25:17 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.