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
Karol Zaorski 15Karol Zaorski 15 

Uncaught Failed to initialize Open CTI. Ensure that it is loaded from the right frame with correct URL parameters

Hi,

I'm trying to create a Softphone on VisualForce and add it to Lightning app in utility bar.

However, when I add open cti script I recieve error as in the subject:
Uncaught Failed to initialize Open CTI. Ensure that it is loaded from the right frame with correct URL parameters

Page code
<apex:page showHeader="true" sidebar="true">
    <apex:includeScript value="/support/api/40.0/lightning/opencti_min.js"/>
</apex:page>

Anyone else had similar problems?

Regards,
Karol
Orhan YılmazOrhan Yılmaz
Hi,

Is solved this problem? I have a same problem. Can you help me?

Best regards,
Orhan
 
Karol Zaorski 15Karol Zaorski 15
Hi,

yes, you need to add sfdcIframeOrigin={lightning page origin} parameter to the URL of the VisualForce page.
Lighting page origin is the host of you lightning page e.g. https://your-domain-dev-ed.lightning.force.com.

Regards,
Karol
Orhan YılmazOrhan Yılmaz
Hi,

Thans you so much.

Regards,
Orhan
Braxtel TestBraxtel Test
Hi,

In the initialize function of the opencti.js, the sfdcIframeOrigin and mode parameters are missing and as a result initialization fails.

Are those parameters supposed to be added in "CTI Adapter URL" like /apex/TestClient?sfdcIframeOrigin=.....&mode= " in Call Center Definition file and if so what values do we expect?


Thanks
Stelios
Nirmallya_GhoshNirmallya_Ghosh

Hi Team, 

Can you please tell me where i need to add the below - 
sfdcIframeOrigin="{lightning page origin}" 

do i need to make any changes in VF or any Call center definition File ? Post an example please. 

Regards

Nirmallya

Anjali G 5Anjali G 5
Hi Karol
Can you please paste that url here? how you added sfdcIframeOrigin.
I am also getting same error. Please help
 
Lewis Graham 8Lewis Graham 8
Hi All,

it seems that lightning sends a few additional parameters in the URL:

Classic sends:
nonce
sfdcIFrameOrigin
isdtp


Lightning sends:
nonce
sfdcIframeOrigin
ltn_app_id
isdtp
mode


Note the case change in sfdcIframeOrigin.

Simply including them all in the URL if you for example redirect or navigate to another page worked for me.

Yours

Lewis
Amjad Khan 67Amjad Khan 67
Hi All,

Could you please let me know how I can suppress the additional parameter which are being send from lightning. My Apps does not accept the additional parametwers as part of Url because or Url validation.How I can disabled it from salesforce. do we have any property available to disable it the following parameters?
Lightning sends:
nonce
sfdcIframeOrigin
ltn_app_id
isdtp
mode

Thanks,
Amjad
Michael Fisher 24Michael Fisher 24
In case anyone should comes accross this post in the future I just wanted to report my issue and what worked since it doesn't seem there was ever a full resolution on this post.

Problem:
  • Visualforce page (P1) launches initially.
  • Gather data from user and redirect to a different visualforce page (P2) using PageReference
  • P2 is then importing the OpenCTI javascript.
  • Application fails to initialize the OpenCTI with the below error message
    • Uncaught Failed to initialize Open CTI. Ensure that it is loaded from the right frame with correct URL parameters

Fix
  • Taking the inspiration from Braxton Test's post, I retrieved the sfdcIframeOrigin from the current page and added the below to the URL Parameters for the redirect:
    • sfdcIframeOrigin=<current apex pages sfdcIframeOrigin>
    • mode=Lightning

Hope this helps with anyone stumbling on this!