Data Items and Queries

In IVR elements’ attributes, and when entering their values as key/value pairs, the following data items can be selected from the drop-down lists. Depending on the item, either select it from the list as such, choose the values for possible x and y from corresponding selection lists, or complete the statement with Python code. Alternatively, enter the whole attribute with Python code.

Note:

In conditions and expressions, also the statement factors x and y can be selected from the list, but the list is limited to available menu and variable elements and CEM Data structures, see lists below.

To use also other data items for x and y directly from the list, define variables for x and y before the current element.

example:

To define an expression for the number of calls waiting in a queue, choose the Queue Query: Number of Calls Waiting from the list and enter the queue number.

To define a condition that checks if the calling number starts with a defined string, such as 12345, choose the Condition: ’X’ Starts with ’Y’, and choose {ANUMBER} for x from the drop-down list, and enter 12345 for y.

CEM Data Items

The following CEM data Items can be selected directly from the drop-down menu for element attributes.

Table 1. Selectable CEM Data Items

CEM Data Item

Description

{ANUMBER}

A number; the number of the caller who called to the IVR.

{BNUMBER}

B number; the number of the IVR currently being processed.

{CALLID}

Call id of the call currently being processed in the IVR.

{CALLINFODATA}

Call information attached to the call.

{DBLASTFOUNDVALUE}

String-type data, last value found in database

{EXTERNALDATAARRAY}

Dictionary-type data that has been assigned to variable {EXTERNALDATAARRAY}, last result of a custom method call or last response of a soap method, whichever has been performed latest.

{EXTRADATA}

Additional information attached to the call.

{IP}

IP address of CEM Server’s virtual unit.

{IVRINFO}

Additional information from another IVR, where from the call has been transferred to the current IVR. Information is specified as Call Attached Data in the transfer element. IVR info is included in {EXTRADATA} when the call is transferred.

{LANGUAGE}

The language that has been associated to the call.

{LASTDTMF}

The last received DTMF input from the caller in the current IVR.

{LASTRECORDEDVALUE}

The name of the file that has been recorded last by the record element in the current IVR.

{PREVIOUSDTMF}

The previous (one before last) received DTMF input from the caller in the current IVR.

{PRIORITY}

The priority of the call that can be assigned to the call with setpriority element, or for a queue extension.

{SKILLS}

Skill requirements attached to the call with setskills element. Skills are included in {EXTRADATA} when the call is transferred from the IVR.

Conditions

When a condition of an element is true, the IVR performs as defined in the element: in the audio element the audio is played, in other elements the child elements are executed. When a condition is false, the IVR application proceeds to the next element.

Table 2. Selectable Conditions

Condition

Python Statement

Description

Condition: ’X’ Not Empty

x

Condition is true when ’X’ exists.

Condition: ’X’ Is Empty

not x

Condition is true when ’X’ does not exist.

Condition: ’X’ Not Empty and ’Y’ Not Empty

x and y

Condition is true when ’X’ and ’Y’ exist.

Condition: ’X’ Is Empty and ’Y’ Is Empty

not x and not y

Condition is true when ’X’ and ’Y’ do not exist.

Condition: ’X’ Not Empty and ’Y’ Is Empty

x and not y

Condition is true when ’X’ exists and ’Y’ does not exist.

Condition: Compare ’X’ and ’Y’

x == y

Condition is true when ’X’ is equal to ’Y’.

x <> y

Condition is true when ’X’ is not equal to ’Y’.

x > y

Condition is true when ’X’ is greater than ’Y’.

x < y

Condition is true when ’X’ is less than ’Y’.

x >= y

Condition is true when ’X’ is greater than or equal to ’Y’.

x <= y

Condition is true when ’X’ is less than or equal to ’Y’.

Condition: ’X’ Contains ’Y’

str(x).find(str(y)) >= 0

Condition is true when the string ’X’ contains the string ’Y’.

Condition: ’X’ Starts with ’Y’

str(x).startswith(str(y))

Condition is true when the string ’X’ starts with the string ’Y’.

Condition: ’X’ Ends with ’Y’

str(x).endswith(str(y))

Condition is true when the string ’X’ ends with the string ’Y’.

Condition: Compare ’X’ Length to ’Y’

len(str(x)) == y

Condition is true when the string ’X’ length is equal to ’Y’.

len(str(x)) <> y

Condition is true when the string ’X’ length is not equal to ’Y’.

len(str(x)) > y

Condition is true when the string ’X’ length is greater than ’Y’.

len(str(x)) < y

Condition is true when the string ’X’ length is less than ’Y’.

len(str(x)) >= y

Condition is true when the string ’X’ length is greater than or equal to ’Y’.

len(str(x)) <= y

Condition is true when the string ’X’ length is less than or equal to ’Y’.

Date/Time Expressions

With date and time expressions the IVR application can return current time in different formats.

Table 3. Selectable Date and Time Expressions

Date/Time Expression

Python Statement

Description

Date/Time Expression: Current Date String (DDMM)

datetime.datetime.now().strftime("%d%m")

Current time expressed with number of days and month.

Date/Time Expression: Current Date String (DDMMYYYY)

datetime.datetime.now().strftime("%d%m%Y")

Current time expressed with number of days, month, and the year expressed with four numbers.

Date/Time Expression: Current Time String (hhmm)

datetime.datetime.now().strftime("%H%M")

Current time expressed with number of hours and minutes.

Date/Time Expression: Current Date/Time String (DDMMhhmm)

datetime.datetime.now().strftime("%d%m%H%M")

Current time expressed with number of days, month, hours and minutes.

Date/Time Expression: Current Date/Time String (DDMMYYYYhhmm)

datetime.datetime.now().strftime("%d%m%Y%H%M")

Current time expressed with number of days, month year, hours and minutes.

Destinations

All phone queues and IVRs that have a defined number of the system are listed in the Destination drop-down list.

Expressions

With expressions, you can define values for attributes, such as destination, source, number, file location, and so on, instead of defining the actual item directly.

Table 4. Selectable Expressions

Expression

Python Statement

Description

Expression: String Value of ’X’

str(x)

Expression returns the value of ’X’.

Expression: Combine Strings ’X’ and ’Y’

str(x) + str(y)

Expression returns combined value of strings ’X’ and ’Y’.

Expression: String ’X’ in Lower Case

str(x).lower()

Expression returns value of ’X’ in lower case.

Expression: String ’X’ in Upper Case

str(x).upper()

Expression returns value of ’X’ in upper case.

Expression: First ’Y’ Characters of String ’X’

str(x)[:y]

Expression returns a value consisting of the first ’Y’ characters of string ’X’.

Expression: Last ’Y’ Characters of String ’X’

str(x)[y:]

Expression returns a value consisting of the last ’Y’ characters of string ’X’.

Expression: Substring of String ’X’

str(x)[y:z]

Expression returns a substring of string ’X’ , starting from index ’Y’ and ending with index ’Z’, for example, if ’X’ is the number string ’12345678’, with start index 2 and end index 5, the expression returns ’345’. The indexes are zero based.

Expression: String ’X’ with ’Y’ Replaced by ’Z’

str(x).replace(str(y), str(z))

Expression returns value of string ’X’ where ’Y’ values are replaced with ’Z’.

Menus

Menus in the selection lists are marked with a prefix menu: and all menu elements defined in that IVR will appear in the selection list.

Queue Queries and Queue Status Queries

Queue queries and queue status queries provide information about the defined queue. Define the queue number directly in the statement, or use the var element.

Instead of queue number you can also use the queue ID in the queries below, which enables queries to the queues without number. Enter "intGUID(Queue ID)" instead of "[queue number]". You can use ID in formats with or without dashes between the sets of numbers. To find the queue ID, search for the queue, and when the search result list appears, choose ID for display with the Personalize button.

Table 5. Selectable Queue Queries and Queue Status Queries

Query

Python Statement

Description

Queue Query: Checking Agent Availability

QUEUE.QUERY("[queue number]", "Que_Available")

This query returns the number of potentially available agents.

The system considers an agent potentially available when all of the following conditions are fulfilled. The agent:

  • is signed into the system and the queue.
  • has selected a presence profile.
  • is not serving in an outbound campaign.

Examples of situations where the system considers an agent potentially available when the above conditions are also fulfilled:

  • The agent is available and not currently handling a conversation.
  • The agent’s status is Not Ready.
  • The agent is busy and currently handling a conversation.
  • The agent is doing wrap-up for a conversation.

Queue Query: Number of Calls Waiting per Agent

QUEUE.QUERY("[queue number]", "Que_CallsPerAgentWaiting")

This query returns the number of calls waiting per agent in the queue [queue number].

Queue Query: Number of Calls Waiting

QUEUE.QUERY("[queue number]", "Que_CallsWaiting")

This query returns the number of calls waiting in the queue [queue number].

Queue Query: Estimated Waiting Time

QUEUE.QUERY("[queue number]", "Que_EstWaitTime")

This query returns the estimated waiting time in seconds in the queue [queue number].

Note:

If there are no calls in the queue, the query returns the value set for Max. Waiting Time of the queue.

Queue Query: Checking Service Availability

QUEUE.QUERY("[queue number]", "Que_ServiceOpen")

This query checks if the queue [queue number] is open according to its schedule. Return values are 1 (open) and 0 (closed).

Queue Query: Number of Agents Serving

QUEUE.QUERY("[queue number]", "Que_TotalAgents")

This query returns the total number of agents serving in the queue [queue number].

Queue Query: Number of Calls in Queue

QUEUE.QUERY("[queue number]", "Que_TotalCalls")

This query returns the total number of calls in the queue [queue number].

Queue Query: Number of Calls per Agent

QUEUE.QUERY("[queue number]", "Que_TotalCallsPerAgent")

This query returns the total number of calls per agent in the queue [queue number].

Queue Status Query: Number of Administrative Agents

QUEUE.QUERY("[queue number]", "Sta_AgentsAdmin")

This query returns the number of administrative agents in the queue [queue number].

Queue Status Query: Number of Not-Ready Agents

QUEUE.QUERY("[queue number]", "Sta_AgentsPaperWork")

This query returns the number of not-ready agents in the queue [queue number].

Queue Status Query: Number of Paused Agents

QUEUE.QUERY("[queue number]", "Sta_AgentsPaused")

This query returns the number of paused agents in the queue [queue number].

Queue Status Query: Number of Talking Agents

QUEUE.QUERY("[queue number]", "Sta_AgentsTalking")

This query returns the number of talking agents in the queue [queue number].

Queue Status Query: Number of Waiting Agents

QUEUE.QUERY("[queue number]", "Sta_AgentsWaiting")

This query returns the number of waiting agents in the queue [queue number].

Queue Status Query: Average Waiting Time

QUEUE.QUERY("[queue number]", "Sta_AverageWaitingTime")

This query returns the average waiting time in seconds of the queue [queue number].

Queue Status Query: Maximum Waiting Time

QUEUE.QUERY("[queue number]", "Sta_MaxWaitingTime")

This query returns the maximum waiting time in seconds in the queue [queue number].

Variables

Variables in the selection lists are marked with a prefix var:.

The var: selection list consists of the following items:

  • Variables defined with the var element in the IVR document above the current element, for example, the global variables that are defined above the actual IVR.

  • Parameters defined in the Custom Parameters view.

  • Built-in IVR parameters defined in the Survey IVR Settings block. See the Survey IVR for more information.

    Survey IVR Setting

    Corresponding var: Item

    Survey IVR Number

    SurveyExtension

    Opt-In IVR Call Type Filter

    CallTypeFilter

    Opt-In Query Percent

    IntakePercentage

    Script Name for Monitoring and Reporting

    ScriptName

    Disable Pre-Welcome in Opt-In in Use

    DisablePrewelcomePrompt

    Disable Welcome in Opt-In in Use

    DisableWelcomePrompt