How does Open CTI empower developers to integrate custom telephony solutions into the Service Console?
Answer
Basics: The adapter is just a web page served over HTTPS. Salesforce loads it in the softphone utility; the page includes the Open CTI JavaScript library and calls its methods to talk to Salesforce. This removes installed desktop CTI adapters.
How it works:
- Create a Call Center definition XML (internal name, display name, adapter URL, softphone size, reqUseApi = true) and import it at Setup > Call Centers.
- Add users to the call center.
- For Lightning, add the Open CTI Softphone utility item to the console app.
- The adapter page loads the opencti.js library from the org's domain and registers handlers.
- When a call arrives, the adapter calls screenPop or searchAndScreenPop; on click-to-dial, onClickToDial fires; when the call ends, saveLog creates the Task.
Advanced / deep dive: Common methods: enableClickToDial, onClickToDial, screenPop, searchAndScreenPop, saveLog, setSoftphonePanelVisibility/Height/Width, getAppViewInfo, onNavigationChange, runApex (calls an Apex method allowed in the Call Center definition's allowed namespace). Keep call state in the telephony backend; Open CTI should be a thin client. Because it lives in an iframe in a single softphone, it is not integrated with Omni-Channel capacity: use Omni-Channel Presence APIs separately or choose Service Cloud Voice for unified routing. Secure the adapter hosting, restrict origins, and include the adapter domain in your trusted URLs/CSP configuration (verify current requirements).
Code / config example:
// Inside the adapter page, after loading opencti.js from the org
sforce.opencti.enableClickToDial({ : .(r.) });
sforce..({ : (payload.) });
() {
sforce..({
: ani,
: ,
: sforce...,
: { (!r.) .(r.); }
});
}