3

I am using Open Cti in a visualforce page and the page is pinned in utility bar in LEX.

Now on click of a button, we are invoking enableClickToDial with a simple callback. Howver the enableClickToDial is not getting invoked. Javascript console shows a error that object could not be cloned.. I have used debbugger and find out that my execution is not reaching enableClickToDial method of openCti.

My VF Page:

<apex:page id="thePage" controller="PhoneDialerVFController" showHeader="false" lightningStylesheets="true">
    <script type="text/javascript" src="/support/api/43.0/lightning/opencti_min.js"></script>
        <a href="#" onclick="enableCTD();return false;" >Enable</a>

<script>
function enableCTD() {
            console.log('calling api');
           sforce.opencti.enableClickToDial({callback:function(){alert('callback received');}});
           console.log('api invoked');
       }
</script>
</apex:page>

Issue 1: When I open the page from utility bar, the browser console shows following error:

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

but when I load the page with these url parameters appended, it initializes correctly.

sfdcIframeOrigin=https%3A%2F%2Fmycompany--sb1.lightning.force.com&mode=Lightning

Why isn't the default lightning url working?

Issue 2: When it initilizes, I try to click Enable button to enable click to dial. the call invokes, but the callback is not received

Any help would be appreciated.

  • Please share your code so that you can get relevant and exact answers to your problem. Also, please share the details of the error such as the code, description and the details of the error object which are returned as a part of the callback. – Jigar Shah Aug 10 '18 at 0:59
  • I have added more details now – Santanu Halder Aug 10 '18 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.