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
Jesper HasselquistJesper Hasselquist 

enableClickToDial callback not being called

Hi fellow developers,

I have developed an openCTI app for the Lightning Experience and am now trying to implement Click To Dial. When I am testing it out in a scratch org, everything works perfectly. But when I package the app into a Managed Beta package and install it in an org, it does not work. None of my callbacks are being called. Please see below code snippet for my code I am trying to run.
 
function enableClickToDialCallback(response) {
    if (!response.success) {
        console.error("Something went wrong while initializing Click to Dial. Errors:", response.errors);
    }
}

sforce.opencti.enableClickToDial({
    callback: enableClickToDialCallback
});

function clickToDialListener(payload) {
    if (payload.number) {
        console.log("Payload", payload);
    }
}

sforce.opencti.onClickToDial({
    listener: clickToDialListener
});


Can someone tell me what I am missing?

 

Thanks in advance!

SwethaSwetha (Salesforce Developers) 
HI Jesper,

Does this happen even with salesforce provided "Open CTI Demo Adapter" or just with the app you developed?
Thanks
Jesper HasselquistJesper Hasselquist

Hi Swetha,

I have not tried the demo before, so I tried setting it up now. But I was not able to set things up and get the code to an org where I could test it. 

But the problem is not that my click to dial is not working. The problem is that click to dial is not working after i package it into a Managed Beta package and installing that into an org. The callbacks that I pass into `enableClickToDial` and `onClickToDial` is never called. It worked perfectly in my scratch org though.

SwethaSwetha (Salesforce Developers) 
HI Jesper,

Do you see any errors in console logs?Also, this post might be of help - https://developer.salesforce.com/forums?id=906F00000009BCoIAM .

Please mark this answer as best if it helps.
Thanks
Jesper HasselquistJesper Hasselquist

Hi!

No errors in the console. I have no idea what they are talking about in that post you linked. I am not using the `runApex` method.

Badar Ali 5Badar Ali 5
Hello Jesper, if you were able to resolve the issue please share the solution as I am also facing same scenario.