09-12-2017 12:15 AM
How can we setup an HTTP request to be sent from the Finesse desktop and not the server?
Example - a customer has a local application running on each PC listening on port 36729 for HTTP requests. We'd like to setup the Finesse workflow to run an HTTP request to the local Finesse desktop client's IP address on call arrival. If we send the HTTP request (http://localhost:36729/?CID=CISCO9876), will it execute from the Finesse server or from the desktop?
09-12-2017 12:31 PM
Hi,
If you select Handled By: Finesse Desktop, then it will be executed by the desktop. Another option is to create a custom gadget that executes REST APIs using the finesse.js makeRequest or the shindig's makeRequest.
Thanx,
Denise
09-14-2017 03:36 AM
Hi Denise,
HTTP URL to call on call arrival is : http://localhost:36729/?CID=CISCO9876&ANI=<ani>&DNIS=<dnis>
In work flow action preview url is getting prefixed with http://localhost:8082 (is this correct?>)
Also please confirm whether Location and Content type values are correct in below snap.
On call arrival, C4C CRM not receiving any HTTP request. How to trouble shoot whether Finesse is invoking correct url and response received from far end?
09-14-2017 09:21 AM
Hi Satish,
I do not know if the content type is correct as it is the content type of your CRM HTTP request. The location should be "Other" so that it doesn't append the http://localhost:8082 to the url.
Thanx,
Denise
09-15-2017 03:21 AM
Hi Denise,
I am able to send HTTP request to C4C CRM using 'Browser Pop' action and able to receive data in C4C. But same is not working using 'HTTP Request' action.
My HTTP request action details are as below.
Log snippet from catalina.out
INFO: Failed to update undefined. Using cached version.
Sep 15, 2017 9:39:36 AM org.apache.shindig.gadgets.AbstractSpecFactory$SpecUpdater run
INFO: Failed to update undefined. Using cached version.
Sep 15, 2017 9:40:14 AM org.apache.shindig.gadgets.http.BasicHttpFetcher fetch
INFO: Timeout for http://localhost:36729/?CID=CISCO9876&ANI=9930136022 Exception: org.apache.http.conn.HttpHostConnectException - Connection to http://localhost:36729 refused - 3ms
Sep 15, 2017 9:54:26 AM org.apache.shindig.gadgets.http.BasicHttpFetcher fetch
INFO: Timeout for http://localhost:36729/?CID=CISCO9876&ANI=9930136022 Exception: org.apache.http.conn.HttpHostConnectException - Connection to http://localhost:36729 refused - 2ms
Sep 15, 2017 9:54:26 AM org.apache.shindig.gadgets.AbstractSpecFactory$SpecUpdater run
INFO: Failed to update undefined. Using cached version.
According to logs "Connection to http://localhost:36729 refused" but HTTP call to above url is working from a browser on the same PC!. Is Finesse desktop really invoking this request from local PC or it is getting invoked from Finesse server??
UCCX version is 10.6.
09-15-2017 10:14 AM
Are you sure that URL can be done as a POST REST request? If it is working off the browser, that would be a GET. What happens if you make that REST (http://localhost:36729/?CID=CISCO9876&ANI=9930136022) request using a REST client such as Postman? Does it work?
Thanx,
Denise
09-17-2017 11:54 PM
Hi Denise,
Yes, URL method type is 'GET' not 'POST'!!
I have also tried calling this 'GET' method type URL using External REST API Sample Gadget but received a timeout error.
Log snippet from catalina.out
INFO: Failed to update undefined. Using cached version.
Sep 18, 2017 5:30:47 AM org.apache.shindig.gadgets.http.BasicHttpFetcher fetch
INFO: Timeout for http://localhost:36729/?CID=CISCO9876&ANI=9930136022 Exception: org.apache.http.conn.HttpHostConnectException - Connection to http://localhost:36729 refused - 3ms
What is the best way to call a URL of type 'GET' from Finesse desktop and not from Finesse server?
09-18-2017 10:33 AM
Hi,
I looked into it and you should be able to use the JavaScript XMLHttpRequest class to call your url: XML DOM - HttpRequest object
Thanx,
Denise
09-20-2017 04:28 AM
Hi Denise,
Using below JavaScript code I am able to successfully send data to C4C CRM page. How to embed this in Gadget Javascript file(e.g. ExternalRestApiSampleGadget.js) so that it will get invoked on every call arrival.
var httpRequest = new XMLHttpRequest();
httpRequest.onreadystatechange = function() { if (xhr.readyState == XMLHttpRequest.DONE) {
clientLogs.log(xhr.responseText);} };
httpRequest.open("GET", "http://localhost:36729/?CID=CISCO9876&ANI=9930136088", true);
httpRequest.send(null);
How to access the logs written using 'ClientLogger' from Gadget JavaScript file?
09-20-2017 10:55 AM
Hi,
How to embed this in Gadget Javascript file(e.g. ExternalRestApiSampleGadget.js) so that it will get invoked on every call arrival.
Put the code into a function and call the function when the call arrives (handleNewDialog).
How to access the logs written using 'ClientLogger' from Gadget JavaScript file?
The agent must push the "Send Error Report" link at the lower right so that it can get uploaded to the Finesse server. Then you retrieve the Finesse logs and it can be found in the clientlogs folder.
Also, you can see these messages being logged in the browser's console if you use the browser's developer tools.
Thanx,
Denise
09-21-2017 05:14 AM
Hi Denise,
I have referred "ExternalRestApiSampleGadget" to create 'CrmUrlCall' gadget. Since "ExternalRestApiSampleGadget" supports Finesse version starting 11.0(1) I am not sure functions I used in "CrmUrlCall" are supported for Finesse 10.6 version.
I have added 'CrmUrlCall' in Finesse and during testing, I have clicked on "Send Error Report" link but in client logs, there are no details about 'CrmUrlCall'!
gadget code and client logs attached for your reference.
09-21-2017 10:23 AM
Hi,
If you are using 10.6, you can take the 11.0 file and reverse the steps found in this blog: How to convert your existing 10.5.1 custom gadget to work with 10.6.1, 11.0.1/11.5.1/11.6.1
In the CrmUrlCall file you attached, it seems to be a mashup of the 10.6 format and the 11.0+ format. For the init of your file, I would recommend using the init of the 10.6 learningsamplegadget's SampleGadget_Final.js.
Thanx,
Denise
09-22-2017 03:47 AM
Hi Denise,
I have modified the gadget code but still no luck. In client log only gadget rendering details are available.
Can you please have a look at the Javascript file.
09-25-2017 10:47 AM
Hi,
Make sure that Finesse is loading your latest upload of the gadget. The caching is very stubborn. Try to use the nocache option.
If it is still an issue, I would recommend opening a developer support ticket here because it will require a more 1 on 1 direct debugging discussion: Cisco DevNet: DevNet Developer Support
Thanx,
Denise
09-26-2017 09:48 PM
Ok. Thanks for your help.
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