Queued Callbacks

When a customer makes an inbound call, the telephony system first creates a voice call and then routes the call to the available rep. If no rep is available and the customer requests a callback, you must publish a QUEUED_CALLBACK_STARTED event.

Call the Service Cloud Connector API publishEvent() method with a Call payload having callType of callback and an original inbound call ID as initialCallId to link it with the new callback voice call.

On the QUEUED_CALLBACK_STARTED event, a new conversation and Voice Call record are created and the AgentWork is created.
// Create phone call object
const call = new PhoneCall({ 
            callId: vendorCallKey,
            phoneNumber : '{CallBack number}',
            callInfo : { initialCallId: previousVendorCallKey},
            callType: Constants.CALL_TYPE.CALLBACK.toLowerCase()/*'callback'*/,
            contact: new Contact({ phoneNumber }),
            callAttributes: { participantType: Constants.PARTICIPANT_TYPE.INITIAL_CALLER } });

// Publish the event
publishEvent({ eventType: Constants.VOICE_EVENT_TYPE.QUEUED_CALL_STARTED, payload: new CallResult({ call })});

initialCallId is not a mandatory field. If you do not have a initial inbound call before a callback request, you can skip it.

Note

For example, suppose that a customer makes an inbound call and the connecter creates a VoiceCall VC1. If no reps are available, the IVR asks the customer if they want a callback. If a customer asks for a callback, then the telephony system can queue a callback after an initial delay (in which the callback is initiated as soon as a rep is available) or a callback is scheduled for a customer on a particular date.

A callback can also be requested from a particular rep. The telephony system creates a new voice call VC2 and the connector sends a QUEUED_CALL_STARTED event as per rep availability and routing rules along with callback phone number and VC1 as the initialCallId. The callBack is displayed in Omni-Channel as shown in the following screenshot. When a rep accepts the call, an outbound call is triggered to the given phone number and the previousCall field on the VC2 becomes VC1 and next call on VC1 becomes VC2 in the Voice Call details.

Here are some scenarios where a callback request is accepted but fails to connect with the customer.Accepted callback request fails to connect with customer.

Callback acceptance and outbound call dialing: Callback and outbound call dialing in Omni-Channel

If a rep declines the call or the call times out, the telephony system can try to connect to another available rep with the same VC2.