Newer Version Available

This content describes an older version of this product. View Latest

Service Cloud Voice Aura Toolkit API Telephony Actions

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

Give admins the ability perform softphone call controls. For example, allow admins to use their Bluetooth headset OEMs to send and receive call control actions to and from an Omni-Channel softphone.

The following methods are available.

Method Name Arguments Description
mute None Mute the call.
unmute None Unmute the call.
hold Name: participantType

Type: string

Description: Put the call on hold. Possible values are Initial_Caller and Third_Party.

Put the call on hold.
resume Name: participantType

Type: string

Description: Resume the call if it’s on hold. Possible values are Initial_Caller and Third_Party.

Resume the call if it's on hold.
endCall None End the call.
acceptCall None Accept the call.
declineCall None Decline the call.
pauseRecording None Pause the call recording.
resumeRecording None Resume the call recording.
startPreviewCall Name: phoneNumber

Type: string

Description: Phone number for the preview call.

Start the preview call.

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.