Updated on 2025-03-31 GMT+08:00

API Invocation Process

This section describes the process of invoking APIs for a click-to-dial call between a customer and an agent. Detailed procedure and API description help developers understand how to use the AICC APIs to implement voice and video click-to-dial between customers and agents. The following describes the entire process of click-to-dial.

Figure 1 Click-to-dial process

1. In the click-to-dial scenario, a customer must have been connected to an agent through a multimedia message.

2. Before a customer uses the click-to-dial function, the ckheckClickToCallSupport API needs to be invoked to check whether the current tenant space supports the click-to-dial function. If the current tenant space does not support click-to-dial, the click-to-dial ends.

3. If the tenant space supports the click-to-dial function, the createClickToCall API needs to be invoked to create a click-to-dial call. After the click-to-dial call is created, the AICC preoccupies an agent.

4. After a click-to-dial call is created, the getClickToCallEvents API is polled to obtain the corresponding event.

There are five types of events: call setup success event, call queuing event, call queuing timeout event, call release event, and call failure event. If a call setup success event is obtained, the connection between the agent and customer is normal and the call can be connected. If a call queuing event is obtained, the call is still in progress. If a call queuing timeout event or call failure event is obtained, the click-to-dial call fails. If a call release event is obtained, the call ends.

5. After a connection success event is obtained, a WebRTC call needs to be started on the customer view. At this time, the customer is connected to the agent.

6. The click-to-dial call is connected. The agent can have a voice or video call with the customer.

7. When the call ends, the dropClickToCall API is invoked to release the click-to-dial call. At this time, the click-to-dial call ends.

After a call connection success event is obtained, a WebRTC call needs to be started. A third party needs to adapt the agent software to the WebRTC gateway.