This Guide is based on a few assumptions
:
- Reader has some javascript experience. (don’t need much)
- Reader is familiar with Salesforce Service Cloud
- Reader knows the basic concept of Call Centers and Open Cti
- Reader is interested to use Open Cti in the Service Cloud Console.
- We may need to use salesforce APEX to achieve some functions. It’s not necessary to write any code in APEX but reader needs to be comfortable with this language.
Feel free to skip this part if you are somewhat familiar with all 1 to 5.
Whitelist your softphone domain
Assuming we are using 27.0 version of api as this article is written, we need to first add the domain which your softphone will be to the Service Cloud Console white list. You can do this by: Setup -> Create Apps -> Edit [Your Console App Name] -> Whitelist Domains.
If you haven’t setup your softphone or call center yet, please refer to the earlier article in this blog.
Hello World
Let’s assume the softphone file you setup in the call center is http://mycompany.com/openctiDemo.html. We’ll start with a dummy softphone:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>Hello World</div>
</body>
</html>
Trying Out Some Apis
First we need to include the integration api:
<!-- Imports Open Cti AND Console JavaScript library. It should point to a valid Salesforce domain. -->
<script src="http://yourSFDC/support/api/27.0/interaction.js"></script>
<script src="http://yourSFDC/support/console/27.0/integration.js"></script>
Now we are ready to test if the apis work:
<button onclick="sforce.interaction.cti.disableClickToDial();">disable ClickToDial</button></br>
<button onclick="sforce.interaction.cti.enableClickToDial();">enable ClickToDial</button></br>
At this moment, you should have 2 buttons which will enable and disable the phone numbers on your console pages.
The full list
<!DOCTYPE html>
<html>
<head>
<!-- Imports Open Cti AND Console JavaScript library. It should point to a valid Salesforce domain. -->
<script src="http://yourSFDC/support/api/27.0/interaction.js"></script>
<script src="http://yourSFDC/support/console/27.0/integration.js"></script>
</head>
<body>
<div>Hello World</div>
<button onclick="sforce.interaction.cti.disableClickToDial();">disable ClickToDial</button></br>
<button onclick="sforce.interaction.cti.enableClickToDial();">enable ClickToDial</button></br>
</body>
</html>