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
bitHeadbitHead 

Click to Call Not firing within .aspx page !

Hi,

 

I have 2 Open CTI API event handlers running within my .aspx page: enableClickToDial, and onClickToDial.

 

The first one is triggered by a button in my .aspx and it fires as it should and I get an alert "Click to dial was enabled.":

 

<script type="text/javascript" src="http://c.na15.visual.force.com/support/api/25.0/interaction.js"></script>
<script type="text/javascript">
var callback = function (response) {
alert(response.result);
if (response.result) {
alert('Click to dial was enabled.');
} else {
alert('Click to dial was not enabled.');
}
};
function enableClickToDial() {

sforce.interaction.cti.enableClickToDial(callback);
}
</script>

 the second one should be firing when a user clicks on a phone number (the little phone icon) within Salesforce, but I get no event firing for that:

 

   <script type="text/javascript" src="http://c.na15.visual.force.com/support/api/25.0/interaction.js"></script>
   <script type="text/javascript">
       var listener = function (response) {
           if (response.result) {
               alert('User clicked on a phone number.' + response.result);
           } else {
               alert('Crap !');
           }
       };
       //Invokes API method
       sforce.interaction.cti.onClickToDial(listener);
    </script>

 

So the fact that the first one fires seems to tell me that I think I know what I'm doing, but if anyone can tell me why the second one won't fire, I'd love to hear it. They are both in the same location within the .aspx page (HEAD section).

 

Thanks,

 

Barry