1

I am creating a custom softphone, and am using the below resources:

<script type="text/javascript" src="/support/api/38.0/lightning/opencti.js"></script>
<script src="/support/api/40.0/interaction.js" type="text/javascript"></script>

However, this is some issues as I'm unable to access any sforce.opencti functionality. Every basic operation is failing with the error:

Cannot read property 'opencti' of undefined

and I am unsure why.

Would appreciate any help!

1 Answer 1

2

It depends on whether you want to work with a classic or Lightning console.

Use Open CTI for Salesforce Classic if...

  • You want to make calls using a softphone in Salesforce Classic
  • You want to make calls using a softphone in a Salesforce Classic console app

The URL would be <https://domain:port>/support/api/49.0/interaction.js

In this case, you will use below functions

//Set softphone height
sforce.interaction.cti.setSoftphoneHeight(300, callback);

Note this is relative. If you are building outside salesforce then you need to append the full salesforce domain.

Use Open CTI for Lightning Experience if...

  • You want to make calls using a softphone in Lightning Experience

  • You want to make calls using a softphone in a Lightning Experience console app

The URL would be <https://domain:port>/support/api/49.0/lightning/opencti_min.js

In this case, it would be

//Disable clickToDial
 sforce.opencti.disableClickToDial({callback: callback});

For lightning you can find a sample app here

For Classic find sample code and dev guide here

3
  • Thank you Mohith! I was able to find out the right resources. ALso, I have a question on the methods available for Lightning vs Classic. For my implementation, I'm using Lightning out to use my aura component that is my actual dialler. But I see that there is no access to the console CTI API at all. Do you see any way to use sforce.console.cti in aura? I am very much looking to use onCallBegin() and onCallEnd() functions. If this is completely unusable, do you think there's any way to track when call begins and ends? Commented Jun 20, 2020 at 13:58
  • @ApexSrinivas Can you open a new question for this. Thanks Commented Jun 20, 2020 at 13:59
  • 1
    I added below question: salesforce.stackexchange.com/questions/310160/… Commented Jun 20, 2020 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .