Real TimeDataAPI ProgrammersGuide R7 1v001
Real TimeDataAPI ProgrammersGuide R7 1v001
Release 7.1
Issue 0.1
August 2019
© 2019 Avaya Inc. WITHOUT A LICENSE. BY INSTALLING, DOWNLOADING
OR USING THE SOFTWARE, OR AUTHORIZING OTHERS
All Rights Reserved. TO DO SO, YOU, ON BEHALF OF YOURSELF AND THE
Notice ENTITY FOR WHOM YOU ARE INSTALLING,
DOWNLOADING OR USING THE SOFTWARE
While reasonable efforts have been made to ensure that the (HEREINAFTER REFERRED TO INTERCHANGEABLY AS
information in this document is complete and accurate at the “YOU” AND “END USER”), AGREE TO THESE TERMS AND
time of printing, Avaya assumes no liability for any errors. CONDITIONS AND CREATE A BINDING CONTRACT
Avaya reserves the right to make changes and corrections to BETWEEN YOU AND AVAYA INC. OR THE APPLICABLE
the information in this document without the obligation to notify
any person or organization of such changes. AVAYA AFFILIATE (“AVAYA”).
Documentation disclaimer Avaya grants you a license within the scope of the license
types described below, with the exception of Heritage Nortel
“Documentation” means information published by Avaya in Software, for which the scope of the license is detailed below.
varying mediums which may include product information, Where the order documentation does not expressly identify a
operating instructions and performance specifications that license type, the applicable license will be a Designated
Avaya may generally make available to users of its products System License. The applicable number of licenses and units
and Hosted Services. Documentation does not include of capacity for which the license is granted will be one (1),
marketing materials. Avaya shall not be responsible for any unless a different number of licenses or units of capacity is
modifications, additions, or deletions to the original Published specified in the documentation or other materials available to
version of documentation unless such modifications, additions, you. “Designated Processor” means a single stand-alone
or deletions were performed by Avaya. End User agrees to computing device. “Server” means a Designated Processor that
indemnify and hold harmless Avaya, Avaya's agents, servants hosts a software application to be accessed by multiple users.
and employees against all claims, lawsuits, demands and
judgments arising out of, or in connection with, subsequent License type(s)
modifications, additions or deletions to this documentation, to Named User License (NU). You may: (i) install and use the
the extent made by End User. Software on a single Designated Processor or Server per
Link disclaimer authorized Named User (defined below); or (ii) install and use
the Software on a Server so long as only authorized Named
Avaya is not responsible for the contents or reliability of any Users access and use the Software. “Named User”, means a
linked websites referenced within this site or documentation user or device that has been expressly authorized by Avaya to
provided by Avaya. Avaya is not responsible for the accuracy access and use the Software. At Avaya’s sole discretion, a
of any information, statement or content provided on these “Named User” may be, without limitation, designated by name,
sites and does not necessarily endorse the products, services, corporate function (e.g., webmaster or helpdesk), an e-mail or
or information described or offered within them. Avaya does not voice mail account in the name of a person or corporate
guarantee that these links will work all the time and has no function, or a directory entry in the administrative database
control over the availability of the linked pages. utilized by the Software that permits one user to interface with
the Software.
Warranty
Copyright
Avaya provides a limited warranty on Avaya hardware and
software. Refer to your sales agreement to establish the terms Except where expressly stated otherwise, no use should be
of the limited warranty. In addition, Avaya’s standard warranty made of materials on this site, the Documentation, Software,
language, as well as information regarding support for this Hosted Service, or hardware provided by Avaya. All content on
product while under warranty is available to Avaya customers this site, the documentation, Hosted Service, and the Product
and other parties through the Avaya Support website: provided by Avaya including the selection, arrangement and
http://support.avaya.com or such successor site as designated design of the content is owned either by Avaya or its licensors
by Avaya. Please note that if you acquired the product(s) from and is protected by copyright and other intellectual property
an authorized Avaya Channel laws including the sui generis rights relating to the protection of
databases. You may
Partner outside of the United States and Canada, the warranty
is provided to you by said Avaya Channel Partner and not by not modify, copy, reproduce, republish, upload, post, transmit
Avaya. or distribute in any way any content, in whole or in part,
including any code and software unless expressly authorized
Licenses by Avaya. Unauthorized reproduction, transmission,
THE SOFTWARE LICENSE TERMS AVAILABLE ON THE dissemination, storage, and or use without the express written
AVAYAWEBSITE, consent of Avaya can be a criminal, as well as a civil offense
HTTP://SUPPORT.AVAYA.COM/LICENSEINFO under the applicable law.
THIS PRODUCT IS LICENSED UNDER THE AVC PATENT Contact Avaya Support
PORTFOLIO LICENSE FOR THE PERSONAL USE OF A See the Avaya Support website: http://support.avaya.com for
CONSUMER OR OTHER USES IN WHICH IT DOES NOT Product or Hosted Service notices and articles, or to report a
RECEIVE REMUNERATION TO (i) ENCODE VIDEO IN problem with your Avaya Product or Hosted Service. For a list
COMPLIANCE WITH THE AVC STANDARD (“AVC VIDEO”) of support telephone numbers and contact addresses, go to the
AND/OR (ii) DECODE AVC VIDEO THAT WAS ENCODED BY Avaya Support website: http://support.avaya.com (or such
A CONSUMER ENGAGED IN A PERSONAL ACTIVITY successor site as designated by Avaya), scroll to the bottom of
AND/OR WAS OBTAINED FROM A VIDEO PROVIDER the page, and select Contact Avaya Support.
LICENSED TO PROVIDE AVC VIDEO. NO LICENSE IS
GRANTED OR SHALL BE IMPLIED FOR ANY OTHER USE.
ADDITIONAL INFORMATION MAY BE OBTAINED FROM
MPEG LA, L.L.C. SEE HTTP://WWW.MPEGLA.COM.
Note to Service Provider
The Product or Hosted Service may use Third Party
Components subject to Third Party Terms that do not allow
hosting and require a Service Provider to be independently
licensed for such purpose. It is your responsibility to obtain
such licensing.
Preventing Toll Fraud
“Toll Fraud” is the unauthorized use of your
telecommunications system by an unauthorized party (for
example, a person who is not a corporate employee, agent,
subcontractor, or is not working on your company's behalf). Be
aware that there can be a risk of Toll Fraud associated with
your system and that, if Toll Fraud occurs, it can result in
substantial additional charges for your telecommunications
services.
Avaya Toll Fraud intervention
If you suspect that you are being victimized by Toll Fraud and
you need technical assistance or support, call Technical
Service Center Toll Fraud Intervention Hotline at +1-800-643-
2353 for the United States and Canada. For additional support
telephone numbers, see the Avaya Support website:
http://support.avaya.com or such successor site as designated
by Avaya. Suspected security vulnerabilities with Avaya
products should be reported to Avaya by sending mail to:
[email protected].
Trademarks
The trademarks, logos and service marks (“Marks”) displayed
in this site, the Documentation, Hosted Service(s), and
Product(s) provided by Avaya are the registered or
unregistered Marks of Avaya, its affiliates, or other third parties.
Users are not permitted to use such Marks without prior written
consent from Avaya or such third party which may own the
Mark. Nothing contained in this site, the Documentation,
Hosted Service(s) and Product(s) should be construed as
granting, by implication, estoppel, or otherwise, any license or
right in and to the Marks without the express written permission
of Avaya or the applicable third party.
Avaya is a registered trademark of Avaya Inc.
All non-Avaya trademarks are the property of their respective
owners. Linux® is the registered trademark of Linus Torvalds in
the U.S. and other countries.
All non-Avaya trademarks are the property of their respective
owners, and “Linux” is a registered trademark of Linus
Torvalds.
Downloading Documentation
Chapter 2: Overview...................................................................................................... 7
Real-time statistics .................................................................................................................. 7
Obtaining real-time data ........................................................................................................................ 8
Update values ....................................................................................................................................... 8
API summary ........................................................................................................................... 8
Data element storage functions ............................................................................................................ 9
Query description functions .................................................................................................................. 9
Data access functions ......................................................................................................................... 10
Data request functions ........................................................................................................................ 10
Preprocessing and postprocessing functions ..................................................................................... 11
Communication failure ........................................................................................................................ 12
Debug functions .................................................................................................................................. 12
Chapter 3: Installation................................................................................................. 13
Development Environment .................................................................................................................. 13
Execution Environment ....................................................................................................................... 13
Unicode / ANSI Flavours ..................................................................................................................... 13
Installing the RTDSDK ........................................................................................................................ 14
Migrating Existing RTDAPI Applications ............................................................................................. 14
Purpose
This document provides information about the Avaya Aura Contact Center / Avaya Contact Center
Select (AACC/ACCS) Real-time Data API (RTDAPI).
Intended audience
This document is intended for people who want to use the AACC/ACCS RTDAPI. It is primarily
aimed at the software designers and developers responsible for developing RTDAPI applications.
Support
Visit the Avaya Support website at http://support.avaya.com for the most up-to-date AACC/ACCS
documentation, product notices, and knowledge articles. You can also search for release notes,
downloads, and resolutions to issues. Use the online service request system to create a service
request. Chat with live agents to get answers to questions, or request an agent to connect you to a
support team if an issue requires additional expertise.
Real-time statistics
During normal operation, AACC/ACCS generates a variety of real-time statistics. The RTDAPI
provides these statistics to applications using a C programming interface. The Basic Status
Reporting package contains data from the following tables:
1. Application statistics
2. Skillset statistics
3. Agent statistics
4. Nodal statistics
5. IVR statistics
6. Route statistics
Each type of statistic is collected in two different ways—interval-to-date and moving window. The
interval used for interval-to-date calculations is user-configurable in 15-minute increments from 15
minutes to 24 hours. The interval used for moving window calculations is predefined to be 10
minutes.
API architecture
The RTDAPI supports building 32-bit applications that run on Microsoft Windows operating
systems.
- An application built using the API is expected to run on any Windows platform that supports
running 32-bit applications. The Windows platform running the RTD client application is
referred to as the API client.
- The API has been tested using Microsoft Visual Studio 2015 on Windows 10. While the API
is not tested against all releases of Microsoft Visual Studio, it is expected to be compatible
with all recent and future releases of Microsoft Visual Studio.
The API client accesses an AACC/ACCS by way of a TCP/IP connection. The API allows a single
application to connect to a single server. To display a continuous stream of data from multiple
servers, applications must connect to each server through a different process.
On AACC/ACCS, a Real-time Data session appears as a user logon. The server allows for a total of
100 client sessions. For instance, if there are 100 different client applications logged on to the
server, then the next workstation client or application attempting to log on is rejected.
Update values
The first update from a data request (one-time or continuous) holds only the newValues table,
which contains all of the rows that satisfy the request. Subsequent updates contain table rows that
indicate new, deleted, or changed rows since the last received request. Within each table, key ID
columns are returned to the application. These IDs are used when applying delta information.
API summary
The RTDAPI contains the following functional groups:
Before calling any of the API functions where NIrtd_stValue or NIrtd_stName are used as
parameters, the string space required by these structures must first be allocated by calling
NIrtd_allocateValue and NIrtd_allocateName.
When you finish with either data element, call NIrtd_freeValue or NIrtd_freeName to deallocate the
space.
NIrtd_cpValue and NIrtd_cpName are provided to make copies of the structures. Values typically
represent data column values and names represent the displayable names for skillsets,
applications, or agents.
The command NIrtd_allocateQuery allocates a query structure for the specified table.
The command NIrtd_selectColumn is called to select the desired columns in the query.
When using conditions, the API client must specify a key value to query for. The command
NIrtd_getValue is useful for obtaining a key value for a condition. Given the textual name of the
desired component (for example, an agent with the name John Doe), the routine returns an ID
value that can be passed to the NIrtd_addCondition routine.
When done with a conjunction, issue the NIrtd_freeConjunction function to free memory allocated
to the conjunction.
When you finish with the query (after calling NIrtd_singleDataRequest or NIrtd_startDataStream),
issue the command NIrtd_freeQuery to free memory allocated to the query.
The server returns data to the API client in a table group structure. The table group structure
consists of three values table structures: a deleted values table, a new values table, and a delta
values table. Each values table structure contains the number of rows and columns present in the
table. When data in the tables are returned from the server, check the return code to verify that
the data was received properly.
The command NIrtd_allocateRow retrieves and allocates access to a row in a values table. Use
the function NIrtd_getCol to obtain the desired column value in a row.
When you finish with a row, issue the command NIrtd_freeRow to free memory allocated to the
row. When you are done with the entire table group structure, issue the command
NIrtd_freeTableGroup to free the memory allocated to the table group.
The command NIrtd_login establishes a session on the server and returns the authorization to the
application program.
Data is returned in a table group structure, which is passed to the callback function. The callback
function is executed when data arrives at the API client. The callback function must be written within
the third-party application and is a parameter passed to NIrtd_startDataStream.
Use the function NIrtd_stopDataStream to stop receiving updates. This command cancels the
request that was initiated by a previous call to NIrtd_startDataStream().
To translate agent telset login IDs, supervisor telset login IDs, skillset IDs, or application IDs into
displayable names, the application must first initialize an internal name cache for each column
ID by calling the function NIrtd_getNameCacheforDataColumn.
After the column name cache is initialized, individual ID values can be converted to a name by
calling NIrtd_getName. If the NIrtd_getName routine returns NIrtd_eNotFound, then the
application should indicate visually that the name is in a to be determined state, and then make an
off-node blocking call to obtain the real name using the routine NIrtd_getFailedName.
Names that are changed on the server are not automatically propagated to the name cache of the
third-party client. The name cache must be refreshed manually by calling
NIrtd_refreshNameCache. NIrtd_getName can be called again to update each ID/name
displayed.
You can control a timer-based recovery mechanism. Use the command NIrtd_setRecovery to set
the amount of time to wait before declaring a communication failure (the pullPlugTime plus the
update rate) and the frequency at which the RTDAPI layer wakes up and checks the amount of time
that has passed (wakeupGranularity).
Before a recovery attempt is made, the application’s callback function is called with the return_code
parameter of NIrtd_eSTART_RECOVERY.
After recovery, the application’s callback function is called with a return_code parameter of either
NIrtd_eOK_RECOVERY or NIrtd_eBAD_RECOVERY. If recovery fails, a delay of the pullPlugTime plus the
update time occurs before another recovery attempt is made. The default pullPlugTime is 5 minutes
with a wakeupGranularity of 1 minute.
Note: Communication with the server can fail due to the client’s inability to accept data at the rate
requested. The data propagation component on the server logs this kind of failed communication
event. To remedy this situation, request a less frequent update rate or make performance
enhancement changes to the client.
Debug functions
The RTDAPI uses the following debug functions:
1. NIrtd_getFirstLowError
2. NIrtd_getCnt
Development Environment
The RTDAPI application is developed, compiled and linked in the development environment. The
development environment consistes of a C/C++ compiler/linker and the RTDAPI header and library
files from the RTDSDK. The header files are in the \include folder while the libraries are in the
\lib folder.
The RTDAPI has been tested using Microsoft Visual Studio 2015. While the API is not tested
against all releases of Microsoft Visual Studio, it is expected to be compatible with all recent and
future versions of Microsoft Visual Studio.
Execution Environment
The developed RTDAPI application requires an execution environment to connect to an operational
AACC/ACCS. The execution environment consists of executables and Dynamic Lnk Libraries. The
execution environment is contained in the \bin folder.
An application built using the RTDAPI is expected to run on any Windows platform that supports
running 32-bit application. The RTDAPI has been tested on Windows 10. While the API is not
tested against all Microsoft Windows releases, it is expected to be compatible with the latest
versions of Microsoft Windows.
The execution environment has a dependency on the Microsoft Visual C++ 2015 Redistributable
package. The RTDSDK installer detects if the redistributable is present. The installer can
automatically install the redistributable if required.
The library and execution environment are dependent on the build flavour. The default location for
the library and run-time are:
ANSI UNICODE
1.0
An existing RTDAPI application designed for an earlier release of AACC/ACCS will work with
AACC/ACCS 7. However, it is recommended that the execution environment is updated to take
advantage of software quality improvements.
The environment is updated by removing the existing RTDSDK and installing the latest.
Introduction
The tables in this section describe the statistics that belong to the Basic Status Reporting package.
For each column in the tables, the data type is defined as Cumulative, State, or Admin. Statistics
are available for multimedia contacts when the Open Queue feature is licensed and enabled.
Telephony-specific statistics do not have meaning for multimedia contacts.
Cumulative—The statistics are accumulated over a specified period of time (for example,
the number of calls answered during an interval).
State—The instantaneous state of the system (for example, the state of an agent at a given
time).
Admin—The value is entered by a data administrator and is not affected by call events (for
example, a skillset ID).
Table definitions
The following tables contain the table definitions for interval-to-date and moving window statistics.
Currently, you can configure the time interval used for interval-to-date statistics (15-minute
increments, starting from 15 minutes to 24 hours), whereas the interval used for moving window
calculations is set to 10 minutes.
Application statistics
Application statistics provide instantaneous state and cumulative performance measurement
information on a per-application basis. An application corresponds to a single primary script (that
provides call processing for a particular type of call) and all of its associated secondary scripts. For
example, a department store’s call center can have a catalog sales application and a credit card
inquiry application.
a) This statistic includes calls that originally entered AACC at this site and calls that were
received at this site from the Contact Center network. Delays are calculated from the time
the call enters this site if it is a local CDN call or from the time the call is logically queued to
this site if it is a network call.
b) Network Out statistics refer to calls that originally entered the AACC at this site butt were
sent to another site on the Contact Center network. Delays for Network Out statistics are
calculated from the time the call arrives at the source site to the time the call is treated
(either answered, abandoned, or terminated) at the destination site.
Skillset statistics
Skillset statistics provide instantaneous state and cumulative performance measurement
information on a per-skillset basis. If the agent is not logged on, no statistical data is available for
that particular skillset.
Column Column ID Data type Description Format
NIrtd_getName and
ID
NIrtd_getValue)
Agents NIrtd_SKLST_AGENT_AVAIL The number of agents who are
State ULONG
Available currently waiting for calls.
Agents In NIrtd_SKLST_AGENT_IN_SE The number of agents logged on
State ULONG
Service RVICE for this skillset.
Agents on NIrtd_SKLST_AGENT_ON_IC The number of agents who are
State ULONG
Skillset CM_CALL logged on for this skillset and are
Calls currently handling local and
network CDN calls assigned to
this skillset.
Agents Not NIrtd_SKLST_AGENT_NOT_R The number of agents currently in
State ULONG
Ready EADY the Not Ready State who are
logged on for this skillset.
NIrtd_SKLST_CALL_WAIT The number of local and incoming
Calls State ULONG
network CDN calls currently
Waiting
waiting for an agent with this
skillset.
Longest NIrtd_SKLST_LONGEST_WAI The longest waiting time of all idle
State ULONG
Waiting T_TIMES_SINCE_LAST_CAL agents who are currently waiting
Time Since L to answer calls for this skillset.
Last Call The time is since last call.
Max. NIrtd_SKLST_MAX_WAIT_TI The maximum waiting time spent
State ULONG
Waiting ME by all local and incoming network
Time CDN calls that are currently
waiting for an agent with this
skillset.
NIrtd_SKLST_TOT_WAIT_TIM The total waiting time spent by all
Waiting State ULONG
E local and incoming network CDN
Time
calls
that are currently waiting for an
agent
assigned to this skillset.
An agent can log on to more than one skillset at any time. Therefore, if an application sums Agents
Available for each skillset, the value obtained is generally greater than the total number of agents in
the contact center who are available to take calls. The same is true for Agents in Service and
Agents Not Ready. This is not the case for Agents on Skillset Calls, that is, the sum of Agents on
Skillset Calls for each skillset is equal to the total number of agents currently answering skillset calls
in the contact center.
Agent statistics
Agent statistics provide instantaneous state information regarding an agent (call taker). These
statistics provide a supervisor with a means to monitor what their agents are doing at any point in
time. If the agent is not logged on, no statistical data is available for that particular agent.
Answere
d
DN Nlrtd_AGENT_DN_
State The number of DN calls made by an agent. STRING
OutCall OUT_CALL
Made
Answerin
Nlrtd_AGENT_ANS State A unique number to identify an application. STRING
g
_APP
Applicatio
n
Answerin A special directory number that allows
Nlrtd_AGENT_ANS State STRING
g incoming calls to be queued at a CDN when
_CDN
CDN_Lo they arrive at the switch.
w
And
Answerin
gCDN_Hi
gh
Answerin The phone number dialed by the incoming
Nlrtd_AGENT_ANS State STRING
g caller.
_DNIS
DNIS_Hi
gh
And
Answerin
g
DNIS_Lo
w
For CS1000 connectivity, an agent can be assigned multiple DN keys. Therefore, an agent can be
in a state that they are answering a DN call as well as placing another DN call on hold.
Nodal statistics
Nodal statistics provide instantaneous state and cumulative accounting information for a next
generation Call Center server. Usually, a call center has a single server and the nodal statistics are
equal to the call center statistics. In the Basic Status Reporting package, only one nodal statistic is
available.
a. This statistic includes calls that originally entered the Contact Center Manager Server at this
site and calls that were received at this site from the Contact Center network.
b. This statistic only includes calls that were received at this site from the Contact Center
network.
IVR statistics
IVR statistics provide state and cumulative performance measurement information on a per-IVR
queue basis. These statistics provide a means to monitor the usage of the port resources of an
IVR queue from a real-time perspective.
Route statistics
Route statistics provide instantaneous and cumulative All Trunks Busy (ATB) information on a per-
route basis.
Note: Route statistics are available for the CS1000 only.
Type definitions
RTDAPI includes internationalized (MBCS) support.
Value functions
Parameter Description
*value A pointer to an NIrtd_stValue structure. The string pointer within the structure
is
allocated by this function call.
NIrtd_freeValue()
This function frees string space within a value structure.
VOID NIrtd_freeValue(NIrtd_stValue *value );
Parameter Description
*value A pointer to an NIrtd_stValue structure that has been fully allocated by a
previous call to NIrtd_allocateValue. The string pointer within the structure is
freed by this function call.
NIrtd_cpValue()
This function copies a value structure. The source and destination structures must already be fully
allocated by previous calls to NIrtd_allocateValue.
ULONG NIrtd_cpValue(NIrtd_stValue *destvalue, NIrtd_stValue *srcvalue );
Parameter Description
*destvalue A pointer to the destination value structure.
*srcvalue A pointer to the source value structure.
Name functions
NIrtd_allocateName()
This function allocates string space within a name structure.
Parameter Description
*name A pointer to an NIrtd_stName structure. The first_name and last_name string
pointers within the structure are allocated by this function call.
NIrtd_freeName()
This function frees string space within a name structure.
VOID NIrtd_freeName(NIrtd_stName*name );
Parameter Description
*name A pointer to an NIrtd_stName structure that has been fully allocated by a previous
call to NIrtd_allocateName. The first_name and last_name string pointers within the
structure are freed by this function call.
NIrtd_cpName()
This function copies a name structure. (The source and destination structures must already be fully
allocated by previous calls to NIrtd_allocateName.)
ULONG NIrtd_cpName(NIrtd_stName *destname, NIrtd_stName *srcname );
Parameter Description
*destname A pointer to the destination name structure.
*srcname A pointer to the source name structure.
NIrtd_allocateQuery()
This function allocates a query structure and associates the query with the specified table.
Parameter Description
*query A pointer to an NIrtd_tQuery structure.
NIrtd_tQuery is a private data structure. The space required by the query
structure is allocated by this function call.
table The ID of the table to query.
Return code Error no. Description
NIrtd_eOK 0 Operation successful.
NIrtd_eQUERY_INITPARM 60012 Query parameter was not null on initialization.
NIrtd_eQUERY_INIT 60014 Failed to initialize query.
NIrtd_eTABLE 60003 Invalid table ID passed.
NIrtd_selectColumn()
This function associates a column ID with the query structure. Multiple columns can be associated
with a query. However, the first selected column must be a table key.
ULONG NIrtd_selectColumn (NIrtd_tQuery *query, NIrtd_tColumnId column);
Parameter Description
*query A pointer to an NIrtd_tQuery structure.
NIrtd_tQuery is a private data structure. The space required by the query structure
should already be allocated by a previous call to NIrtd_allocateQuery.
column The ID of a column to be retrieved by the query.
NIrtd_allocateConjunction()
This function allocates a conjunction structure, This provides a where clause for a query.
Parameter Description
NIrtd_addCondition()
Parameter Description
*conj A pointer to an NIrtd_tConjunction structure to which the condition is added.
NIrtd_tConjunction is a private data structure. The space required by the
conjunction structure should have already been allocated by a previous call to
NIrtd_allocateConjunction.
column The ID of the table column.
oper The operator. The only operatror currently available is NIrtd_EQ.
*value A pointer to the operand value structure.
The column selected in a condition must be a table key. Valid table keys are:
NIrtd_APPL_APPL_ID for the Application table
NIrtd_SKLST_SKILLSET_ID for the Skillset table
NIrtd_AGENT_AGENT_ID for the Agent table
NIrtd_NODAL_DUMMY_KEY for the Nodal table. There are no real keys for the Nodal table;
rather, this key is used to make the interface consistent for the application when dealing with
the application of new, deleted, and delta tabl updates.
Nlrtd_IVR_QUEUE_ID for the IVR table
Nlrtd_ROUTE_ROUTE_NO for the Route table column IDs
NIrtd_addConjunction()
This function adds a conjunction to a query.
ULONG NIrtd_addConjunction(NIrtd_tQuery *query, NIrtd_tConjunction *conj);
Parameter Description
*query A pointer to an NIrtd_tQuery structure.
NIrtd_tQuery is a private data structure. The space required by the query structure
The following code fragment creates a query that contains two conjunctions. Each conjunction
contains one condition, which selects a particular skillset based on skillset ID.
NIrtd_tQuery query = NIrtd_NullQuery;
NIrtd_tConjunction conj1 = NIrtd_NullConjunction;
NIrtd_tConjunction conj2 = NIrtd_NullConjunction;
NIrtd_stValue value1;
NIrtd_stValue value2;
/* You can with initialize the value’s unioned number/string
pointer or ensure that NIrtd_allocateValue is call in all cases
where even if it fails, the pointer will be set to null */
lRc = NIrtd_allocateValue(&value1);
careabit = NIrtd_allocateValue(&value2);
if (NIrtd_eOK != lRc)
goto quit;
lRc = careabit;
if (NIrtd_eOK != lRc)
goto quit;
lRc = NIrtd_allocateQuery(&query, NIrtd_INTRVL_SKLST);
if (NIrtd_eOK != lRc)
goto quit;
lRc = NIrtd_selectColumn(&query,NIrtd_SKLST_SKILLSET_ID);
if (NIrtd_eOK != lRc)
goto quit;
lRc = NIrtd_selectColumn(&query,NIrtd_SKLST_CALL_WAIT);
if (NIrtd_eOK != lRc)
goto quit;
lRc = NIrtd_allocateConjunction(&conj1);
if (NIrtd_eOK != lRc)
goto quit;
lRc = NIrtd_allocateConjunction(&conj2);
if (NIrtd_eOK != lRc)
goto quit;
value1.type = NIrtd_eNumber;
value1.number = SALES;
value2.type = NIrtd_eNumber;
value2.number = SUPPORT;
/* specify skillset with id = SALES */
lRc = NIrtd_addCondition(&conj1,
NIrtd_SKLST_SKILLSET_ID,
NIrtd_EQ,
&value1);
if (NIrtd_eOK != lRc)
goto quit;
/* specify skillset with id = SUPPORT */
lRc = NIrtd_addCondition(&conj2,
NIrtd_SKLST_SKILLSET_ID,
NIrtd_EQ,
&value2);
if (NIrtd_eOK != lRc)
goto quit;
/* add the conjunction to the query */
lRc = NIrtd_addConjunction(&query, &conj1);
if (NIrtd_eOK != lRc)
goto quit;
/* add the conjunction to the query */
lRc = NIrtd_addConjunction(&query, &conj2);
NIrtd_getValue()
This function takes string name values (agent names, application names, and skillset names) and
looks up the corresponding ID values (agent telset login IDs, application IDs, and skillset IDs) so
that they can then be passed to the NIrtd_addCondition function.
ULONG NIrtd_getValue(NIrtd_tAPIauth *authorization, NIrtd_stName *name, NIrtd_tColumnId
column, NIrtd_stValue *value);
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
*name A pointer to a structure that contains the first_name and last_name of the value
requested. For applications and skillsets, the first_name should be set to a null
string.
column The ID of the table column.
*value A pointer to a structure to contain the string or numeric value required.
NIrtd_freeConjunction()
This function frees memory associated with a conjunction.
ULONG NIrtd_freeConjunction (NIrtd_tConjunction *conj);
Parameter Description
*conj A pointer to a conjunction structure that has been fully allocated by a previous call
to NIrtd_allocateConjunction. The conjunction structure is freed by this function
call.
NIrtd_freeQuery()
This function frees memory associated with a query.
ULONG NIrtd_freeQuery (NIrtd_tQuery *query);
Parameter Description
*query A pointer to a query structure that has been fully allocated by a previous call to
NIrtd_allocateQuery. The query structure is freed by this function call.
NIrtd_allocateRow()
This function allocates a row structure and then retrieves the column data from row <index> of
table <table> and copies the data into the allocated row.
ULONG NIrtd_allocateRow( NIrtd_stTable *table, NIrtd_tRow *row, ULONG index);
Parameter Description
*row A pointer to an NIrtd_tRow structure.
NIrtd_tRow is a private data structure. The space required by the row structure is
allocated by this function call.
*table A pointer to an NIrtd_stTable structure.
NIrtd_stTable is a semi-private data structure holding statistical data information
returned from the server.
index The row in the table to be copied into the allocated row structure.
NIrtd_getCol()
This function retrieves one column of data from the passed row structure and returns it in the value
structure.
Parameter Description
*value A pointer to an NIrtd_tValue structure in which to return the retrieved value. The
space required by the value structure should already be allocated by a previous
call to NIrtd_allocateValue.
*row A pointer to an NIrtd_tRow structure from which to retrieve data. The space
required by the NIrtd_tRow structure should already be allocated by a previous call
to NIrtd_allocateRow.
index The column in the row to retrieve. (Range = 0 .. number of columns selected)
NIrtd_freeRow()
This function frees the memory associated with a row structure.
ULONG NIrtd_freeRow (NIrtd_tRow *row);
Parameter Description
*row A pointer to a row structure that has been fully allocated by a previous call to
NIrtd_allocateRow. The row structure is freed by this function call.
NIrtd_freeTableGroup()
This function frees the storage for the group of table values returned by NIrtd_singleDataRequest()
or NIrtd_StartDataStream(). Data received from the server is stored in a table group by the API.
Parameter Description
*table A pointer to an NIrtd_stTableGroup structure. NIrtd_stTableGroup is a semi-private
data structure holding statistical data information returned from the server. The
subtables and overall structure will be deallocated by this function call.
NIrtd_login()
This function is used to log on to a server and to obtain authorization from the AACC/ACCS security
server. The NIrtd_login user is set up using Contact Center Server Utility. The newly created user
must have Real-time Display privileges to receive the RTD data. The new user’s details are used
for the registration process when logging on.
ULONG NIrtd_login(NIrtd_tAPIauth *authorization, TCHAR *userID, TCHAR *passWord);
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
Memory for the private structure is allocated at logon and deallocated at logoff.
*servname A string containing the IP address of the server.
*userId A user ID set up on the server to receive Nlrtd requests.
*password The password for the user ID.
NIrtd_singleDataRequest()
This function obtains real-time data from the server and puts it into a table group structure.
Before calling NIrtd_singleDataRequest, the application must log on to a server using
NIrtd_login().
ULONG NIrtd_singleDataRequest( NIrtd_stTableGroup **tableGroup, NIrtd_tAPIauth
*authorization, NIrtd_tQuery *query);
Parameter Description
**tableGroup A pointer to an NIrtd_stTableGroup structure.
NIrtd_stTableGroup is a semi-private data structure holding statistical data
information returned from the server.
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
*query A pointer to an NIrtd_tQuery structure.
NIrtd_tQuery is a private data structure. The space required by the query structure
should already be allocated and initialized by previous API function calls.
NIrtd_startDataStream()
This function is used to request a stream of regular data updates from a server.
ULONG NIrtd_startDataStream( NIrtd_tAPIauth *authorization, NIrtd_tQuery *query, ULONG
updateRate, NIrtd_funCallback callback, NIrtd_tRequestId *requestId );
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
*query A pointer to an NIrtd_tQuery structure.
NIrtd_tQuery is a private data structure. The space required by the query structure
should already be allocated and initialized by previous API function calls.
updateRate The minimum frequency (in milliseconds) with which data is updated.
callback The function to be executed when data is retrieved. (*NIrtd_funCallback) (ULONG
return_code, NIrtd_tRequestIdrequestid, NIrtd_stTableGroup *tableGroup, void *
yourpointer)
*yourpointer An application pointer that is passed back to the application when the callback
function is called.
*requestId A value returned by the API so that this request can be canceled by
NIrtd_stopDataStream().
The server is informed that the requested data should be provided at regular time intervals as
specified by the updateRate ( in milliseconds). The minimum update rate is 2000 milliseconds.
The exception to this is a request for Agent statistics. The update rate is a minimum of 1000 ms.
The server does not send updates more frequently than updateRate; however, updates can take
longer than the specified rate depending on the load on the server.
The callback function is invoked whenever new data arrives from the server.
NIrdt_stopDataStream()
This function is used to cancel the flow of data updates previously initiated by
NIrtd_startDataStream().
ULONG NIrtd_stopDataStream( NIrtd_tAPIauth *authorization, NIrtd_tRequestId requestId);
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
*requestId The requestId that was obtained from NIrtd_startDataStream().
NIrtd_logout()
This function is used to log off from the server.
ULONG NIrtd_logout(NIrtd_tAPIauth *authorization)
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
NIrtd_getNameCacheforDataColumn()
This function obtains the current list of names and IDs for the given column and places them into
a cache structure for quick access using the NIrtd_getName function.
ULONG NIrtd_getNameCacheforDataColumn(NIrtd_tAPIauth* authorization, NIrtd_tColumnId
column );
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
column The ID of the table column.
NIrtd_getName()
This function translates a column ID and value into a name. The name structure is allocated by
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
column The ID of the table column.
*value A pointer to an NIrtd_tValue structure that contains the value to retrieve the name
for. (For example, the value of the column as retrieved from NIrtd_getCol.)
*name A pointer to a structure to contain the name retrieved.
NIrtd_getFailedName()
When getting the name from the name cache has failed in the call to NIrtd_getName(), this function
translates a column ID and value into a name. The name structure is allocated by the calling
application and is updated to contain the first and last name of the value. Where only one name is
appropriate (such as application and skillset names), the last name contains the name and the first
name is set to a null string.
ULONG NIrtd_getFailedName(NIrtd_tAPIauth *authorization, NIrtd_tColumnId column,
NIrtd_stValue *value, NIrtd_stName *name);
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_refreshNameCache()
This function refreshes the name cache. An image of the current name values is retrieved from the
server and is available for all future calls to NIrtd_getName(). This routine is useful when a number
of name changes occurred on the server but are not reflected in the current cache of names on the
API client. An application can make the call to NIrtd_refreshNameCache and thenusing a
background thread, go through all the IDs and names currently displayed and update them if
necessary.
ULONG NIrtd_refreshNameCache(NIrtd_tAPIauth *authorization );
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
NIrtd_removeNameCacheforDataColumn()
This function removes a name cache from memory that is no longer going to be used. When
NIrtd_logout is called, it removes all name caches associated with the server being logged off. The
NIrtd_removeNameCacheforDataColumn routine should be used when a cache is no longer
needed but the application will remain logged on to the server.
ULONG NIrtd_removeNameCacheforDataColumn( NIrtd_tAPIauth *authorization, NIrtd_tColumnId
column);
Parameter Description
*authorization A pointer to an NIrtd_tAPIauth structure.
NIrtd_tAPIauth is a semi-private data structure holding authorization information.
The authorization structure is obtained in the call to NIrtd_login.
column The ID of the table column.
NIrtd_interpAgentState()
Parameter Description
returnedAgentState The multi-state agent state value returned by the RTDAPI.
*ngccCallState The Contact Center call state:
eNGCC_ACTIVE = 0X00000100,
eNGCC_ONHOLD= 0X00000080,
eNGCC_NOTRDY= 0X00000040,
eNGCC_BRK= 0X00000020,
eNGCC_IDLE= 0X00000010,
eNGCC_RESERVE= 0X00000008,
eNGCC_CALL_PRESENT= 0X00000004,
eNGCC_CONSULTATION= 0X00000002,
eNGCC_EMERGENCY= 0X00000001
*dnOutCallState The DN Out call state:
eDN_OUT_ACTIVE= 0X00000400,
eDN_OUT_ONHOLD= 0X00000200,
eDN_OUT_ACTIVE_ONHOLD= 0X00000600
*dnInCallState The DN In call state:
eDN_IN_ACTIVE= 0X00001000,
eDN_IN_ONHOLD= 0X00000800,
*nacdCallState The NACD call state:
eNACD_ACTIVE = 0X00004000,
eNACD_ONHOLD = 0X00002000
*acdCallState he ACD call state:
eACD_ACTIVE = 0X00010000,
eACD_ONHOLD = 0X00008000
*walkawayState The Walkaway call state:
eNGCC_WALKAWAY= 0X00020000
NIrtd_setRecovery()
This function changes the amount of time to wait before declaring communication failure. The
full pull plug time is equal to the pullPlugTime plus the update rate. The wakeupGranularity
parameter is the frequency at which the RTDAPI layer wakes up and checks the
amount of time that has passed. The default is a pullPlugTime of 5 minutes with a
wakeupGranularity of 1 minute.
ULONG NIrtd_setRecovery( ULONG pullPlugTime, ULONG wakeupGranularity);
Parameter Description
ullPlugTime This time plus the update rate to wait before declaring communication failure with
the server and starting recovery actions.
Debug functions
NIrtd_getFirstLowError()
This function retrieves and resets the first lower level return code. This should be called whenever
an error code is returned by any API function. This internal lower level return code value is useful
for Avaya Technology in problem resolution. The third-party application should make this code
value available in some form. Note that this value is subject to being reset or updated in parallel
when dealing with a multithreaded, third-party application that makes calls with multiple threads to
the NIrtd API.
NIrtd_getCnt()
This function retrieves the number of objects allocated. This is primarily of use when trying to
ensure the RTD client is properly deallocating objects previously allocated.
int NIrtd_getCnt (NIrtd_cntType i);
Parameter Description
i The type of counter to be retrieved
/* Counter types */
typedef enum _NIrtd_cntType
{
QueryCnt, /* Number of queries */
ConjCnt, /* Number of conjunctions */
TGCnt, /* Number of Table Groups */
RowCnt, /* Number of Rows */
ValueCnt, /* Number of Values */
CacheCnt, /* Number of Name Caches */
NameCnt /* Number of Names */
} NIrtd_cntType;
Error codes
Real-time Data API Programmer’s
Guide
The following table lists the error numbers and their corresponding events (for debugging
purposes):
Introduction
This chapter goes through the basic skeleton of a RTDAPI application. It presents diagrams
showing the primary process flows. The source code for the sample is available from the SDK.
Application design
Basic skeleton
The following chart illustrates the basic skeleton of an RTDAPI application. The followingchart
illustrates the basic skeleton of an RTDAPI application.
Setup query
A query is a selection criterion consisting of a statistic table, columns to select, and the selection
condition.
A global skillset statistic cache (stat_list) is maintained within the application. The cache is
updated (add rows, delete rows, and update rows) based on the delta data stream from the server.
The cache content is sent to the console every time a data stream comes in from the server. This
program runs until the sleep_time (input argument) expires.
Other than the main function and the data stream callback function, four utility functions
(newRows, deleteRows, updateRows, and displayCache) are implemented. The following
sections describe each of the application functions, including the list of API functions used.
Programming tips
The RTDAPI is internally one thread that listens for data and calls the application’s callback
function. Two critical sections are used in the API code: one for the name database and one for the
database or real-time data registrations. This means that:
Only one thread can add, delete, change, or lookup real-time data registrations at any point
in time. This also means that the registration database is locked during the execution of the
application callback function.
Only one thread can add, delete, change, or lookup names at any point in time.
The following is the development advice, based on the preceding information:
Take the TableGroup data passed to the application callback function, place it in a queue,
and signal another thread to handle the displaying of the update.
You can refresh the name cache database using the same display thread as the one that
normally displays the data updates. Once refreshed, you can use a background thread to
re-display all the names on the screen. This means that the update thread and background
re-display thread alternate in being able to access the name database.
Be aware of how you use your own pointer, which you can pass and have passed back to
your application in the callback function. Think of the concurrence of its use. This means
ensuring that the data associated is read only so that when these API functions are later
upgraded to have multiple listening and callback threads, the callbacks can be executed
concurrently.
When the TableGroup information is passed to the application, most likely yourapplication
will want to maintain a list of items for display and will want to apply the new, deleted, and
delta items to this list. Keep in mind that the way to do this is to use the keys (agent telset