Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 500
   
8-14
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 7.5(1)
Chapter 8      Session Object
Methods
The following sample VB.NET code illustrates how to take the array returned from GetAllAgents() and 
use it to access the corresponding agents in the CIL’s object cache. The example uses the .NET CIL.
Dim args As Arguments
args = m_session.GetAllAgents()
' Iterate through all of the CILRefArg objects
' in the Arguments array.
'
Dim i As Integer
For i = 1 To args.NumElements()
    Dim refArg As CilRefArg
    ' Retrieve the CILRefArg at each position in the
    ' array.
    '
    If (args.GetElement(i, refArg)) Then
        If ((refArg Is Nothing) = False) Then
            ' The value method will return a reference
            ' to the agent object referenced by the
            ' CILRefArg.
            '
            Dim agent As Agent
            refArg.GetValue(agent)
            Console.Out.WriteLine("--")
            If (agent Is Nothing) Then
                Console.Out.WriteLine("Nothing")
            Else
                Console.Out.WriteLine(agent.DumpProperties())
            End If
            Console.Out.WriteLine("--")
        End If
    End If
Next
GetAllCalls
The GetAllCalls method returns an array of object IDs. Each object ID is associated with a Call object 
stored in the CIL.
The number of object IDs returned from this method depends on the number of calls that the CIL has 
discovered through call events. For example, a CIL used in an agent desktop application will return IDs 
for all calls in which the agent is involved. A supervisor desktop returns IDs for any call in which the 
supervisor is involved as well as IDs for monitored calls. A monitor mode application filtering all call 
events returns IDs for each call known by the CTI OS Server. 
Syntax
C++:
Arguments & GetAllCalls()
COM
HRESULT GetAllCalls(/*[out, retval]*/ VARIANT *args)