Showing results for 
Search instead for 
Did you mean: 

Finesse Gadget - How to determine if there is an active Dialog

Gerry O'Rourke
Rising star
Rising star

I want to know if there is a call active - in a very similar vain to the Sample Call Recording Gadget.

In CCE it is possible to use the Agent State. If it is TALKING - then all good!

However in CCX unlike a CCE Finesse API - it only changes to a 'TALKING' state when on a call if it was routed by CCX.

So you cannot use this method on UCCX to confirm if the agent is active on a call.


The Call Recording Gadget - enables a button when there is a call active and disabled it when there is none.

It does this by checking if there is a active dialog.


However there is a bug in the code - if you make a consult transfer and then revert back to the call - the code believes there is no active call any more.


The below comments highlight that the sample code - likely has this issue where it states "Really need to handle this a little better...but this is just a sample. This doesn't handle multiple calls properly. _dialog = dialog;"


My query is - what is the simplest way on CCX to check if there is an active dialog?


     *  Handler for additions to the Dialogs collection object.  This will occur when a new
     *  Dialog is created on the Finesse server for this user.
     _handleDialogAdd = function(dialog) {
        _clientLogger.log ("_handleDialogAdd() - dialog.getId(): " + dialog.getId());

        // Really need to handle this a little better...but this is just a sample.  This doesn't handle multiple calls properly.        
        _dialog = dialog;

        // add a change handler to the dialog
        dialog.addHandler('change', _handleDialogChange);



2 Replies 2

Cisco Employee
Cisco Employee



There are two options I can think of.


1. Have a global variable that keeps track of the number of calls the agent has. Basically, whenever _handleDialogAdd is triggered, increment it and when the _handleDialogDelete is triggered, reduce it. Or just have a boolean of true/false if that is all you need to know. Of course, since this is client side logic, it will reset when the gadget is reloaded or if the agent logs in while they have an existing call.


2. I haven't actually tried this, but the getDialogs method should be returning the list of current dialogs. I would assume that from that return object, you can get a count of how many dialogs are in that list.





Thanks - I will give that a go!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: