cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1413
Views
3
Helpful
4
Replies

Trigger a 3rd party gadget to run on incoming call

Karen Atabekjan
Level 4
Level 4

Hi all,

Here is the behavior I am looking to achieve with Finesse 11.5 and UCCE 10.5. When a call comes is, a POST request with info from one of the call variables (customer ID) is passed to an external API which returns a certain piece of info. This info is then processed and displayed to an agent inside of Finesse.

I have first looked into workflows in Finesse, but got the impression it's too limited for the use case. For example, it's able to send a POST request, but not read the response or do anything with it.

The setup I am considering now would look as following:

3rd party gadget inside of Finesse would first call Finesse API (/User/{id}/Dialogs) to read the value of the relevant call variable. It then appends it to the POST request, reads the response and processes/visualizes it as necessary.

The question is, how can I have this procedure start with an incoming call, similar to how Finesse workflows are configured?

Thank you.

4 Replies 4

dekwan
Cisco Employee
Cisco Employee

Hi Karen,

I would take a look at the ScreenPopSampleGadget as an example on how to get the call variable to make the external API call. In this sample gadget, it will receive all of the dialog events for that user. Any new calls (incoming or outgoing) will go to the handleNewDialog method. In that method, you can filter out the incoming calls (can probably do something like fromAddress != agent extension). In the same method, after filtering out the incoming calls, you can grab the call variable that and pass it to the external API.

I hope this helps!

Thanx,

Denise

Hi Denise,

Thanks, ScreenPopSampleGadget seems to be exactly what I need.

I am still a bit confused by the jQuery syntax and how these dialog handlers work but I will figure this out.

Hi Karen,


The JS doc might be helpful for you to see what is available: https://developer.cisco.com/site/finesse/docs/guides/javascript-library/ It also defines each property so that might help too.


Here is a quick/basic explanation of how the handlers work:


In the init method, you see:

user = new finesse.restservices.User({

                id: cfg.id,

                onLoad : handleUserLoad,

                onChange : handleUserChange

            });

This is essentially saying that when the user is loaded (usually when the page is loaded or a refresh), execute the handleUserLoad function. When there is a change to the User object (name, state, etc where a new Finesse notification gets sent), then the handleUserChange function will be called.

Then for the dialog:

dialogs = user.getDialogs({

            onCollectionAdd : handleNewDialog,

            onCollectionDelete : handleEndDialog

        });

The onColllectionAdd is saying if there is a new call for the user, execute the handleNewDialog and when a call ends, the handleEndDialog function will be called.

I am not sure if this is what you are confused about, but I thought I would just put it out there for whoever needs it.

I hope this helps.

Thanx,

Denise

Hi Denise,

This helps a lot, thank you. I will work on this during the week and post any interesting outcomes in this thread.

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: