Expression

Overview

The Expression object provides a comprehensive set of expression functions, which can be used to perform arithmetical calculations, string operations, comparison operations, and Boolean operations. In addition there are functions to get access to the dialog context. The expression definition is based on a function and a set of arguments that are specified by constant values or Variable, Collection, Script, Layer, Business Task, or other Expression objects. The result of an Expression object gets dynamically evaluated at call time at the position where it is used within the dialog flow or an object. In a Boolean context the Expression object evaluates to true unless the return value is an empty string, 0 (zero), or FALSE (in any combination of upper and lower case letters).

8     Caution: The list of arguments of an expression function may not have any empty arguments in between, e.g. if a function has four arguments (two fixed plus 2 optional ones) it is not allowed to leave the third argument empty as this will lead to problems while processing the Expression object.

The Object Definition below covers the configuration of the Expression object with VoiceObjects Desktop. For information on how to define this object type using VoiceObjectsXML refer to the VoiceObjectsXML Definition paragraph.

The Expression object belongs to the object category Logic.

Dialog Flow Scenario

The following example shows an Expression object that checks if the caller’s age is below a given value. It is used within an If object that branches the dialog into different flows based on the outcome of the comparison.


Object - Caller

Dialog Flow

How old are you?


Caller

I am sixteen.

 Age<18

THEN:

 Inform caller about age restriction

ELSE:

 Proceed with normal dialog flow

Object Definition

The Definition of the Expression object provides the following sections:

·         Declaration
To declare the function and assign a valid object or a constant for each required argument.

·         Formatting
To define formatting instructions for playback within an Output.



 

For further details regarding additional object configuration refer to Precondition and Properties in this Object Reference.

Declaration

Within the Declaration section, the desired expression function can be selected from the drop-down list in the Function field. In the Argument fields the appropriate arguments can be provided as either constant values, or references to Variable, Collection, Script, Layer, Business Task, or other Expression objects. Each expression function provides a brief explanation of the number and types of arguments it requires or accepts in the grey text field below the Function field.

A special case of argument is a layer condition that can be used for Boolean functions. For details see Conditions in the function library below.

The following example shows the use of the AND function that checks the states of two layers, Time of day and Voice. Only if the layer conditions Time of day=afternoon and Voice!=Female are true does the function return true:


 

For every expression defined, a brief description can be entered in the Description field that explains what the expression does. This description corresponds to the short description for the Expression object (for further information refer to Properties in this Object Reference).

Each expression function requires or accepts a certain number and certain types of arguments (as stated in the grey text field below). Some functions, e.g. addition and subtraction, require a fixed number of arguments. For each of these required arguments, an entry in the corresponding argument field must be provided.


 

Other functions accept optional arguments. For example, the string concatenation accepts between two and six parameters. This means that at least Arg. [1] and Arg. [2] must be filled, but up to six arguments are allowed as in the example shown below.


 

i8    Note: If the evaluation of an Expression object fails, e.g. because a string has been specified in a place where a number is required, resulting errors can be handled within the dialog flow. To do so, specify a dedicated handler for the Error – Internal event within the object in which the Expression object is used. For more information refer to Event Handling in this Object Reference.

Formatting

The Formatting section defines how the result of the Expression object is presented to the caller when it is used within an Output object.


 

Two different categories of formatting types are offered, which are only relevant for the voice and video channel:

·          Text-To-Audio (TTA)
The object content is played back to the caller through the concatenation of prerecorded audio files.

·          Text-To-Speech (TTS)
The object content is played back to the caller through text-to-speech synthesis provided by the media platform.

The formatting instructions can be defined as an embedded definition within the Expression object or can be linked to an autonomous Format object.

To define formatting types for the text and Web channel, use the Formatting bus as described in Appendix B – How to Use the Formatting Bus in the Administration Guide.

For further details on formatting capabilities refer to the Format object in this Object Reference.

Usage Examples

The first example shows an Expression object that adds two numbers provided by Variable objects.


 

The next example sums up the total amounts of items in three categories A, B, and C. The amounts are stored within the three Variable objects Items category A, Items category B, and Items category C.


 

The result of the previous Expression object is used within the next Expression object, which calculates the total sum including tax. The result of the Expression object Sum of items is multiplied by the constant value 1.16 to arrive at the gross total amount. This Expression object could then be used e.g. within an Output object that plays the result to the caller.


VoiceObjectsXML Definition

The Expression object is represented by the VoiceObjectsXML element <expression>. It has one attribute and three groups of children.

In addition, the element has the standard attributes described in the XDK Guide.

The <expression> element uses the embedded <argument> element.

Expression

Attributes

·          function
Defines the expression function. The number of arguments listed as children must match the number of arguments expected by the function specified here.
Legal functions are listed in the Function Library paragraph, and in the DTD or schema.

 

Children

·          <expression usage=”precondition”> or
<variable usage=”precondition”> or
<collection usage=”precondition”> or
<script usage=”precondition”>
Defines the precondition for the Expression object.

·          *<argument>
Lists the arguments for the expression functions; may range from zero to six. The order of the arguments is defined by the order of the children.

·          <format>
Defines the output formatting for the expression result.

 

Example

<expression function=”assign”>

  <argument object=”#MyVariable”/>

  <argument><value> 17 </value></argument>

</expression>

Argument

Attributes

·          object
Object reference as value for the argument. Either this attribute is defined, or the element has a child.
This attribute may also contain a layer state reference of the form “Layer=State” or “Layer!=State” where “State” is the label of a state for the layer “Layer”.

 

Children

·          <variable> or
<collection> or
<expression> or
<script> or
<layer>or
<business task>
Defines an embedded object as argument.

·          <value>
Defines the constant value of the argument. If defined, this value takes precedence over the object attribute.

 

Example

<argument object=”#Compute total sum”/>

<argument><value> 256 </value></argument>

Value

Children

·          CDATA
Embedded value for a Variable object, Collection object, or argument.

 

Example

<value> 42 </value>

Object Interoperability

The Expression object is compatible with any other object type and can be used to dynamically control certain properties or preconditions. The following objects reference Expression objects most frequently:


Icon

Object Name

Use Case Example

Grammar

An Expression object can be used to dynamically create grammar definitions in a Grammar object.

Connector

An Expression object can be used within the parameter set in a Connector object when connecting to an external resource.

Script

An Expression object can be used within the parameter set when processing a Script object.

Database

An Expression object can be used within the SQL statement definition of a Database object.

Plug-In

An Expression object can be used within the parameter set when executing custom VoiceXML code in a Plug-In object.

Log

An Expression object can be used within the log statement definition of a Log object.

Layer

An Expression object can be used within a Layer object to compute the conditions for the layer states.

Expression

An Expression object can be used within other Expression objects to build more complex formulas.

OSDM

An Expression object can be linked within the parameter set of any OSDM object.

Any object with a condition or precondition

An Expression object can be used anywhere as a condition or precondition.

Object Naming Conventions

In order to leverage the capabilities of the integrated documentation of VoiceObjects it is important to provide intuitive and self-explanatory object names and descriptions.

The name of an Expression object should indicate which type of calculation/processing is done inside the object, typically by mentioning the function name and the arguments. The short description should describe in more detail what the expression does and where it is used, and whether the expression just returns a value, or if it assigns some value to a Variable or similar object. The table below lists three examples:


Name

Description

 LASTRESULT (confidence)

Returns the confidence value of the last recognition. Used in module Transfer Money to evaluate quality of recognition result for decision on whether to transfer money or not.

 ISNULL (Counter)

Returns true if variable Counter does not have a value yet.

 LAYER (Persona, female)

Sets the layer Persona to state female.

Function Library

The function library for the Expression object is organized into the following categories:

·          Conditions (e.g. Layer condition)

·          Comparison functions (e.g. greater than or equal)

·          Boolean functions (e.g. AND)

·          Information functions (e.g. ISNULL)

·          Assign functions (e.g. :=)

·          Arithmetic functions (e.g. SQRT)

·          Text functions (e.g. CONCATENATE)

·          Collection functions (e.g. INDEX)

·          Date & Time functions (e.g. NOW)

·          Statistics functions (e.g. LASTRESULT)

·          Business Task functions (e.g. STARTTASK)

·          Dialog Context functions (e.g. SESSION)

·          Miscellaneous functions (e.g. CONDITIONAL)

 

The following tables provide a detailed overview on the available functions and their parameter sets as well as their return values (if any). The functions are sorted by the appropriate function category. An argument list enclosed by normal brackets ( ) indicates a list of mandatory arguments. Square brackets [ ] indicate a list of additional optional arguments.


Conditions

Name and Arguments

Description

Desktop

XML

Layer condition

layercondition (arg)

A special function enabling the use of layer conditions as preconditions for objects. Use this function only within the embedded Expression object available as a precondition for most objects. Select or define a complete layer condition Layer=State or Layer!=State as the function’s only argument. For details on how to link a layer refer to Chapter 6 – Object Editors in the Desktop for Eclipse Guide or Desktop for Web Guide.

Channel condition

channelcondition (arg)

A special function enabling the use of a channel as a precondition for objects. Use this function only within the embedded Expression object available as a precondition for most objects. Returns true if the defined channel is the currently active channel. The argument can be one of voice, video, text, or web. More than one channel can be provided, separated by commas.

Input mode condition

inputmodecondition (arg)

A special function enabling the use of an input mode as a precondition for objects. Use this function only within the embedded Expression object available as a precondition for most objects. Returns true if the defined input mode is the currently active input mode. The argument can be one of voice, dtmf, or voicedtmf. More than one input mode can be provided, separated by commas.

Language condition

languagecondition (arg)

A special function enabling the use of a language as a precondition for objects. Use this function only within the embedded Expression object available as a precondition for most objects. Returns true if the defined language is the currently active language. The argument must be a valid language code, e.g. en-US, de-DE etc. More than one language code can be provided, separated by commas.

Occurrence condition

occurrencecondition (number, ReferenceID)

A special function enabling the use of the occurrence count of an object as a precondition. Use this function only within the embedded Expression object available as a precondition for most objects. Returns true if the current object or the object with the reference ID provided as the optional second argument occurred less than or equal to the number of times specified in the first argument.

 

Comparison Functions

Name and Arguments

Description

Desktop

XML

= (arg1, arg2)

equal (arg1, arg2)

Returns true if argument 1 is equal to argument 2; otherwise returns false.

!= (arg1, arg2)

notequal (arg1, arg2)

Returns true if argument 1 is not equal to argument 2; otherwise returns false.

< (arg1, arg2)

less (arg1, arg2)

Returns true if argument 1 is less than argument 2; otherwise returns false.

<= (arg1, arg2)

lessequal (arg1, arg2)

Returns true if argument 1 is less than or equal to argument 2; otherwise returns false.

> (arg1, arg2)

greater (arg1, arg2)

Returns true if argument 1 is greater than argument 2; otherwise returns false.

>= (arg1, arg2)

greaterequal (arg1, arg2)

Returns true if argument 1 is greater than or equal to argument 2; otherwise returns false.

i8  Note: For all comparison functions, arguments are evaluated as numbers if possible, otherwise as strings. As an example, =(032010, 32010) evaluates to true, as both arguments are first converted to the number 32010.

 

Boolean Functions

Name and Arguments

Description

Desktop

XML

AND (arg1, arg2 [, .., arg6])

and (arg1, arg2 [, .., arg6])

Returns true if all arguments are true; otherwise returns false.

BETWEEN (arg, lowerLimit, upperLimit)

between (arg, lowerLimit, upperLimit)

Returns true if the specified argument is between the lower and upper limit, or equal to the lower or upper limit; otherwise returns false.

CONTAINS (containsTxt, txt, [caseSensitive], [containsTxtIsRegExp])

contains (containsTxt, txt, [caseSensitive], [containsTxtIsRegExp])

Returns true if txt contains containsTxt otherwise returns false. The optional parameter caseSensitive indicates whether the comparison should be case sensitive (true or false; default is false). The optional parameter containsTxtIsRegExp indicates whether containsTxt has to be interpreted as a string or a regular expression (true or false; default is false).

ENDSWITH (endTxt, txt, [caseSensitive], [endTxtIsRegExp])

endswith (endTxt, txt, [caseSensitive], [endTxtIsRegExp])

Returns true if txt ends with endTxt otherwise returns false. The optional parameter caseSensitive indicates whether the comparison should be case sensitive (true or false; default is false). The optional parameter endTxtIsRegExp indicates whether endTxt has to be interpreted as a string or a regular expression (true or false; default is false).

IN (arg, delimitedString, [separator])

in (arg, delimitedString, [separator])

Returns true if the specified argument is within the list of entries provided within the delimited string; otherwise returns false. The default separator is a comma, but a custom separator can optionally be provided as a third argument.

MATCHESREGEXP (txt, regExp, [caseSensitive])

matchesregexp (txt, regExp, [caseSensitive])

Returns true if txt matches the regular expression regExp, otherwise returns false. The optional parameter caseSensitive indicates whether the comparison should be case sensitive (true or false; default is false).

NAND (arg1, arg2 [, .., arg6])

nand (arg1, arg2 [, .., arg6])

Returns true unless all its arguments are true; otherwise returns false. NAND is the logical complement of AND.

NOR (arg1, arg2 [, .., arg6])

nor (arg1, arg2 [, .., arg6])

Returns true if none of its arguments is true; otherwise returns false. NOR is the logical complement of OR.

NOT (arg)

not (arg)

Returns the reversed value of its argument.

NOTBETWEEN (arg, lowerLimit, upperLimit)

notbetween (arg, lowerLimit, upperLimit)

Returns true if the specified argument is not between the lower and upper limit; otherwise returns false.

NOTIN (arg, delimitedString, [separator])

notin (arg, delimitedString, [separator])

Returns true if the specified argument is not within the list of entries provided within the delimited string; otherwise returns false. The default separator is a comma, but a custom separator can optionally be provided as a third argument.

OR (arg1, arg2 [, .., arg6])

or (arg1, arg2 [, .., arg6])

Returns true if any argument is true; otherwise returns false.

STARTSWITH (startTxt, txt, [caseSensitive], [startTxtIsRegExp])

startswith (startTxt, txt, [caseSensitive], [startTxtIsRegExp])

Returns true if txt starts with startTxt otherwise returns false. The optional parameter caseSensitive indicates whether the comparison should be case sensitive (true or false; default is false). The optional parameter startTxtIsRegExp indicates whether startTxt has to be interpreted as a string or a regular expression (true or false; default is false).

STREQUALS (txt1, txt2, [caseSensitive])

strequals (txt1, txt2, [caseSensitive])

Returns true if txt1 and txt2 are identical otherwise returns false. The optional parameter caseSensitive indicates whether the comparison should be case sensitive (true or false; default is false).

XOR

xor (arg1, arg2 [, .., arg6])

Returns true if exactly one argument is true; otherwise returns false. XOR (arg1, arg2
[, ..., arg6]) stands for exclusive OR (arg1, arg2 [, ..., arg6]).

i8  Note: Boolean functions do not allow Layer objects as arguments.

 

Information Functions

Name and Arguments

Description

Desktop

XML

ISAFTER (date1, date2)

isafter (date1, date2)

Returns true if date1 occurs chronologically after date2 otherwise returns false. The parameters date1 and date2 must be specified in the format yyyyMMdd or yyyyMMddhhmmss.

ISBEFORE (date1, date2)

isbefore (date1, date2)

Returns true if date1 occurs chronologically before date2 otherwise returns false. The parameters date1 and date2 must be specified in the format yyyyMMdd or yyyyMMddhhmmss.

ISLOGGINGACTIVE (loggingType)

Isloggingactive (loggingType)

Returns true if the specified loggingType is activated for this call; otherwise returns false. Valid loggingType values are system, custom, inputState, utteranceRecording, all, none as well as comma-separated lists thereof.

ISLOGICAL (arg)

islogical (arg)

Returns true if the specified argument is a logical value (true or false, regardless of capitalization); otherwise returns false.

ISNOTNULL (arg)

isnotnull (arg)

Returns true if the specified argument is defined; otherwise returns false.

ISNULL (arg)

isnull (arg)

Returns true if the specified argument is undefined or empty; otherwise returns false.

ISNUMBER (arg)

isnumber (arg)

Returns true if the specified argument is a number; otherwise returns false.

ISTEXT (arg)

istext (arg)

Returns true if the specified argument is a text; otherwise returns false. A number is not interpreted as text, thus ISTEXT(5) returns false.

ISVALIDDATE (date)

isvaliddate (date)

Returns true if date is a valid date otherwise returns false. The parameter date must be specified in the format yyyyMMdd or yyyyMMddhhmmss.

 

Assign Functions

Name and Arguments

Description

Desktop

XML

:= (variable, arg)

assign (variable, arg)

Assigns the value of the specified argument to the Variable or Collection object.

:= (variable, collection, rowIdx, columnIdx)

assign (variable, collection, rowIdx, columnIdx)

Assigns the Collection object entry at row rowIdx (a numerical value >= 1) and column columnIdx (a numerical or textual value) to the Variable object.

:= (collection, rowIdx, columnIdx, arg)

assign (collection, rowIdx, columnIdx, arg)

Assigns the value of the argument to the Collection object entry at row rowIdx (a numerical value >= 1) and column columnIdx (a numerical or textual value).

:= (collection1, rowIdx1, columnIdx1, collection2, rowIdx2, columnIdx2)

assign (collection1, rowIdx1, columnIdx1, collection2, rowIdx2, columnIdx2)

Assigns the Collection object entry in collection2 at row rowIdx2 (a numerical value >= 1) and column columnIdx2 (a numerical or textual value) to the Collection object entry in collection1 at row rowIdx1 (a numerical value >= 1) and column columnIdx1 (a numerical or textual value).

CONDASSIGN (var, cond, truevalue, falsevalue)

condassign (var, cond, truevale, falsevalue)

If cond is true, assigns truevalue to the var object. Otherwise, assigns falsevalue. cond can be a Variable, Expression, Script, or Collection object, or a layer condition. var can be a Variable, Layer, or Collection object.

 

Arithmetic Functions

Name and Arguments

Description

Desktop

XML

* (nbr1, nbr2)

multiply (nbr1, nbr2)

Returns the result of multiplying number 1 by number 2. Both arguments must be numbers.

*:= (variable, nbr)

multiplyassign (variable, nbr)

Multiplies the variable value by the specified number and assigns the result to the variable.
Both the variable value and the second argument must be numbers.

+ (nbr1, nbr2)

plus (nbr1, nbr2)

Returns the result of adding number 1 to number 2.
Both arguments must be numbers.

+:= (variable, nbr)

plusassign (variable, nbr)

Adds the specified number to the variable value and assigns the result to the variable.
Both the variable value and the second argument must be numbers.

- (nbr1, nbr2)

minus (nbr1, nbr2)

Returns the result of subtracting number 2 from number 1. Both arguments must be numbers.

-:= (variable, nbr)

minusassign (variable, nbr)

Subtracts the specified number from the variable value and assigns the result to the variable.
Both the variable value and the second argument must be numbers.

/ (nbr1, nbr2)

divide (nbr1, nbr2)

Returns the result of dividing number 1 by number 2. Both arguments must be numbers, and number 2 must not be zero.

/:= (variable, nbr)

divideassign (variable, nbr)

Divides the variable value by the specified number and assigns the result to the variable.
Both the variable value and the second argument must be numbers. In addition, the second argument must not be zero.

ABS (nbr)

abs (nbr)

Returns the absolute value of the specified number. The absolute value of a number is the number without its sign.

AVG (nbr1, nbr2 [, ..., nbr6])

avg (nbr1, nbr2 [, ..., nbr6])

Returns the average of all specified arguments.

CEILING (nbr)

ceiling (nbr)

Returns a number rounded up, away from zero (0).

EXP (nbr)

exp (nbr)

Returns “e” raised to the power of the specified number. The constant “e” equals 2.71828182845904, the base of the natural logarithm.

FLOOR (nbr)

floor (nbr)

Returns a number rounded down, toward zero (0).

LN (nbr)

ln (nbr)

Returns the natural logarithm of the specified number. Natural logarithms are based on the constant “e” (2.71828182845904). The specified number must be positive.

MAX (nbr1, nbr2 [, ..., nbr6])

max (nbr1, nbr2 [, ..., nbr6])

Returns the maximum of all specified arguments.

MIN (nbr1, nbr2 [, ..., nbr6])

min (nbr1, nbr2 [, ..., nbr6])

Returns the minimum of all specified arguments.

MOD (nbr, divisor)

mod (nbr, divisor)

Returns the remainder after the specified number is divided by the divisor. The result has the same sign as the divisor.

POWER (nbr, power)

power (nbr, power)

Returns the value of the specified number to the power specified by the second argument.

RAND( )

rand ( )

Returns a Float random number between 0 (inclusive) and 1 (exclusive).

RANDINT(start, end)

randint (start, end)

Returns a random Integer value between start (inclusive) and end (exclusive). Both arguments start and end must be Integer values, and end must be greater than start.

ROUND (nbr, nbrDigits)

round (nbr, nbrDigits)

Returns the result of rounding the specified number to at most nbrDigits decimal digits.

SIGN (nbr)

sign (nbr)

Returns the sign of the specified number. Returns 1 if the number is positive, zero (0) if the number is 0, and -1 if the number is negative.

SQRT (nbr)

sqrt (nbr)

Returns the square root of the specified number. The number must be positive or zero (0).

SUM (nbr1, nbr2 [, ..., nbr6])

sum (nbr1, nbr2 [, ..., nbr6])

Returns the sum of all arguments (at least two). All arguments must contain numbers.

TRUNC (nbr, nbrDigits)

trunc (nbr, nbrDigits)

Returns the result of truncating the specified number to at most nbrDigits decimal digits.

 

Text Functions

Name and Arguments

Description

Desktop

XML

APPEND (variable, txt1 [, …, txt5])

append (variable, txt1 [, …, txt5])

Appends all provided strings txt1 to txt5 to the value of the specified variable.

CONCATENATE (txt1, txt2 [,…, txt6])

concatenate (txt1, txt2 [,…, txt6])

Returns the concatenation of all specified strings (at least two).

COUNTOCCURRENCES (countTxt, txt, [caseSensitive], [countTxtIsRegExp]) -

countoccurrences  (countTxt, txt, [caseSensitive], [countTxtIsRegExp]) -

Returns the number of occurrences of countTxt in txt. If countTxt is not found in txt 0 will be returned. The optional parameter caseSensitive indicates whether the comparison should be case sensitive (true or false; default is false). The optional parameter countTxtIsRegExp indicates whether countTxt has to be interpreted as a regular expression (true or false; default is false).

FIND (findTxt, txt, startPos)

find (findTxt, txt, startPos)

Returns the index at which findTxt was found within txt, starting the search at position startPos (where the first character is position 1). If findTxt could not be found, 0 (zero) is returned.

INSERT (oldTxt, startPos, newTxt)

insert (oldTxt, startPos, newTxt)

Returns a modified version of the string oldTxt in which the string newTxt has been inserted, starting at position startPos.

LEFT (txt, nbrChars)

left (txt, nbrChars)

Returns the first nbrChars of txt. If nbrChars is equal to or greater than the length of txt the complete string is returned. If nbrChars is 0 or negative the empty string is returned.

LEN (txt)

len (txt)

Returns the length of the specified string txt (number of characters).

LOWER (txt)

lower (txt)

Returns a new string in which all uppercase letters of the specified string txt are converted to lowercase.

LTRIM (txt, [char])

ltrim (txt, [char])

Returns a modified version of the string txt in which white space characters (blanks and tabs only) are removed at the left end. Optionally a char can be specified which will be removed instead of white space characters.

MASKXML (string)

maskxml (string)

Returns a string in which all occurrences of XML-related characters (<, >, ', ", &) are replaced with their corresponding entities.

MID (txt, startPos, nbrChars)

mid (txt, startPos, nbrChars)

Returns a substring for the specified string txt, starting at position startPos for the specified number of characters.

PREFIX (txt, separator, [separatorIsRegExp])

prefix (txt, separator, [separatorIsRegExp])

Returns the part of txt preceding the first occurrence of separator. If separator could not be found within txt the empty string is returned. The optional parameter separatorIsRegExp indicates whether separator has to be interpreted as a regular expression (true or false; default is false).

REPLACE (oldTxt, startPos, nbrChars, newTxt)

replace (oldTxt, startPos, nbrChars, newTxt)

Returns a modified version of the string oldTxt in which the substring starting at position startPos containing nbrChars characters has been replaced by the string newTxt.
Example: replace(hello, 3, 2, r) = hero

RIGHT (txt, nbrChars)

right (txt, nbrChars)

Returns the last nbrChars of txt. If nbrChars is equal to or greater than the length of txt the complete string is returned. If nbrChars is 0 or negative the empty string is returned.

RTRIM (txt, [char])

rtrim (txt, [char])

Returns a modified version of the string txt in which white space characters (blanks and tabs only) are removed at the right end. Optionally a [char]can be specified which will be removed instead of white space characters.

SPLIT (txt, separator, [separatorIsRegExp])

split (txt, separator, [separatorIsRegExp])

Splits txt around matches of separator, fills the result into a collection and returns this collection. If no matches could be found an empty collection is returned. The optional parameter separatorIsRegExp indicates whether separator has to be interpreted as a regular expression (true or false; default is true).

STRCOMPARE (txt1, txt2, [caseSensitive])

strcompare (txt1, txt2, [caseSensitive])

Compares txt1 and txt2 lexicographically and returns 0 if the strings are equal, -1 if txt1 is lexicographically less than txt2 and 2 if txt1 is lexicographically greater than txt2. The optional parameter caseSensitive indicates whether the comparison should be case sensitive (true or false; default is false).

SUBSTITUTE (string, pattern, replacement, [patternIsRegExp])

substitute (string, pattern, replacement, [patternIsRegExp])

Returns a string in which all occurrences of the pattern are substituted by the replacement string. The original string is provided as first argument and will not be modified. The optional parameter patternIsRegExp indicates whether pattern has to be interpreted as a regular expression (true or false; default is true).

SUFFIX (txt, separator, [separatorIsRegExp])

suffix (txt, separator, [separatorIsRegExp])

Returns the part of txt following the last occurrence of separator. If separator could not be found within txt the empty string is returned. The optional parameter separatorIsRegExp indicates whether separator has to be interpreted as a regular expression (true or false; default is false).

TRIM (txt, [char])

trim (txt, [char])

Returns a modified version of the string txt in which white space characters (blanks and tabs only) are removed at the left and right end. Optionally a [char]can be specified which will be removed at both ends instead of white space characters.

UNMASKXML (string)

unmaskxml (string)

Returns a string in which all occurrences of XML-related entities are replaced with their corresponding characters (<, >, ', ", &).

UPPER (txt)

upper (txt)

Returns a new string in which all lowercase letters of the specified string txt are converted to uppercase.

XPATH (XML string, path, [returnAsCollection])

xpath (XML string, path, [returnAsCollection])

Returns the result of evaluating the XPath expression provided in the second argument on the XML string provided in the first argument. The string can be static, or a reference to a Variable, Collection, Expression, Script, or Layer object. The optional third argument indicates whether the result is returned as a string or as a collection (true or false; default is false).

Examples:

XML string:

<root>
  <row>
    <col name="title">Harry Potter</col>
    <col name="price">29.99</col>
  </row>
  <row>
   <col name="title">Lord of the Rings</col>
   <col name="price">35.00</col>
 </row>
</root>

Path: /root/row/*
Return value:
Harry Potter 29.99 Lord of the
Rings 35.00

Path: @name
Return value: title price title price

 

Collection Functions

Name and Arguments

Description

Desktop

XML

ADDCOLUMN (destCollection, destColumn, srcCollection, srcColumn)

addcolumn (destCollection, destColumn, srcCollection, srcColumn)

Adds a new column with name destColumn into the Collection object destCollection. The content is copied from the column with name srcColumn in Collection object srcCollection.
Source and destination collection need to have the same number of rows.

ADDROW (destCollection, srcCollection, srcRow)

addrow (destCollection, srcCollection, srcRow)

Adds a new row at the bottom of the Collection object destCollection. The content is copied from row number srcRow in the Collection object srcCollection.
Source and destination collection need to have the same set of columns.

CLEAR (collection)

clear (collection)

Clears the specified Collection object. Afterwards, the collection is empty.

COLUMNNAMES (resultCollection, collection)

columnnames (resultCollection, collection)

Fills the Collection object resultCollection with the list of column names present in the second Collection object (one name per row in the column named column).

COLUMNS (collection)

columns (collection)

Returns the number of columns in the specified Collection object.

DELETECOLUMN (collection, columnIdx)

deletecolumn (collection, columnIdx)

Deletes the column with name columnIdx from the specified Collection object.

DELETEROW (collection, rowIdx)

deleterow (collection, rowIdx)

Deletes the row with index rowIdx from the specified Collection object. If the row is not the last one, all rows below the deleted row move up one index position.

FINDCELL (collection, searchColName, searchValue, targetColName, [startRow], [caseSensitiveExactMatch])

findcell (collection, searchColName, searchValue, targetColName, [startRow], [caseSensitiveExactMatch])

Returns the value of the column targetColName if the column searchColName of the same row has the value searchValue. If no such row could be found the empty string is returned. Optionally you can specify a startRow to start the search in. If startRow is less than 1 or higher than the total number of rows, the search starts at the beginning. The optional parameter caseSensitiveExactMatch indicates whether the value comparison should be case sensitive and/or must match exactly (none, both, caseSensitive, exactMatch; default is exactMatch).

FINDROW (collection, colName, searchValue, [startRow], [caseSensitive],
[exactMatch])

findrow (collection, colName, searchValue, [startRow], [caseSensitive],
[exactMatch])

Returns the row number of the first row within the specified collection that contains the searchValue in the column colName. If no row could be found, “0” is returned. Optionally you can specify a startRow to start the search in. If startRow is below 1 or above the total number of rows, the search starts at the beginning. The optional parameter caseSensitive indicates whether the value comparison should be case sensitive (true or false; default is false). The optional parameter exactMatch defines if the searchValue must match exactly to colName (true or false; default is true).

INDEX (collection, rowIdx, columnIdx)

index (collection, rowIdx, columnIdx)

Returns the value of the specified collection at row number rowIdx and column with name columnIdx. If either the row or the column do not exist within the collection, an error is thrown that can be handled by defining an event handler for Error – Internal in Event Handling.

REPLACECOLUMN (destCollection, destColumnIdx, srcCollection, srcColumnIdx)

replacecolumn (destCollection, destColumnIdx, srcCollection, srcColumnIdx)

Replaces the column with name destColumnIdx in the Collection object destCollection. The content is copied from the column with name srcColumn in Collection object srcCollection.
Source and destination collection need to have the same number of rows.

REPLACEROW (destCollection, destRowIdx, srcCollection, srcRowIdx)

replacerow (destCollection, destRowIdx, srcCollection, srcRowIdx)

Replaces row number destRowIdx in the Collection object destCollection. The content is copied from row number srcRowIdx in the Collection object srcCollection.
Source and destination collection need to have the same set of columns (column names need to be the same).

ROWS (collection)

rows (collection)

Returns the number of rows in the specified Collection object.

SORTROWS (collection, columnIdx, direction)

sortrows (collection, columnIdx, direction)

Sorts the rows in the specified collection according to the values in the column with name columnIdx. If the values in the specified column are all numerical, the sorting uses numerical comparison; otherwise the sorting is alphabetical.
Direction can be either asc to sort ascending or desc to sort descending.

VALUESUBSTITUTION (collection, txt, [languageCode])

valuesubstitution (collection, txt, [languageCode])

Searches in the column key within collection for the value txt. If an exact match is found, the return value is taken from the column whose name matches the current locale of the call (e.g. en-US or de-DE), if no such column exists for the same row, the value of the column with name "default" is returned. If this column does not exist for this row either, txt is returned unchanged. The optional parameter languageCode can be used to explicitly define the language code to search for (e.g. en-US or de-DE; default is the language code of the current call).

i8  Note: For functions to be used for modifying values of a collection refer to the Assign Functions section above.


 

Date & Time Functions

Name and Arguments

Description

Desktop

XML

ADDDATE (date, increment, [unit])

adddate (date, increment, [unit])

Adds increment to date and returns the new date in the format yyyyMMddhhmmss. The parameter date must be specified in the format yyyyMMdd or yyyyMMddhhmmss. If increment is less than 0, date is decreased accordingly. The optional parameter unit can be used to define the unit of increment as one of years, months, days, hours, minutes, seconds (default is days).

CONVERTDATE (txt, outputFormat, [inputFormat], [languageCode])

convertdate (txt, outputFormat, [inputFormat], [languageCode])

If txt is a date in the format yyyyMMdd or yyyyMMddHHmmss this returns the date in the specified outputFormat using the Java SimpleDateFormat convention. If txt is a date following a custom format the optional parameter inputFormat must be used to specify the format syntax in order to enable the correct conversion (e.g. if txt contains "23102008" the inputFormat should be set to "ddMMyyyy"). The optional parameter languageCode can be used to define the language code based on which the regional setting is determined (e.g. en-US or de-DE; default is the language code of the current call). This information will be used to localize the returned date format if necessary, e.g. if the call is processed in en-US a date may contain the abbreviation AD, when switching the language code to de-DE this would be changed to n.Chr.

LASTDAYINMONTH (date)

lastdayinmonth (date)

Returns the last day in the month represented by date in the format yyyyMMddhhmmss. The parameter date must be specified in the format yyyyMMdd or yyyyMMddhhmmss.

NEXTWEEKDAY (date, weekday, [languageCode])

nextweekday  (date, weekday, [languageCode])

Returns the date of the next weekday, which is represented by an integer from 1 (first day in week) to 7 (last day in week), in the format yyyyMMddhhmmss starting from date. The parameter date must be specified in the format yyyyMMdd or yyyyMMddhhmmss. Depending on the regional setting this may differ as the week in Europe typically starts with Monday, whereas the US week starts with Sunday. The optional parameter languageCode can be used to define the language code based on which the regional setting is determined (e.g. n-US or de-DE; default is the language code of the current call).

NOW ([format], [offsetToUTC])

now ([format], [offsetToUTC])

Returns the current timestamp in the specified format using the Java SimpleDateFormat convention. Sample formats and return values are:

yyyy.MM.dd G 'at' HH:mm:ss z
2001.07.04 AD at 12:08:56 PDT

EEE, MMM d,''yy
Wed, Jul 4,'01

h:mm a
12:08 PM

hh 'o''clock' a, zzzz
12 o'clock PM, Pacific Daylight Time

K:mm a, z
0:08 PM, PDT

yyyyy.MMMMM.dd GGG hh:mm aaa
02001.July.04 AD 12:08 PM

EEE, d MMM yyyy HH:mm:ss Z
Wed, 4 Jul 2001 12:08:56 -0700

YyMMddHHmmssZ
010704120856-0700

If no format is specified, the default format yyyyMMddHHmmss is used.

The optional second parameter offsetToUTC can be used to switch to a different time zone when interpreting the format parameter. The offset must be provided in the format [-]HHMM.

A detailed definition can be found at: http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html

TIMEBETWEEN (date1, date2, [unit])

timebetween  (date1, date2, [unit])

Returns the number of days between date1 and date2. The parameters date1 and date2 must be specified in the format yyyyMMdd or yyyyMMddhhmmss. The optional parameter unit can be used to define the unit as one of years, months, days, hours, minutes, seconds (default is days). The calculation ignores everything below unit (e.g. if unit is set to hours, minutes and seconds of date1 and date2 will be ignored).

TIMER (option)

timer (option)

Provides a stopwatch functionality. When called with argument start it resets the timer. When called with argument interval it returns the time difference between now and the last start or interval request (in milliseconds).

TIMEZONEINFO ()

timezoneinfo ()

Returns a collection with four columns. The first column Offset shows the offset in hours to add to UTC to get local time (e.g. "-0500" or "0230"). The second column StandardName contains the standard name of the local timezone (e.g. PST or CET). The third column DaylightName shows the daylight name of the local time zone (e.g. PDST or CEDT). The fourth column DSTInEffect indicates whether the local time is Daylight Saving Time or not (true, false or unknown).

WEEKDAY (date, [languageCode])

weekday (date, [languageCode])

Returns the weekday of date represented by an integer from 1 (first day in week) to 7 (last day in week). The parameter date must be specified in the format yyyyMMdd or yyyyMMddhhmmss. Depending on the regional setting this may differ as the week in Europe typically starts with Monday, whereas the US week starts with Sunday. The optional parameter languageCode can be used to define the language based on which the regional setting is determined (e.g. en-US or de-DE; default is the language code of the current call).

 

Statistics Functions

Name and Arguments

Description

Desktop

XML

LASTTRANSITION (value)

lasttransition (value)

Returns the mode (for value = mode) or type (for value = type) of the most recent dialog transition. Possible modes are Standard Navigation, Auto Advance, Recognition, Hyperlink, Hangup, and Error. The type holds more fine-grained information on how the caller left the last input state.

LASTRESULT (type, [index], [phase])

lastresult (type, [index], [phase])

Returns information on the most recent recognition result, as well as information on results from recordings and transfers. The first argument can be confidence, interpretation, length, recordingpath, or recordingurl (for recognition results), inputmode (for recognition results or transfers), utterance (for recognition results, transfers, and recordings), markname or marktime (for prompt markers and barge-in point detection), size or maxtime (for recordings), duration (for recordings and transfers), transferstatus (for transfers), and validation (for recognition results with server-side input validation, using the regex: … :regex syntax for TTG grammars in the text and web channels).
For recognition results, if the recognizer returns more than one result, the optional second argument can be used to specify the desired result. Index must then be a number between 1 and Max N-Best (a
tuning property). If index is greater than the maximum number of results, the function returns an empty string. The type length returns the number of results. The third argument can be used to distinguish between the collection (the default) and confirmation phase in OSDM objects. If it is set, the second argument must also be defined.
Markname returns the name of the last prompt marker processed (a <
mark> statement in an Output item). Marktime returns the time elapsed since the last marker was processed.
For more information on the recording and transfer related types, see the
Recording and Transfer object documentation.
Recordingpath returns the path and recordingurl returns the URL of the last recorded utterance, in case utterance recording was enabled.
Validation returns a comma-separated list of all slot names for which input validation (against the regular expression for that slot) failed. When called with a slot name as the second argument, the return value is true if validation was successful, false if it failed.

EVENTLIST (scope, [phase])

eventlist (scope)

Returns a comma-separated list of events, which have occurred either in the most recent input state (scope = local) or in the entire dialog (scope = global). The second argument allows distinguishing between the collection and confirmation phase of OSDM objects. The default value is global, covering both phases.

EVENTCOUNTER (event, [scope], [phase])

eventcounter (event, [scope])

Returns the number of times the specified event has occurred during the most recent input state (scope = local) or during the entire dialog (scope = global). If the scope is not defined, it defaults to global. The third argument allows distinguishing between the collection and confirmation phase of OSDM objects. The default value is global, covering both phases.
Example: eventCounter(nomatch) will return the number of No Match events that have been triggered in the current dialog. For more information on the different events, refer to
Event Handling in this Object Reference.

 

Business Task Functions

Name and Arguments

Description

Desktop

XML

STARTTASK (task)

starttask (task)

Starts the business task that is specified in the first argument.

FINISHTASK (task, status)

finishtask (task, status, clearNavigationHistory)

Finishes the business task that is specified in the first argument with the status specified in the second argument. This can be one of backEndError, businessLogic, callerAbort, recognitionFailure, technicalError, or complete. Optionally, the first argument can be all to finish all tasks or active to finish the currently active task. All values are case-sensitive. The optional parameter clearNavigationHistory defines if the navigation history should be reset or not (true or false; default is false).

TASKREFID ()

taskrefid ()

Returns the reference ID of the currently active business task. If no task is active an empty string is returned.

TASKSTATUS (task)

taskstatus (task)

Returns the most recent status of the business task specified in the first argument. If the task has not been finished yet, it returns active or inactive. If the task has never been started, it returns notStarted.

 

Dialog Context Functions

Name and Arguments

Description

Desktop

XML

ACTIVATEEVENT(event, [return])

activateevent (event, [return])

Activates a custom event. The obligatory first argument is the name of the event to be activated. A corresponding handler must be defined in a Module object. Note that occurrence settings are ignored. The optional second argument defines if processing will continue after the Expression object (true), or not (false). If not defined, defaults to true. For more information on the event types, refer to Event Handling in this Object Reference.

APPLYCONFIGURATION (configurationXML)

applyconfiguration (configurationXML)

Applies the assignments defined in configurationXML. The XML format used is the same as for application defaults. For further details refer to Application Defaults in Chapter 4 – Service Deployment in the Deployment Guide.

BARGEIN ([arg])

bargein ([arg])

When used without an argument, indicates whether barge-in is activated by default (true) or not (false). When used with an argument (either true or false), it sets the default barge-in behavior.

CALLID ( )

callid ( )

Returns the unique ID of the call as a string of 40 characters.

CHANNEL ( )

channel ( )

Returns the code of the channel (voice, video, text, Web) currently used for this service.

CLEARNAVIGATIONHISTORY ()

clearnavigation
history
()

Clears the standard navigation history.

DATABASETYPE ( )

databasetype ( )

Returns the type of the database used as VoiceObjects Custom DB logging repository, e.g. Oracle or SQLServer.

DATABASEURL ( )

databaseurl ( )

Returns the URL that is required to connect to the VoiceObjects Custom DB logging repository.

DIALOGID ( )

dialogid ( )

Returns the unique ID of the dialog as a string of 44 characters.

DIALOGSTEPID ()

dialogstepid ()

Returns the index of the current input state in the dialog, starting with 0. Before the first caller interaction, it returns -1. When Infostore logging on input state level is enabled, the return value matches the entry of column VOLDDSSEQ.DS_STEP for the most recently processed input state.

DRIVER ( )

driver ( )

Returns a string that represents the media platform driver information of the corresponding service (e.g. Nuance_VWS_2_0_VXML_2_0 or IBM_WVS_2_0_VXML_1_0).

DRIVERID ()

driverid ()

Returns the ID of the media platform driver of the corresponding service.

DRIVERASRENGINE ( )

driverasrengine ( )

Returns a string that represents the name of the ASR engine (e.g. Nuance or IBM).

DRIVERPRODUCT
NAME
( )

driverproductname
( )

Returns a string that represents the media platform product name of the corresponding service (e.g. VWS or OCSW).

DRIVERPRODUCT
VERSION
()

driverproductversion ()

Returns a string that represents the media platform product version of the corresponding service (e.g. 1.2 or 2.0).

DRIVERVENDOR
NAME
()

drivervendorname ()

Returns a string that represents the media platform vendor name of the corresponding service (e.g. Nuance or IBM).

DRIVERVXML
VERSION
( )

drivervxmlversion ( )

Returns a string that represents the VoiceXML version of the corresponding service (e.g. 1.0 or 2.0).

ERRORCODE ( )

errorcode ( )

Returns the error code of the most recently processed Connector item, or zero.

ERRORMESSAGE
( )

errormessage ( )

Returns the error message of the most recently processed Connector item, or the empty string.

EXITEVENT ( )

exitevent ( )

Returns a string providing the corresponding exit event ending the dialog. Valid return values are: None, Timeout, Exception, EndOfDialog, CallerHangup, CallerExit, and Transfer.
For information on how to exploit this function in dialog end processing, refer to the
Module object in this Object Reference.

GRAMMARCONTROL ([arg])

grammarcontrol ([arg])

When used without an argument, indicates whether grammar-driven application control is activated by default (true) or not (false). When used with an argument (either true or false), it sets the default grammar control behavior.

GRAMMARTYPE ([type])

grammartype ([type])

When used without an argument, returns the code of the currently active grammar type (one of gsl, jsgf, sgrs_xml, precompiled, regex, abnf, none). When used with an argument, it sets the currently active grammar type to this value. The argument must be one of the grammar type codes listed above. Note that the underlying media platform must be configured appropriately to support the grammar type that is being set.

INIT (arg)

init (arg)

Resets a variable or collection to its initial value, which was determined when it was first used. Note: If the initial value is not specified, the variable or collection is not reset to an empty string, but to the first value it received during the current call.

INPUTMODE ([mode])

inputmode ([mode])

When used without an argument, returns the code of the currently active input mode (voice, dtmf, or voicedtmf). When used with an argument, it sets the currently active input mode to this value.

ITERATE (counter, from, to, expression)

îterate (counter, from, to, expression)

Iterates counter from from to to and processes expression in each iteration. Counter must be a reference to a Variable object, which can then be read out within expression for further actions. From and to must be integer numbers. Counter will run through the values from, from+1, to.

LANGUAGE ([languageCode])

language ([languageCode])

When used without an argument, returns the code of the currently active language (e.g. en-US or de-DE). When used with an argument, it sets the currently active language to this value. Note that the underlying media platform must be configured appropriately to support the language that is being set.
Refer to Appendix A -
Language Codes in this Object Reference for a list of all currently supported language codes.

LAYER (layer, [state])

layer (layer, [state])

When used without a second argument, returns the comma-separated list of active states for the specified layer. When used with a second argument, it sets the active state of the layer to this value. The value must be one of the defined states of the layer. Only manual layers can be set in this way. There are three special values for the second argument: ACTIVE returns the comma-separated list of currently active states for the layer; INACTIVE returns the comma-separated list of currently inactive states; ALL returns the comma-separated list of all states.

MASTERDIALOGID
( )

masterdialogid ( )

Returns the unique master dialog ID of the session as a string of 44 characters. The master dialog ID is used when chaining services. If the current service is not part of a chain, this ID is the same as the dialog ID.

MD5SUM (txt)

md5sum (txt)

Returns the 128 bit MD5 hash of txt as a sequence of 32 hexadecimal digits. Hashing is performed according to RFC 1321, e.g. supplying the string VoiceObjects will result in the following hash value: 31414f01914a0366ef9f247bb2eaa9f5.

MODULEHISTORY ([level])

modulehistory ([level])

Returns a comma-separated list of reference IDs of Module objects visited so far in the current dialog. When used without an argument the entire list of all visited Module objects will be returned, with the most current Module object at the top of the list. When used with an argument the value of the argument defines how far to go back in the processing history specifying where to start the list (e.g. level = 1 means that the list starts with the previously processed Module object instead of the current one). If the specified level exceeds the size of the processing history an empty string is returned. Note: Only Module objects with the option Enable history tracking set to true are considered.

MODULEREFID ([level])

modulerefid ([level])

Returns the reference ID of a Module object processed in the current dialog. When used without an argument the reference ID of the currently processed Module object is returned. When used with an argument ([level]) the reference ID of a parent object of the currently processed Module object is returned. The value of the argument specifies how far to go up in the tree of parent modules (e.g. level = 1 means that the reference ID of the first parent of the currently processed Module object is returned). If the specified level exceeds the depth of the module tree an empty string is returned.

MODULESET ([level])

moduleset ([level])

Returns a comma-separated list of reference IDs of Module objects processed so far in the current dialog. The list is sorted alphabetically, and each module only occurs once. When used without an argument the entire list will be returned. When used with an argument the value of the argument defines how far to go back in the processing history specifying where to start the list (e.g. level = 1 means that the list starts with the previous Module object instead of the current one). If the specified level exceeds the size of the processing history an empty string is returned. Note: Only Module objects with the option Enable history tracking set to true are considered.

NOTIFICATION (message)

notification (message)

Sends a notification with a predefined ID (1.3.6.1.4.1.24140.1.2.5.8.1) and the specified message.

OUTPUTMODE ([mode])

outputmode ([mode])

When used without an argument, returns the code of the currently active output mode (audio:tts or tts:audio). When used with an argument, it sets the currently active output mode to this value.

PROCESSFORMATTING (object)

processformatting (object)

Processes the formatting of object and returns a collection of TTA-XML (also in case one of the standard format types has been selected). The generated markup code can be retrieved by extracting the value of the column markup. Object can be a reference to a Variable, Collection, Expression, Script, or Layer object.

PROJECTINFO (mode)

projectinfo (mode)

Provides information on the project that contains the start object of the current service. For mode project, it returns the name of the project. For mode version, it returns the name of the project version.

PRONUNCIATION (var)

pronunciation (var)

Returns the pronunciation pattern associated with the variable provided as first argument.

REFRESH (arg)

refresh (arg)

Re-evaluates the initial value of a variable or collection in the current dialog context. For a static initial value, this is the same as INIT(). Note: If the initial value is not specified, the variable or collection is not reset to an empty string, but to the first value it received during the current call.

RECORDINGSCOPE ([value])

recordingscope ([value])

When used without an argument, returns the current value of the corresponding dialog context setting (nomatch, recognition, or all). When used with an argument, it sets the recording scope dialog context setting.

RECORDUTTERANCES ([value])

recordutterances ([value])

When used without an argument, returns the current value of the corresponding dialog context setting (true or false). When used with an argument, it sets the record utterances dialog context setting.

RESETVISITCOUNTER (referenceID)

resetvisitcounter (referenceID)

Resets the visit counter for the object with the specified reference ID. When all is given as argument, the visit counters for all objects are reset.

SERVERCONTEXT
MAPPINGURL
( )

servercontext
mappingurl
( )

Returns the complete URL string for the context mapping of the corresponding server instance (e.g. http://localhost:8099/VoiceObjects/).

SERVERHOST
NAME
( )

serverhostname ( )

Returns the host name of the corresponding server instance.

SERVERINSTANCENAME ()

serverinstancename ()

Returns the name of the corresponding server instance.

SERVERIP ([servletEngine])

serverip ([servletEngine])

Returns the IP address of the corresponding server instance. If the optional parameter servletEngine is set to true (the default), the address is retrieved from the servlet engine. If it is false, it is retrieved from the server configuration.

SERVERNAME ( )

servername ( )

Returns the logical name of the corresponding VoiceObjects server.

SERVERPORT ([servletEngine])

serverport ([servletEngine])

Returns the port of the corresponding server instance. If the optional parameter servletEngine is set to true (the default), the port is retrieved from the servlet engine. If it is false, it is retrieved from the server configuration.

SERVERSERVLET
CONTEXT
( )

serverservletcontext ( )

Returns the servlet context of the corresponding server instance (e.g. /VoiceObjects).

SERVERURL ([servletEngine])

serverurl ([servletEngine])

Returns the URL leading to the corresponding server instance (e.g. http://172.22.23.45:8099/
VoiceObjects/DialogMapping
). If the optional parameter servletEngine is set to true (the default), IP and port are retrieved from the servlet engine. If it is false, the corresponding values are retrieved from the server configuration.

SESSION (varName, [value])

session (varName, [value])

Returns or sets information from the session context. The following arguments are supported:

·                ANI
Calling number; same as ANI()

·                DNIS
Called number; same as DNIS()

·                RDNIS
Redirecting number; not available on all
media platforms

·                MPSID
Media platform session ID; not available on all
media platforms

·                AAI
Application to Application Information; not available on all
media platforms

·                GCID
Global call ID; not available on all media platforms

·                UA
User-agent information; only available for Mobile Web driver

·                CRMID
Unique caller or customer ID; can be used to join Infostore data with the CRM data warehouse

·                customShadow
Custom data transferred from the media platform (optional).

Availability of the information depends on the media platform. In addition, custom arguments can be used.

VIDEOTYPE ([type])

videotype ([type])

When used without an argument, returns the code of the currently active video type (one of video, videoaudio, none). When used with an argument, it sets the currently active video type to this value. The argument must be one of the video type codes listed above. Note that the underlying media platform must be configured appropriately to support the video type that is being set.

VISITCOUNTER (objRefID)

visitcounter (objRefID)

Returns the number of times the object with the specified reference ID has been visited within the current dialog.

VSN ()

vsn ()

Returns the name of the VoiceObjects service associated with the current dialog.

 

Miscellaneous Functions

Name and Arguments

Description

Desktop

XML

CONDITIONAL (cond, truevalue, falsevalue)

conditional (cond, truevale, falsevalue)

If cond is true, returns truevalue. Otherwise, returns falsevalue. Cond can be a Variable, Expression, Script, or Collection object, or a layer condition.