cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4467
Views
1
Helpful
8
Replies

Difference in Finesse 11 Dialogs?

snewmanNX
Level 1
Level 1

I have this code, which I have used for Finesse 10 and 10.5, works perfectly fine, I receive notifications any time a dialog is started (abbreviated for clarity):

user = new finesse.restservices.User({

   id: id,
   onLoad: handleUserLoad,
   onChange: handleUserChange
});


Then in the handleUserLoad I have this bit:


dialogs = user.getDialogs({

   onCollectionAdd: handleNewDialog,
   onCollectionDelete: handleEndDialog,
   onLoad : handleDialogsLoaded
});


And of course handleNewDialog gets called whenever a call comes in. This works perfectly in Finesse 10 & 10.5. However, in Finesse 11 the handleNewDialog & handleEndDialog functions are never called. It calls handleUserChange when a new call comes in or is disconnected and that's all.


Did something change? Has anyone else had this issue?

Thanks!

8 Replies 8

ewindgat
Level 5
Level 5

yes, there was a change in Finesse 11.

If you are using IE, compatibility mode is set to IE 8 is your network has compatibility mode set to on. The other issue is Finesse does not support IE 8.

If this is your issue, the event handlers in JavaScript are different in IE 8, than in other versions. So, your delegates to 'handleUserLoad' event might fail.

Try seeing if it works in Firefox. Debug in IE with the developer toolbar, and see if <meta compatibility> is set to IE 8.

Thanks, I'm not using IE8 or IE at all. I'm using Firefox and Chrome on a Mac. I did figure out that there seems to be a different way to initialize finesse.gadget.Config now. The old way I was using on 10.x was causing 11 to fail to initialize correctly.

Now I get the events but the weird thing is the first time a call comes in I do not receive the onCollectionAdd event in the Dialog, only the onLoad. The second time a call comes in, the onCollectionAdd fires correctly. I'm still working to figure this one out.d

Thanks for the reply.

How did you get onLoad to fire with the Finesse 11.0.1 JS library?? I'm having the same problems trying to migrate 10.5 gadgets to 11.0. My current workaround is to just use the finesse-10.5.1.js library in Finesse 11.0.1, which seems to work.

Do you mean for the User or Dialog?

User seems to be no problem. If I put in onLoad in the user.getDialogs(......) call, it fails every time if you call it from your onUserLoad callback. If instead you put the user.getDialogs(....) code in the onUserChange (when they change states) onLoad fires with no problem, but the onNewDialog call never fires.

I'm thinking there's got to be a mix of the two that will make it work in both situations. Still researching.

I am working to post a 11.0 version of the sample gadget as soon as I can. I am shooting to have it up by the middle of next week.

dekwan
Cisco Employee
Cisco Employee

The sample gadget for 11.0 with updated instructions has been posted: https://github.com/CiscoDevNet/finesse-sample-code/tree/master/LearningSampleGadget 

dekwan
Cisco Employee
Cisco Employee

I wrote a blog on how to convert the 10.5.1 gadgets to 10.6.1 and 11.0.1, I hope this helps!

How to convert your existing 10.5.1 custom gadget to work with 10.6.1 or 11.0.1

Here's what I found:

Put this in your handleUserLoad function:

dialogs = user.getDialogs({

  onCollectionAdd: handleNewDialog,
  onCollectionDelete: handleEndDialog,
  onLoad : handleDialogsLoaded
});


That will call "handleNewDialog" every time a call comes in. The "onLoad" function does not get called, I don't know why but I would assume it's because handleNewDialog has already handled it.


If you need the "handleDialogsLoaded" to be called, put this in your "handleUserChange" callback:


if (!_isLoggedIn && state !== states.LOGOUT) {

  _isLoggedIn = true;
  handleDialogsLoaded();
}

That will call "handleDialogsLoaded" on the first call, but not after that because of the _isLoggedIn flag. Obviously you can modify the "if" statement and it will be called every time. Note that  on the first call, "handleNewDialog" will be called, followed by "handleDialogsLoaded", once they answer the phone.

handleDialogsLoaded would look something like this:

var dialogCollection, dialogId;
//Render any existing dialogs
dialogCollection = dialogs.getCollection();
for (dialogId in dialogCollection) {

   if (dialogCollection.hasOwnProperty(dialogId)) {

   _processCall(dialogCollection[dialogId]);
   }

}

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: