cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1057
Views
15
Helpful
6
Replies

Custom pop gadget reinitializing multiple times per call

RadDev01
Level 1
Level 1

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. 

6 Replies 6

smeegada1
Spotlight
Spotlight

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

dekwan
Cisco Employee
Cisco Employee

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

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
});

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

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);

 

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

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: