cti.triggerDialer Event is not occurred

I have test ticket.replyClick event, working fine but I’m not able to get cti.triggerDialer event, as we are not able to deliver client project on time.
Kindly help me on this.

1 Like

Hi @Nagesh_Srivastava,

Could you share where is the code written and what are the steps you’re following to test?

Ideally, this event should be initialised as soon as the app is activated and when a phone number is clicked, this event will be triggered.

var client = null;
$(document).ready(function () {
    app.initialized()
        .then(function (_client) {
            client = _client;
            client.data.get('loggedInUser').then(function (data) {
                if (client.context.settings.ip.length > 0 && !client.context.settings.ip.includes(' ')) {
                    loadIframe('miniUiIFrame', `https://${client.context.settings.ip}${client.context.settings.pathbase}Account/Login?username=${data.loggedInUser.contact.email}&output=embed`);
                }
                else {
                    loadIframe('miniUiIFrame', `https://${client.context.settings.ip}${client.context.settings.pathbase}Account/Login?username=${data.loggedInUser.contact.email}&output=embed`);
                }
            }).catch(e => { console.warn('Exception - ', e); });
            client.events.on('app.activated', onAppActivated);
        });
});

function addEventListeners() {
    console.log("addEventListeners added");
    client.events.on("cti.triggerDialer", clickToCallEvent);
}
function clickToCallEvent(event) {
    showNotify('info',event);
  };
 function showNotify(type, message) {
    return client.interface.trigger("showNotify", {
      type: type,
      message: message
    });
  }
function onAppActivated() {
    client.data.get("loggedInUser").then(
        function (data) {
            addEventListeners();
            const phone = data.loggedInUser.contact.phone ;
            window.userPhone = phone;
            document.getElementById('mainContent').style.display = 'block';
            
        }
    );
    client.events.on("ticket.replyClick", eventCallback);
}
var eventCallback = function (event) {
    var data = event.helper.getData();
    showNotify('info','Click to Call works');
    };
    
function loadIframe(iframeName, url) {
    var $iframe = $(`#${iframeName}`);
    $iframe.attr('src', url);
    $iframe.src = $iframe.src;    // here you can change src
    return false;
}

@Nagesh_Srivastava This code looks about right. Let me test this code on my account if it works.

Meanwhile, could you test and provide this information?

  1. What is environment is this app tested on? Local environment or as a custom app?
  2. Which placeholder the app is using?
  3. Which page the app is tested from?
  4. Which place the phone number is clicked from?
  5. Could you add a console.log statement as well on the event handler and check if the event handler works?
  6. If it continues to fail, is it possible to share a screengrab of testing the app?

Hi Raviraj,
Please find the response on your questions;

  1. What is environment is this app tested on? Local environment or as a custom app? : we have tested it on both environment.
  2. Which placeholder the app is using? : cti_global_sidebar
  3. Which page the app is tested from? : Ticket Details
  4. Which place the phone number is clicked from? : CONTACT DETAILS Tab
  5. Could you add a console.log statement as well on the event handler and check if the event handler works? : we are already used that, we are getting same result.
  6. If it continues to fail, is it possible to share a screengrab of testing the app? I can show you on zoom meeting?
1 Like

@Nagesh_Srivastava I have looked at the code that you have previously shared and everything looks good.

I have also tested it on my end with the details that you have provided and it works fine for me in the local environment and as a custom app. It could further be an environment issue for you or in your Freshdesk account.

Since I could not replicate it, I could not report the issue to the relevant product team from my end. We do not have the relevant product team experts in our community yet.
Please create a support ticket and I could help get it routed to the proper team and debugged further on why it doesn’t work on your account.

1 Like

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.