0

I am following this guide: https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_oncallbegin.htm

I have added the sample script to a vf console component in the footer area, so it gets loaded every time. There is no other functionality in the component.

`

       var callback = function (result) {
          alert('Call ' + result.id + 'Just came in!');
       };

      //Note that we are using the CTI submodule here
       sforce.console.cti.onCallBegin(callback);
 </script>` 

The alert never fires on a incoming call. I am trying to understand why and fail miserably.

We are using a 3rd party integration for CTI and Click2Dial - but that shouldn't bother onCallBegin()

I have followed everything in the debug console, the sforce.console.cti.onCallBegin(callback) is indeed evaluated but the event does not fire nor does the alert msg appear...

Also tried with onCallEnd() to no avail either

Kind regards, Sz

1 Answer 1

0

The function onCallBegin only establishes an event handler that is triggered when a call actually begins. If that snippet is the only code you have, it will never throw the alert because your method named "callback" is actually a handler and not a callback. This handler gets called in response to the method fireOnCallBegin, so either you or your 3rd party softphone needs to call that method if you wish to see the alert in the handler method.

The same goes for onCallEnd and fireOnCallEnd methods.

See also: Console Integration Toolkit Developer Guide

1

You must log in to answer this question.

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