Using manifest version 2.3 and below code to trigger Click 2 dial from Freshdesk Contacts page. However Click2Dial event is not getting triggered
var client = null;
$(document).ready( function() {
app.initialized()
.then(function(_client) {
client = _client;
client.events.on(‘app.activated’, function (event) {
console.log(‘app.activated triggered’ + JSON.stringify(event));
addEventListeners();
});
}).catch(function (error) {
console.error(‘The app failed to get initialized’);
console.error(error);
});
});
function addEventListeners() {
/* Click-to-call functionality */
console.log(“addEventListeners”);
client.events.on(“cti.triggerDialer”, clickToCallEvent); // this event is not getting called
}
function clickToCallEvent(event) {
console.log("clickToCallEvent : "+JSON.stringify(event));
var data = event.helper.getData();
console.log(data.number);
var url = “https://dummyurl/click2dial.html?phone=” + data.number;
console.log(url);
window = window.open(url, “theFrame”, “width=260, height=600”);
setTimeout(function() {
window.close();
}, 1000);
};
Please check on this