Implementing the One-Click Outbound Call Function
When an enterprise page is integrated into the multi-tenant framework of the CEC, an agent can click a customer's phone number on the enterprise page to make an outbound call by one click, without entering the phone number. The agent status on the connection bar is consistent. The outbound call function can be invoked on a third-party page integrated into the multi-tenant framework, as shown in Figure 1.
The one-click outbound call function supports only external pages whose Open Mode is set to Embed in the New Incoming Call Pop-up Screen dialog box. For details about the setting, see Figure 1.
For example, an inbound call screen pop-up path is configured for a tenant space. On the enterprise page loaded after the agent workbench is opened, you can make an outbound call by one click. The API parameters are transferred. The API reference code is as follows. For details about the name and parameters of the API, see CC-Gateway Development Guide.
let targetOrigin =gettUrlParam()['origin']; function sendMsg(){ let ele =document.getElementById("calloutinput"); let data={'name':'callout','param':[]}; let number =ele.value; data.param.push(number); data.param.push('audio'); top.postMessage(JSON.stringify(data),targetOrigin) } function gettUrlParam() { let url = location.href; let paraString = url.substring(url.indexOf("?") + 1, url.length).split("&"); let paraObj = {}; for (let i = 0; i < paraString.length; i++) { let j = paraString[i]; paraObj[j.substring(0, j.indexOf("="))] = j.substring(j.indexOf("=") + 1, j.length); } return paraObj; }
- A third-party system can invoke data in either of the following formats:
- The top.postMessage(JSON.stringify(data),targetOrigin) message is supported by the early connection bar and is compatible with the top.postMessage(data,targetOrigin) message.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot