cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2588
Views
5
Helpful
15
Replies

finesse screen pop

mightyking
Level 6
Level 6

Hello Everyone,

I am having trouble displaying a Pop Up  page within the Finesse agent desktop. I downloaded the ScreenPopSampleGadget-Finesse-10.6.1-v1.0 and uploaded the following 3 files into the UCCX server using the 3rdpartygadget account.

ScreenPop.css

ScreenPop.js

ScreenPop.xml

 

Attached is what I get when a call is answered. I am supposed to be able to open an internal page.  

 

Anyone experienced the same issue?

 

Version: 10.6.1.11001-31

 

Thanks,

 

Mk

 

15 Replies 15

Anthony Holloway
Cisco Employee
Cisco Employee
You didn't mention how you handled the workflow action.

Hi Anthony,

Please find attached the workflow action.

 

Thanks,

 

MK

Handled by Other is required for a Gadget to pick up the pop.

Thanks Anthony,

I modified the handled by to Other but no luck.

 

Here's the .js file I use to upload to the UCCX (Finesse) server). I modified the URL to Cisco.com

 

var finesse = finesse || {};

finesse.gadget = finesse.gadget || {};

finesse.container = finesse.container || {};

clientLogs = finesse.cslogger.ClientLogger || {}; // for logging

 

// Gadget Config needed for instantiating ClientServices

/** @namespace */

finesse.gadget.Config = (function () {

var _prefs = new gadgets.Prefs();

 

/** @scope finesse.gadget.Config */

return {

authorization: _prefs.getString("authorization"),

country: _prefs.getString("country"),

language: _prefs.getString("language"),

locale: _prefs.getString("locale"),

host: _prefs.getString("host"),

hostPort: _prefs.getString("hostPort"),

extension: _prefs.getString("extension"),

mobileAgentMode: _prefs.getString("mobileAgentMode"),

mobileAgentDialNumber: _prefs.getString("mobileAgentDialNumber"),

xmppDomain: _prefs.getString("xmppDomain"),

pubsubDomain: _prefs.getString("pubsubDomain"),

restHost: _prefs.getString("restHost"),

scheme: _prefs.getString("scheme"),

localhostFQDN: _prefs.getString("localhostFQDN"),

localhostPort: _prefs.getString("localhostPort"),

clientDriftInMillis: _prefs.getInt("clientDriftInMillis")

};

}());

 

/** @namespace */

finesse.modules = finesse.modules || {};

finesse.modules.SampleGadget = (function ($) {

var numDialogs = 0; // used to count the calls (dialogs)

var callvars = new Array(); // the callvars array of callvariables

var user, states, dialogs,

 

/**

* Populates the fields in the gadget with data

*/

render = function () {

var currentState = user.getState();

// html is initially blank

var html = '';

// add a div tag to the html

html += '<div>';

 

// for debugging you could print out the agent state and the number of calls (Dialogs)

//html += '<div id="agentstate"> The current state is: ' + user.getState() + '</div>';

//html += '<div id="dialogcount"> The number of dialogs is: ' + numDialogs + '</div>';

 

if (numDialogs==1) {

 

// if we were triggered by a new call (numDialogs==1) then set the html to the url we want to pop in the iframe

// build the url by adding the callvariable 1 into the search parameter

html += '<iframe src="http://cisco.com/search/web?fcoid=417&fcop=topnav&fpid=27&q=' + callvars["callVariable1"] + '" width="100%" height="650"> </iframe>';

// comment out the above line and uncomment the line below to change the search engine to bing

//html += '<iframe src="http://www.bing.com/search?q=' + callvars["callVariable1"] + '" width="100%" height="650"> </iframe>';

// note: google search won't allow an iframe, yahoo search has errors too

 

 

// add the closing </div> html element

html += '</div>';

 

clientLogs.log(html); // for debugging

//set the html document's agentout element (see the html after the /script tag) to the html we want to render

$('#agentout').html(html);

 

// automatically adjust the height of the gadget to show the html

gadgets.window.adjustHeight();

 

}

else {

// we don't have a call yet

html += 'Screen Pop Goes here';

html += '</div>';

 

//set the html document's agentout element to the html we want to render

$('#agentout').html(html);

 

// automatically adjust the height of the gadget to show the html

gadgets.window.adjustHeight();

 

}

 

 

 

},

 

_processCall = function (dialog) {

// if here then callvar1 didnt show up on initial dialog

// get the latest callvariables

callvars = dialog.getMediaProperties();

clientLogs.log("_processCall:cv1="+callvars["callVariable1"]);

render();

 

},

 

/**

* Handler for additions to the Dialogs collection object. This will occur when a new

* Dialog is created on the Finesse server for this user.

*/

handleNewDialog = function(dialog) {

// increment the number of dialogs

numDialogs++;

 

// get the call variable data from the dialog

// dialog.getMediaProperties() returns an array of properties

callvars = dialog.getMediaProperties();

 

clientLogs.log("handleNewDialog:cv1="+callvars["callVariable1"]);

// if callVariable1 is null then add a handler for subsequent dialog events

// where the call data will have been updated

if (callvars["callVariable1"] == null )

{

dialog.addHandler('change', _processCall);

}

else

{

// render the html in the gadget

clientLogs.log("rendering dialog");

render();

}

 

 

},

 

/**

* Handler for deletions from the Dialogs collection object for this user. This will occur

* when a Dialog is removed from this user's collection (example, end call)

*/

handleEndDialog = function(dialog) {

 

// decrement the number of dialogs

numDialogs--;

 

// render the html in the gadget

render();

},

 

 

 

 

/**

* Handler for the onLoad of a User object. This occurs when the User object is initially read

* from the Finesse server. Any once only initialization should be done within this function.

*/

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

});

 

render();

},

 

/**

* Handler for all User updates

*/

handleUserChange = function(userevent) {

 

};

 

/** @scope finesse.modules.SampleGadget */

return {

 

 

 

 

/**

* Performs all initialization for this gadget

*/

init : function () {

var prefs = new gadgets.Prefs(),

id = prefs.getString("id");

 

var clientLogs = finesse.cslogger.ClientLogger; // declare clientLogs

 

gadgets.window.adjustHeight();

 

// Initiate the ClientServices and the logger and then load the user object. ClientServices are

// initialized with a reference to the current configuration.

finesse.clientservices.ClientServices.init(finesse.gadget.Config);

clientLogs.init(gadgets.Hub, "ScreenPop", finesse.gadget.Config); //this gadget id will be logged as a part of the message

user = new finesse.restservices.User({

id: id,

onLoad : handleUserLoad,

onChange : handleUserChange

});

 

states = finesse.restservices.User.States;

}

};

}(jQuery));

 

Oops! I just realized you're using this particular screen pop gadget, which does not need the Workflow at all. Instead, it's just looking for what's inside of the callVariable1. From your first screenshot, I cannot see if callVariable1 was populated or not. Can you call yourself and then answer, and then hang up, and then click the Send Error Report button, and then grab the log file from the UCCX server (RTMT or CLI). If from CLI it will be in file list activelog desktop/logs/clientlogs. This log file will show the URL and some other sensitive information, so you may need to sanitize it first, or just copy out the callVariable1 field and value (it will be in an XML format in the log file).

Hello Anthony,

I am attaching the log files taken from CLI of the Finesse server. Do you see anything that could help to resolve the pop up issue?

 

Thanks,

 

MK

So it looks like your callVariable1 is coming to Finesse as:  

<name>callVariable1</name><value>https://atlas.loto-quebec.com/</value>

 

In which case the JS file line you showed as an example here:

html += '<iframe src="http://cisco.com/search/web?fcoid=417&fcop=topnav&fpid=27&q=' + callvars["callVariable1"] + '" width="100%" height="650"> </iframe>';

 

Would actually need to look like this, because the entirety of the URL is in the variable callVariable1:

html += '<iframe src="' + callvars["callVariable1"] + '" width="100%" height="650"> </iframe>';

 

Anthony,

After mofiying the .js file, I still get the blank screen after answering the call. .

I use Cisco.com as the vlaue for callvarialbe1 in the script. Please find attached the screen capture.

 

Thanks,

 

MK

Try accessing an HTTPS site maybe? Perhaps the mixing of secure and non-secure content is the problem?

E.g.,
https://www.cisco.com/

In the meantime I'll have another look at the logs you sent.

Looking back at the original logs, I can actually see that the URLs were doubling up. 

Nov 28 2018 10:16:16.542 -0500: ScreenPop : <div><iframe src="http://www.cisco.com/search/web?fcoid=417&fcop=topnav&fpid=27&q=https://atlas.loto-quebec.com/" width="100%" height="650"> </iframe></div>

 

Depending on how you modified and uploaded the new gadget JS file, Finesse could be caching the old one.  I'd recommend just creating a new folder for the update, and then modify your Desktop Layout to reference the new folder.

 

E.g.,

If your original gadget was here:

<gadget>/3rdpartygadget/files/HelloWorld/v1/HelloWorld.xml</gadget>

 

Then you'd put the modified files here:

<gadget>/3rdpartygadget/files/HelloWorld/v2/HelloWorld.xml</gadget>

 

This prevents running into caching issues.

HI Anthony,

It looks like changing the http to https and modifying the location of the .js file partially resolved the issue. Attached is what I am getting as a pop up. I tried the same with Chrome and Firefox and get and a blank screen using Cisco.com

The internal page that we need to display shows a blanck page with nothing Inside.

 

Thanks,

 

MK

Can you do it again, and send the logs one more time? I'm afraid we might be reaching the end of my ability to troubleshoot this. But let's see.

Here you go!

I don't see a recent example in those logs from today.  I do see the attempt from Nov 28th in there though.