edisonCrisostomo | 2022-04-08 02:40:41 UTC | #1
we have a requirement to disconnect the chat interaction when the client ends the chat session.
i tried using PATCH conversations/chat while setting the state to "disconnected", which sort of worked? it got the chat interaction disconnected, but it didn't allow the agent to assign a wrap up code.
is there a way to just trigger the disconnect button and still allow the wrap up to pop up so that the agent code select the appropriate wrap up code?
fransiska.hendra | 2022-04-09 01:26:03 UTC | #2
Hi,
How do you integrate PureCloud softphone with Salesforce, is it using Embedded Framework ? We're using Embedded Framework hook in Salesforce using Apex (visualforce & class), put all javascript & html there.
If you using embedded framework, you can disconnect chat with javascript (no need API), put a button in salesforce page, and call following function. Need to use postmessage function as embedded framework is iframe inside Salesforce page.
function updateInteractionState(event) { var lastInteractionPayload = JSON.parse(document.getElementById("interactionSubscriptionPayload").value); var interactionId; if (lastInteractionPayload.data.interaction.old){ interactionId = lastInteractionPayload.data.interaction.old.id; }else { interactionId = lastInteractionPayload.data.interaction.id; } let payload = { action: event.target.outerText, id: interactionId };
var jsonClick =JSON.stringify({type: 'updateInteractionState', data: payload}); const frameArr1 = window.top.frames; for (let i = 0; i < frameArr1.length; i++) { postMessageRecursive(frameArr1[i], jsonClick, "*"); } }
function postMessageRecursive(iframe, msg, targetOrigin) { iframe.postMessage(msg, targetOrigin); if (iframe.frames.length > 0) { for (let i = 0; i < iframe.frames.length; i++) { postMessageRecursive(iframe.frames[i], msg, targetOrigin); } } }
edisonCrisostomo | 2022-04-11 08:18:27 UTC | #3
Hi fransiska
we're using the "Genesys Cloud for Salesforce" managed package installed in salesforce.
Cheers
system | 2022-05-12 08:19:25 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 14232