11-03-2021 06:39 AM
Hello,
I created a simple custom gadget to do a call pop. It's a custom gadget so it will only open a web page if the call number is greater than 4 digits so we don't pop for internal calls.
The problem is that if I don't pickup the phone right away it's running multiple times and opening the page several times. It looks to me that the server is sending the call message to Finesse over and over until the user picks up and the gadget is being re-initialized each time. There's a global call counter in the gadget but it's getting reset back to zero for each message.
Can anyone give me a pointer how to prevent this from happening.
11-03-2021 07:13 AM
Hi,
I ran into same issue for different custom gadget and unable to find solution. Will keep looking this thread for any solutions:)
Thanks,
Sreeni
11-03-2021 10:59 AM
Hi,
Where in your custom gadget are you triggering the call pop? It should be in the "handleNewDialog". This part of the code should only be triggered once per call. So when the call is ringing, it should not be triggered over and over.
> It looks to me that the server is sending the call message to Finesse over and over until the user picks up and the gadget is being re-initialized each time.
Finesse will send multiple dialog events per call due to changes to the call state (such as participant state, call state, media address, etc), which can happen when an agent receives a call, but it should not be sending an event if there are no changes. If you have the code being triggered when a new dialog arrives, then this shouldn't be an issue.
When you say "re-initialized", do you mean the gadget is actually refreshing? This shouldn't be the case. The gadget should only be refreshing when the browser itself is reloaded.
I'd suggest using the browser's debugger and putting a breakpoint to see exactly what is happening.
Thanx,
Denise
11-03-2021 11:18 AM
After debugging I can see handleNewDialog and handleEndDialog keep getting triggered over and over. I only have the code to open the url in handleNewDialog but it keeps gettting triggered.
handleUserLoad = function (userevent) {
// Get an instance of the dialogs collection and register handlers for dialog additions and
// removals
dialogs = user.getDialogs( {
onCollectionAdd : handleNewDialog,
onCollectionDelete : handleEndDialog
});
11-03-2021 11:55 AM
Hi,
That is not right for the two handlers to keep on getting triggered. Can you log what is in the event that is passed to the handler? Is it the same exact same dialog/call id? Take a look at the Finesse webservices logs and see if this matches?
Thanx,
Denise
11-04-2021 11:26 AM
It's the same dialog id each time it triggers it for one call. Another call will trigger it with a different dialog id.
For now I added a workaround. I added a lastDialogId var to the module and exit out of handleNewDialog if the last dialog id is the same. I will most likely be satisfied with this.
if (dialog.getId() === lastDialogId) return; lastDialogId = dialog.getId(); var fromAddress = dialog.getFromAddress(); var url = 'http://xxxx?' + fromAddress; window.open(url);
11-04-2021 01:18 PM
That is interesting. I have not seen that behavior.
The only way to debug further is for me to dig into logs and look at your actual browser and such. This would require a DevNet support ticket.
So, if your workaround is satisfactory, great! If you would like to debug further, please open a ticket.
Thanx,
Denise
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide