• Jesper Hasselquist
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 4
    Likes Given
  • 1
    Questions
  • 3
    Replies
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!

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!

Hi all,
I am using CTI functionality in lightning. For this i am using enableClickToDial. enableClickToDial is not working suddenly.It shows greyed out in phone column. When click a button i called the enableclicktoDial method but it is not send any callback response from CTI  to salesforce. I am not getting any console log and error also. So please help me its urgent!

Here is my code.
<apex:includeScript value="/support/api/45.0/lightning/opencti_min.js"/>

function enableclicktoDial() {
	sforce.opencti.enableClickToDial({callback: callback});
}
                   
var callback = function(response) {
    if (response.success) {
        console.log('API method call executed successfully! returnValue:', response.returnValue);
	} 
    else {
	    console.error('Something went wrong! Errors:', response.errors);
	}
};
Thanks in advance!
 
Hi all,
I am using Open CTI functionality in lightning (For eg: enableClickToDial). In developer org it is working fine. But i have installed the same in any another org, Open CTI API call is not working and it is not send any callback response from CTI  to salesforce. I am not getting any console log and error also. So please help me its urgent!

Here is my callcenter settings in developer org.
call center settingsHere is the sample code from my developer org
<script src="/support/api/48.0/lightning/opencti_min.js" type="text/javascript"></script>

//set width in onload function
sforce.opencti.setSoftphonePanelWidth({widthPX:212,callback:widthCallback});

var widthCallback = function (response) {
     console.log('------width response-------------------'+JSON.stringify(response));
      if (response.errors == null) {
           console.log('width was set successfully! returnValue:', response.returnValue);
      }
      else {
            console.log('Something went wrong! Errors:', response.errors);
      }
};

function setSoftphoneHeight(spHeight){
            console.log('------spHeight-------------------'+spHeight);
            sforce.opencti.setSoftphonePanelHeight({heightPX: spHeight,callback: callback});
}          
        
var callback = function (response) {
      console.log('------height response-------------------'+JSON.stringify(response));
       if (response.errors == null) {
              console.log('Height was set successfully! returnValue:', response.returnValue);
       }
       else {
               console.log('Something went wrong! Errors:', response.errors);
        }
};

function enableClicktoDial() {
      console.log('------enable Click to dial-------------------');
       sforce.opencti.enableClickToDial({callback: enableCallback});
}
       
var enableCallback = function (response) {
           console.log('------enable Click to dial response-------------------'+JSON.stringify(response));
           if (response.errors == null) {
                   console.log('enable click to dial successfully! returnValue:', response.returnValue);
            }
	   else {
	            console.log('Something went wrong! Errors:', response.errors);
	    }
 };

Working org (developer org) Console logs

User-added image

Not working org (Installed Org) console logs

User-added image

Anyone please help me its urgent i could not find out the issue.

Thanks in Advance

Soorya R
Hi all,
I am using CTI functionality in lightning. For this i am using enableClickToDial. enableClickToDial is not working suddenly.It shows greyed out in phone column. When click a button i called the enableclicktoDial method but it is not send any callback response from CTI  to salesforce. I am not getting any console log and error also. So please help me its urgent!

Here is my code.
<apex:includeScript value="/support/api/45.0/lightning/opencti_min.js"/>

function enableclicktoDial() {
	sforce.opencti.enableClickToDial({callback: callback});
}
                   
var callback = function(response) {
    if (response.success) {
        console.log('API method call executed successfully! returnValue:', response.returnValue);
	} 
    else {
	    console.error('Something went wrong! Errors:', response.errors);
	}
};
Thanks in advance!
 

I'm trying to use Ip Telephony and integrate Twilio in Salesforce
So now the issue is how to enable click to dial option
I have already have call center configured and embedded iframe is shown up 
 Iframe -its  a visual force page  with button that should enable click to dial option and it have callback that should respons wether all ok or not and pop up  alert wether its enabled or not 
But when I'm clicking on the "enable click to dial" button nothing happens
No phones enabled to be dialed no any alerts, no exaptions in console, so callback event does not invoked

Code mark up
 

<apex:page controller="TwilioClientController" showHeader="false" >
   <script type="text/javascript" src="//static.twilio.com/libs/twiliojs/1.2/twilio.min.js"></script>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <script src="/support/api/37.0/interaction.js"></script>
function enableClickToDial() {
    sforce.interaction.cti.enableClickToDial(function (response) {
        if (response.result) {
            alert('Click to dial was enabled.');
        } else {
           alert('Click to dial was not enabled.');
        }
        alert(response.error);
    }
);
}
<button onclick="enableClickToDial();">enable click to dial</button>
</apex:page>

Similar example from open cti api 
https://developer.salesforce.com/docs/atlas.en-us.api_cti.meta/api_cti/sforce_api_cti_enableclicktodial.htm

User-added image

Hello Everyone,

Requirement : To design a VF page from where I can call to Opportunity or Lead using <support:clicktodial/>.

Issue : I have designed VF page but Click to Dial is not working, on clicking the number it gets disabled for few seconds but call doesn't initiates. We are using New Voice Media.

Code : 
<apex:column headerValue="Phone">
       <!--<apex:outputField value="{!wrap.opp.Primary_Contact__r.phone}" rendered="{!if(wrap.isOppty == true,true,false)}"/>-->                  <support:clickToDial entityId="{!wrap.opp.id}" number="{!wrap.ld.phone}" rendered="{!if(wrap.isOppty == false,true,false)}"/> <support:clickToDial entityId="{!wrap.ld.id}" number="{!wrap.opp.Primary_Contact__r.phone}" rendered="{!if(wrap.isOppty == true,true,false)}"/> <support:clickToDial entityId="{!lead.id}" number="{!lead.phone}" />
</apex:column>

Please let me know how to resolve this issue.

Thanks in Advance!