I have a Lightning instance which contains a Salesforce Classic Console App using Contacts, Leads and Accounts tabs. Inside of it I have an OpenCTI Phone which is made of Lightning components. During the initialization of one of the components I invoke a function which should enable a click-to-dial feature. Here's a simple code:
enableClickToDial : function(cmp) {
const clickToDialListener = function(response) {
console.log("Click-to-dial listener");
}
var callback = function (response) {
console.log("Callback invoked");
if (response.result) {
alert('Click to dial was enabled.');
} else {
alert('Click to dial was not enabled.');
}
};
sforce.interaction.cti.enableClickToDial(callback);
console.log("Enabling finished");
}
However, the callback
is not invoked. I don't know what's happening since an "Enabling finished" message is printed out to the console - that means there was no error in enableClickToDial
function and interpreter got to the next statement.
Also, a phone icon is grayed out:
Does anyone know the reason why is it not working properly?
"Callback invoked"
should be printed out. I've mentioned"Enabling finished"
to point out that the function was called and interpreter got to the nex statement. Speaking aboutresponse.error
- it's impossible to know what did it contain since even"Callback invoked"
wasn't printed - that means that thecallback
wasn't invoked.