• jasmin menezes
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
When the two level load balancer used, say "agent.xyz.com" which will redirect to either "agent1.xyz.com" or "agent2.xyz.com" using round robin fashion. So "agent.xyz.com" is the first level loadbalancer url which is configured and say it is redirected to "agent1.xyz.com" so the window origin will be "agent1.xyz.com". 
We have a method "processPostMessage" in InteractionFramework.js there is a security check to verify the origin.

if (a.origin !== Sfdc.interaction.sofphoneEventOriginUrl) Sfdc.interaction.doPostMessage(null, null, LC.getLabel("InteractionApi", "InvalidSoftphoneIframeOrigin")); 

Since a.origin is "agent1.xyz.com" and sofphoneEventOriginUrl is "agent.xyz.com" the security check conditon fails . Hence we are unable to hit the saleforce api's. Since it is a load balancer we cant change the url's manually. Is there any other work arround to fix this.  

I just completed an integration using the OpenCTI.  Things work fine on my dev machine, fine on another developers machine, and fine on a test machine i had setup about a month ago.  The strange thing is that i just setup a new test machine so i could finish dev testing and now it is appearing that the remote calls through the api are not working.  So the first thing my integration does is check if it is in the console and then check the call center settings.  When i step into interaction.js for one of those, it appears that the post message to the host salesforce page is working as expected.  I don't know what is happening on the other end of the post message because the js is minimized to a huge pain to debug.  The callbacks that i set in my code aren't being called.  Also, when testing with the screenpop method, the screenpop never happens either, so it seems that the listener for the post messages isn't getting them.

 

To take out the possibility that my code is causing a problem, i went back to a test page i wrote which makes simple calls like in the examples of the api.  I have the same results.

 

Has anyone else run into this?  I find it strange that it works on my dev machine, but not a production machine.