Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 490
   
8-15
CTI OS Developer’s Guide for Cisco Unified Contact Center Enterprise
Release 8.5(3)
Chapter 8      Session Object
Methods
VB:
GetAllCalls (args As VARIANT)
Java:
Arguments GetAllCalls()
.NET:
Arguments GetAllCalls()
Parameters
args
COM /VB: A pointer to a VARIANT containing a SAFEARRAY of pointers to ICalls.
Return Values
COM/VB: Default CTI OS return values. See 
Java/.NET: Returns NULL if the value requested is not found or if there is an error. If the method 
succeeds, it returns a pointer or a reference to an Arguments array where each member has a string key 
that is the UniqueObjectID of a call and a value that is a reference to a CilRefArg that is a pointer to the 
call object.
C++: An empty Arguments array if the value requested is not found or if there is an error. If the method 
succeeds, it returns a pointer or a reference to an Arguments array where each member has a string key 
that is the UniqueObjectID of a call and a value that is a reference to a CilRefArg that is a pointer to the 
call object.
Remarks
The following sample C++ code illustrates how to take the array returned from GetAllCalls() and use it 
to access the corresponding calls in the CIL’s object cache. The example uses the C++ CIL.
Arguments &args = m_pSession->GetAllCalls() ;
// Iterate through all of the CILRefArg objects
// in the Arguments array.
//
for ( int i = 1 ; i <= args.NumElements() ; i++ )
{
    CILRefArg *pRefArg = NULL ;
    // Retrieve the CILRefArg at each position in the
    // array.
    //
    if ( args.GetElement(i, (Arg **)&pRefArg) )
    {
        if ( pRefArg != NULL )
        {
            // The value method will return a pointer
            // to the agent object referenced by the
            // CILRefArg.
            //
            CCall *pCall = (CCall *)pRefArg->GetValue() ;
            cout << "-- Call Properties --" << endl ;
            if ( pCall == NULL )
            {
                cout << "NULL" << endl ;
            }
            else
            {
                cout << pCall->DumpProperties().c_str() << endl ;