Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 546
 
Chapter 8      Session Object
Notes On Message Filters
8-34
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
server to request an event stream. The CTI OS server’s event filter parses the filter 
expression
, and registers the CIL client for all events that match any of the filter’s 
conditions.
To set a filter expression, the Session object’s SetMessageFilter() method is used:
‘put filter expression in here
Dim sFilterExpression As String 
‘call SetMessageFilter
m_session.SetMesageFilter sFilterExpression
The general form for a filter expression is key=value. 
A Simple Example
The most basic event filter is for all events for a specific agent. CTI OS uniquely 
identifies an agent object by it’s UniqueObjectID (refer to CIL architecture 
chapter for explanation of the UniqueObjectID). To establish an event stream for 
a unique agent, the following syntax would be used:
sFilterExpression = “UniqueObjectID=agent.5000.22866”
In this example, the key is the UniqueObjectID, and the value is 
agent.5000.22866
. This is the same filter expression which is implicitly 
created when a CIL client connects to CTI OS in Agent Mode.
General Form of Filter Syntax 
The event filter syntax can be expressed in the following general form:
key1=value1 [,value2, …] [; key2=valueA [,valueB, …] …]
In this form, the filter expression must start with a key name (key). Following the 
key must be an equal sign (=), and at least one value (value1) must be specified. 
Optionally, additional values (e.g. value2, …) for the same key might be 
specified (optional parts of the expression are indicated with square brackets []). 
This will be interpreted as a logical OR among all of the values specified for that 
key, e.g. if any of those values is found, the condition will be satisfied.
For example, a filter expression with one key and multiple values might look like 
the following: