- Go to the setup page (right upper coner, click your name, then setup).
- Find or type Call Centers in quick find.
- Hit Import.
- Import the file.
If you don’t have an open cti setting file, save the following text as a file like myAdapter.xml:
<callCenter>
<section sortOrder="0" name="reqGeneralInfo" label="General Information">
<item sortOrder="0" name="reqInternalName" label="InternalName">My Open Adapter</item>
<item sortOrder="1" name="reqDisplayName" label="Display Name">My Open CTI Call Center</item>
<item sortOrder="2" name="reqAdapterUrl" label="CTI Adapter URL">http://MYSERVER/MySoftPhone.html</item>
<item sortOrder="3" name="reqUseApi" label="Use CTI API">true</item>
<item sortOrder="4" name="reqSoftphoneHeight" label="Softphone Height">300</item>
<item sortOrder="5" name="reqSoftphoneWidth" label="Softphone Width">500</item>
</section>
<section sortOrder="1" name="reqDialingOptions" label="Dialing Options">
<item sortOrder="0" name="reqOutsidePrefix" label="Outside Prefix">9</item>
<item sortOrder="1" name="reqLongDistPrefix" label="Long Distance Prefix">1</item>
<item sortOrder="2" name="reqInternationalPrefix" label="International Prefix">01</item>
</section>
</callCenter>
5. Add yourself as a user by clicking on “Manage Call Center Users” button.
<html>
<head>
<!-- Imports Open CTI JavaScript library. It should point to a valid Salesforce domain. -->
<script src="http://YOURURL.TO.salesforce.com/support/api/27.0/interaction.js"></script>
<script type="text/javascript">
// Callback of API method: isInConsole
var isInConsoleCallback = function (response) {
// Returns true if method is executed in Service Cloud console, false otherwise.
if (response.result) {
alert('SoftPhone is in Service Cloud console.');
} else {
alert('SoftPhone is not in Service Cloud console.');
}
};
// Invokes API method: isInConsole
function isInConsole() {
sforce.interaction.isInConsole(isInConsoleCallback);
}
// Callback of API method: getCallCenterSettings
var getCallCenterSettingsCallback = function (response) {
// Result returns call center settings as a JSON string.
if (response.result) {
alert(response.result);
} else {
alert('Error retrieving call center settings ' + response.error);
}
};
// Invokes API method: getCallCenterSettings
function getCallCenterSettings() {
sforce.interaction.cti.getCallCenterSettings(getCallCenterSettingsCallback);
}
// Callback of API method: setSoftphoneHeight
var setSoftphoneHeightCallback = function (response) {
// Returns true if SoftPhone height was set successfully, false otherwise.
if (response.result) {
alert('Setting SoftPhone height to 300px was successful.');
} else {
alert('Setting softphone height failed.');
}
};
// Invokes setSoftphoneHeight API method.
function setSoftphoneHeight() {
sforce.interaction.cti.setSoftphoneHeight(300, setSoftphoneHeightCallback);
}
// Callback of API method: getPageInfo
var getPageInfoCallback = function (response) {
if (response.result) {
alert(response.result);
} else {
alert('Error occured while trying to get page info: ' + response.error);
}
}
// Invokes API method getPageInfo
function getPageInfo() {
sforce.interaction.getPageInfo(getPageInfoCallback);
}
//dial a number
function dial() {
var number = document.getElementById("dialPadText").value;
alert("dialing number: " + number);
}
</script>
</head>
<body>
<input type="text" id="dialPadText"/><button onclick="dial()">dial</button><br/>
<button onclick="isInConsole();">isInConsole</button></br>
<button onclick="getCallCenterSettings();">getCallCenterSettings</button></br>
<button onclick="setSoftphoneHeight();">setSoftphoneHeight(300)</button></br>
<button onclick="getPageInfo();">getPageInfo</button>
</body>
</html>
Now you have your basic open CTI in Salesforce. We'll discuss more about open CIT later.