Salesforce Voice Aura Toolkit API Telephony Actions

Make your components context-aware by listening to and raising events during phone calls.

Programmatically raise softphone call control events or even build your own softphone UI. For example, build integrations with peripherals like Bluetooth headsets, or programmatically perform actions on the rep’s behalf, such as adding a participant to a conference call.

The following methods are available.

Method NameDescriptionArguments
muteMute the call.None.
unmuteUnmute the call.None.
holdPut the call on hold.Name: participantType
Type: string
Description: The participant type whose call was put on hold. Possible values are “Initial_Caller” and “Third_Party”.
resumeResume the call if it’s on hold.Name: participantType
Type: string
Description: The participant type whose call was resumed. Possible values are “Initial_Caller” and “Third_Party”.
endCallEnd the call.None.
acceptCallAccept the call.None.
declineCallDecline the call.None.
pauseRecordingPause the call recording.None.
resumeRecordingResume the call recording.None.
startPreviewCallStart the preview call.Name: phoneNumber
Type: string
Description: The phone number for the preview call.
This method isn’t supported in Salesforce Voice (Native Telephony).
mergeResume the call for all participants on a three-way call.None.
swapSwap two of the participants on a three-way call, where one participant is on hold. The call for the participant on hold resumes while the other participant is put on hold.None.
This method isn’t supported in Salesforce Voice (Native Telephony).
addParticipantAdd a third participant to an existing call between a rep and a caller.Name: contactType
Type: string
Description: The transfer destination type for addParticipant provided by the customer. Possible values are “PhoneNumber” and “AgentOrQueueId”.
Name: contactValue
Type: string
Description: The transfer destination value for addParticipant provided by the customer. Possible values are the phone number if contactType is “PhoneNumber”, or the agent ID or queue ID if contactType is “AgentOrQueueId”.
Name: isBlindTransfer
Type: boolean
Description: Indicates whether the participant was added through a blind transfer. If true, the participant was added through a blind transfer.
PhoneNumber value isn’t supported in Salesforce Voice (Native Telephony).
sendDigitsSend digits to the active call.Name: digit
Type: string
Description: The digits of the phone number sent by the rep. Possible values are 0-9, *, #, A, B, C, D, and comma (,).
This method isn’t supported in Salesforce Voice (Native Telephony).
endCallEnd the call.Name: participantType
Type: string
Description: The participant who ended the call. Possible values are “Initial_Caller”, “Third_Party”, and “Agent”.

To perform telephony actions, load the Service Cloud Voice Aura Toolkit voiceToolkitApi, and then add a telephony method for each call control you want to allow admins to perform.

For example, add the following components to let admins accept calls, end calls, decline calls, pause a call recording, and resume a paused recording.

1({
2    acceptCall: function(cmp) {
3        cmp.find('voiceToolkitApi').acceptCall()
4    },
5    
6    endCall: function(cmp) {
7        cmp.find('voiceToolkitApi').endCall()
8    },
9    
10    declineCall: function(cmp) {
11        cmp.find('voiceToolkitApi').declineCall()
12    },   
13    
14    pauseRecording: function(cmp) {
15        cmp.find('voiceToolkitApi').pauseRecording()
16    },
17    
18    resumeRecording: function(cmp) {
19        cmp.find('voiceToolkitApi').resumeRecording()
20    }
21    startPreviewCall: function(cmp) {
22        var params = cmp.get('v.phoneNumber');
23        cmp.find('voiceToolkitApi').startPreviewCall(params);
24    }
25})

See the Toolkit API SampleComponentHelper.js file in GitHub for more examples.