Updated on 2024-03-05 GMT+08:00

Instance Introduction

This instance involves only the login, forceLogin, resetSkill, and getAgentEvent interfaces.

The following figure shows the business logic.

Figure 1 Agent event polling mode
Figure 2 Agent event push mode
  1. An agent invokes the login interface. If the value of retcode is 0, sign-in is successful. If the value of retcode is 100-002, the sign-in fails because the agent has signed in from another client. The agent can invoke the forceLogin interface to forcibly sign in. If the value of retcode is 0, forcible sign-in is successful.
  2. When the agent has successfully signed in, the CC-Gateway adds the Set-GUID header to the response headers of the HTTP request. The value of the Set-GUID header can be, for example, JSESSIONID=279fe21d-2caa-4437-84c3-ab9e9dae20f5.AgentGateway0. In the value, 279fe21d-2caa-4437-84c3-ab9e9dae20f5.AgentGateway0 is the GUID, which is used by the CC-Gateway to authenticate the interfaces invoked by the agent.
  3. After obtaining the GUID, the agent can invoke the resetSkill interface to sign in to a specified skill queue.
  4. As shown in Figure 1, the agent event polling mode is used. After signing in to the skill queue, the agent periodically invokes the getAgentEvent interface to obtain agent events in polling mode. This interface is not only used to obtain agent events, but also the heartbeat line between the agent and CC-Gateway.

    As shown in Figure 2, the agent event push mode is used. After the agent sign-in is successful and the skill queue sign-in is complete, the event is directly pushed to the callback address transferred during sign-in. The agent only needs to invoke the agent heartbeat interface to maintain the heartbeat between the CC-Gateway and the third-party callback address.

    When the CC-Gateway uses dynamic authentication, the GUID is dynamically updated. After the GUID is updated, a Set-GUID header is added to the response headers of the HTTP requests of the getAgentEvent interface and agent heartbeat interface. The agent needs to obtain and update the GUID accordingly and uses the new GUID when invoking other interfaces.