Make agent confirm after clicking End Call button

Using the embeddable framework, I have edited the framework.js file to add an event listener on the End Call button. For example:

endCallButton.addEventListener('click', confirmEndCall);

function confirmEndCall(event) {
    if(confirm("Do you really want to end the call?")) {
          return true;
    } else {
         event.preventDefault();
         event.stopPropagation();
         event.stopImmediatePropagation();
         return false;
    }
}

I know the event listener is working because I receive the confirmation prompt. But the call still ends, regardless of what I choose in the confirmation, or even if I don't answer the confirmation, the call will end in the background. I have tried the following code in my confirmEndCall function, to try and simply make the End Call button do nothing:

function confirmEndCall(event) {
     event.preventDefault();
     event.stopPropagation();
     event.stopImmediatePropagation();
     return false;
}

There is an event available in the embeddable framework for when the call ends, which I can subscribe to, but by the time that event fires, it's too late and the call has already ended. Is there an event such as beforeEndCall? Or any other creative solutions anyone has to stop the call ending immediately when the button is clicked.

Hello,

There is unfortunately no possibility at this time to intercept an EndCall (request), and process or cancel/ignore it.

The subscribe in Embeddable Framework is meant to trigger/execute some code when the call is connected/disconnected/... (to make a query to an external system, to atuomatically post some data when the call is ended, ...)
But it is not meant to be a way to check if a command can be executed and either be processed or cancelled/ignored.

What you have used adding an eventListener is not a method supported and documented for the Embeddable Framework.
Other click listener (the built-in one) is probably triggered before the one you have added.

I am not sure there is an Idea that already exists for your scenario.
But you can request new features and share your use case at https://genesyscloud.ideas.aha.io/

Regards,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.