function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raheel IqbalRaheel Iqbal 

Salesforce Make A Call Error

Hi, 
I'm trying to integrate Cisco finesse call controls in my salesforce organization. I'm done with sign in and state transitions of agent but now stuck at making call. I'm receiving the following error to requesting make call api in apex:

IO Exception: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 503 Service Unavailable.

Check this code is anything wrong?
 
Http http = new Http();
HttpRequest request = new HttpRequest();

// Setting authorization header
Blob headerValue = Blob.valueOf(account + ':' + token);
String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
request.setHeader('Authorization', authorizationHeader);

request.setEndpoint('https://uccx1.dcloud.cisco.com:8445/finesse/api/User/' + account + '/Dialogs');
request.setMethod('POST');
request.setHeader('Content-Type', 'application/xml;charset=UTF-8');

// Set the body as a JSON object
request.setBody('<Dialog><requestedAction>MAKE_CALL</requestedAction><fromAddress>1081</fromAddress><toAddress>1080</toAddress></Dialog>');

HttpResponse response = http.send(request);
CallResult result = new CallResult();
result.status = response.getStatus();

return result;

 
Khan AnasKhan Anas (Salesforce Developers) 
Hi Raheel,

Greetings to you!

This error happens if your firewall doesn’t allow access to your server where the web service is hosted. Making the firewall changes should fix this issue.

In general, when you see an issue, follow this checklist to troubleshoot the issue:
  • Make sure you have the firewall settings in your enterprise is configured to allow the inbound web service call.
  • Check whether the certificate is expired or not.
  • Check if your chain of trust has valid certificates.

Also, check whether you have white-listed salesforce IP's in their proxy: http://www.salesforcegeneral.com/salesforce-articles/ip-whitelists-for-salesforce.html

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Raj VakatiRaj Vakati
This is a firewall issue where your web service is hosted.  When a request to the web service is made from Salesforce, it expects the response returned by the web service to come from the same IP address as when the request was made.  In our case, our IT had configured the firewall so that incoming request was going through one IP address, but outgoing response was going through another IP address.  Definitely, check with your IT to figure out a solution.  One possibility is to put the server hosting the web service outside of the firewall.

This has to be resolved at the client end to which you are making the webservice callout .
Ask your other Team who have created that webservice and check whether they have white-listed salesforce IP's in their proxy .The Proxy here is not allowing your request to reach the exact end point and its filtering request from the SFDC.

http://www.salesforcegeneral.com/salesforce-articles/ip-whitelists-for-salesforce.html

https://help.salesforce.com/articleView?id=000003652&type=1