+ Start a Discussion
Mike @ BlackTabMike @ BlackTab 

CTI Toolkit and Click-To-Dial Within Visualforce

I'm trying to use the CTI Toolkit, more specifically the sforce.console.cti.sendCTIMessage() function to enable click-to-dial on a Visualforce page. 


I'm running into a cross-domain security issue, and the browser console is simply outputting: "Service Clout Toolkit API cannot be used with your browser."


Is there another way to enable Click-To-Dial within Visualforce? I've seen posts from other users, however they were simply using the sendCTIMessage() within the Service Console or a custom Button or Link within salesforce. 


Here's the code I've implemented:


<apex:includeScript value="/support/console/24.0/integration.js"/>
<b>Phone: </b><a href="javascript&colon;sforce.console.cti.sendCTIMessage('http://localhost:7332/CLICK_TO_DIAL?DN='+encodeURIComponent('{!IF(cm.LeadID != null, cm.Lead.Phone, cm.Contact.Phone)}')+'&ID={!IF(cm.LeadID != null, cm.Lead.Id, cm.Contact.Id)}&ENTITY_NAME=Contact');"  style="cursor:pointer; cursor:hand; text-decoration:underline;">{!IF(cm.LeadID != null, cm.Lead.Phone, cm.Contact.Phone)}<apex:image rendered="{!IF(ISBLANK(cm.Lead.Phone) && ISBLANK(cm.Contact.Phone), 'false', 'true')}" value="{!$Resource.PhoneIcon}" height="10" width="10" /></a>