Cisco Cisco Computer Telephony Integration OS 8.5 Guide Du Développeur
8-26
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions
Cisco CTI OS Release 7.2(1)
Chapter 8 Session Object
Methods
SetAgent
The SetAgent method assigns an agent to this Session object. The agent object used as a parameter in
this method should have the following properties set:
this method should have the following properties set:
•
CTIOS_AGENTID
•
CTIOS_PERIPHERALID
Syntax
C++:
int
SetAgent(CAgent& agent)
COM:
HRESULT SetAgent(/*[in]*/IAgent *agent, /*[out, retval]*/ int * errorcode)
VB:
SetAgent (agent As CTIOSCLIENTLib.IAgent) As Long
Java:
int SetAgent(Agent agentObject)
.NET:
CilError SetAgent(Agent NewAgent)
Parameters
agent
The agent to be assigned to the Session object.
errorcode
An output parameter (return parameter in VB) that contains an error code from
Return Values
If the SetAgent request is successful, it returns a CIL_OK CtiOs_Enums.CilError code and sends an
OnSetAgentMode event to the client application.
OnSetAgentMode event to the client application.
In CTI OS Release 7.1(1) , the SetAgent request returns the following error codes:
•
CIL_FAIL - The request to authenticate failed. The SetAgent request will not be sent.
•
E_CTIOS_SET_AGENT_SESSION_DISCONNECT_REQUIRED - You attempted to execute
SetAgent for a session in monitor mode. The SetAgent request will not be sent. To correct, execute
the Disconnect method to disconnect the session, then execute the SetAgent method.
SetAgent for a session in monitor mode. The SetAgent request will not be sent. To correct, execute
the Disconnect method to disconnect the session, then execute the SetAgent method.
•
E_CTIOS_AGENT_ALREADY_IN_SESSION - You attempted to assign an agent that has already
been assigned to this session. The SetAgent request will not be sent.
been assigned to this session. The SetAgent request will not be sent.
Note
In the above error cases, the SetAgent request will not be sent to the CTI OS server, and the client
application will not receive any events in return.
application will not receive any events in return.
•
CIL_OK - The SetAgent request was sent to the CTI OS server.
In Java only, if SetAgent () is called on a session where the current agent is different from the agent that
SetAgent is trying to set, the following occurs:
SetAgent is trying to set, the following occurs:
•
The CIL automatically does a Disconnect on the current session object to Reset an agent.
•
An OnCloseConnection event is received.
•
A Connect is then performed.
•
An OnConnection event is received, and the new agent is set.