cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5901
Views
0
Helpful
18
Replies

HTTP request from Finesse desktop

satish.gunjal
Level 1
Level 1

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?

18 Replies 18

dekwan
Cisco Employee
Cisco Employee

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

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?

WorkFlow Action.JPG

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

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.

WorkFlow Action1.JPG

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.

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

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?

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

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?

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

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.


CrmUrlCall - Google Drive

Finesse Logs - Google Drive

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

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.

CrmUrlCall - Google Drive

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

Ok. Thanks for your help.