Cisco Cisco Computer Telephony Integration Option 8.5 Developer's Guide

Page of 500
   
9-17
CTI OS Developer’s Guide for Cisco Unified ICM/Contact Center Enterprise & Hosted
Release 7.5(1)
Chapter 9      Agent Object
Methods
    For i = 1 To 20
    If m_Agent.IsValid("SkillGroup[" & i & "]") Then
       Set argskills = m_Agent.GetValueArray("SkillGroup[" & i & "]")
       Log "SkillGroup[" & i & "]:" & argskills.DumpArgs
     Else
        Log "SkillGroup[" & i & "] args doesnt exist"
     End If
     Next i
Syntax 
C++:
 
Arguments  & GetSkillGroups();
COM:
  HRESULT GetSkillGroups (/*[out,retval]*/ VARIANT * pVariantArgs);
VB:
GetSkillGroups () As Variant
Java:
Arguments GetSkillGroups()
.NET:
Arguments GetSkillGroups()
Parameters
None.
Return Value
This method returns -1 if skillgroupstats is not enabled.
C++
In C++ the GetSkillGroups method returns an arguments array containing references to CSkillGroup 
objects.
Each element in the returned arguments array consists of a key/value pair, in which the element key is 
the Unique Object Id of the skill group object and the value is a reference to a CILRefArg object instance 
that contains the actual reference to a CSkillGroup object. To retrieve a reference to a skill group object, 
you need to do something similar to what is shown in the following code example.
Arguments & arSkills = m_Agent->GetSkillGroups();
if(Arguments::IsValidReference(arSkills)){
     for(int nI = 1; nI <= arSkills.NumElements(); nI ++){
         string strUOID = arSkills.GetElementKey(nI);
         CilRefArg & pRefArg = (CilRefArg &) arSkills.GetValue(strUOID);
          if(Arg::IsValidReference(*pRefArg)){
               CSkillGroup * pSkill = pRefArg->GetValue();
               pRefArg->Release();
               
               cout << “Skill Object (“ << strUOID << “) ;
               cout << “ Skill Group Number: ” <<  ;
                             pSkill->GetValueInt(CTIOS_SKILLGROUPNUMBER);
          }          
}
COM
In COM the GetSkillGroups method returns a pointer to a variant that encapsulates a Safearray where 
each element is a pointer to an ISkillGroup object.
To retrieve references to skill group objects you need to do something similar to what is shown in the 
following code example.