A Live Agent call when ended by an Agent using endChat toolkit api, it results in "Ended by Visitor" prompt
Trailblazer Community

A Live Agent call when ended by an Agent using endChat toolkit api, it results in "Ended by Visitor" prompt

Apex , Live Agent , Spring 15

Last updated 2018-04-13 ·Reference W-2572690 ·Reported By 0 users

Fixed

Summary
When Agent tries to end the Chat using a EndChat shortcut key, it always says 'ended by Visitor', whereas it should say 'ended by Agent'. If agent uses the End Chat button, everything shows correctly but when using the shortcut key that is tied to a javascript method that calls:
sforce.console.chat.endChat(chatKey, endSuccess);

The transcripts show that the chat was correctly ended by agent, but shows ended by Visitor in the console.

Repro
1/ create a VF page with the following content:
<apex:page >
<apex:includeScript value="/support/console/33.0/integration.js"/>
<a href="#" onClick="endChat();return false;">End Chat</a>

Methods for Live Agent endChat

<script type="text/javascript">
function endChat() {
sforce.console.getFocusedPrimaryTabId(showPrimTabId);
}
var showPrimTabId = function showPrimTabId(result) {
if(result.success) {
sforce.console.chat.getDetailsByPrimaryTabId(result.id, getSuccessDetails);
}
};
function getSuccessDetails(result) {
if (result.success) {
sforce.console.chat.endChat(result.details.chatKey);
}
};
</script>
</apex:page>


2/ create a custom console component (CCC) which use vf page created on step #1
3/ add this ccc in the console
4/ initiate a chat and accept it
5/ end the chat by using the end chat link from the ccc

--> notice end message notification is not correct, it is saying: 'chat session ended by visitor'

Workaround
Workaround is not available.

Reported By (0)

Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.