11-26-2018 09:59 AM - edited 03-15-2019 06:43 AM
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
11-27-2018 08:17 AM
11-27-2018 08:46 AM - edited 11-27-2018 08:50 AM
11-27-2018 10:20 AM
11-27-2018 12:02 PM
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));
11-27-2018 01:57 PM
11-28-2018 08:25 AM
11-28-2018 08:33 AM - edited 11-28-2018 08:41 AM
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>';
11-28-2018 09:47 AM
11-28-2018 12:31 PM
11-28-2018 12:36 PM - edited 11-28-2018 12:37 PM
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.
11-29-2018 08:17 AM
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
11-29-2018 08:33 AM
11-29-2018 08:45 AM
11-29-2018 09:00 AM
I don't see a recent example in those logs from today. I do see the attempt from Nov 28th in there though.
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