Cisco Cisco Computer Telephony Integration Option 8.5 Guia Do Programador

Página de 500
   
9-17
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 9      Agent Object
Methods
     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.
HRESULT hr = S_OK;
VARIANT varSkills; 
VariantInit(&varSkills)