Salesforce Voice Aura Toolkit API Telephony Events
The following telephony events are available.
| Event Name | Description |
|---|---|
| AUDIO_STATS | Sent during a call, publishing real-time WebRTC audio statistics every 30
seconds. This event isn't supported in Salesforce Voice (Native Telephony). |
| CALL_STARTED | Sent when the call starts. This event isn't supported in Salesforce Voice (Native Telephony). |
| CALL_CONNECTED | Sent when the call connects. |
| CALL_ENDED | Sent when the call ends. |
| HOLD | Sent when the call is put on hold. |
| RESUME | Sent when the call resumes after hold. |
| MUTE | Sent when the call is muted. |
| UNMUTE | Sent when the call is unmuted. |
| PARTICIPANT_ADDED | Sent when a participant is added to the call. |
| PARTICIPANT_REMOVED | Sent when a participant is removed from the call. |
| CONFERENCE | Sent when participants on a three-way call are all taken off hold. |
| SWAP | Sent when participants on a three-way call have their hold status swapped. This event isn't supported in Salesforce Voice (Native Telephony). |
| PAUSE_RECORDING | Sent when the rep pauses call recording. |
| RESUME_RECORDING | Sent when the rep resumes call recording. |
| WRAP_UP_ENDED | Sent when the rep exits after call work status. This event isn't supported in Salesforce Voice (Native Telephony). |
To subscribe to these events, add a telephony event listener for each event you want to listen to.
1// Subscribe
2cmp.find('voiceToolkitApi')
3 .addTelephonyEventListener('CALL_STARTED', telephonyEventListenerFunc);
4
5// Unsubscribe
6cmp.find('voiceToolkitApi')
7 .removeTelephonyEventListener('CALL_STARTED', telephonyEventListenerFunc);When an event occurs, you receive a JSON payload that contains the event type, along with any relevant data. For instance, the CALL_STARTED event contains this payload.
1{
2 "type": "CALL_STARTED",
3 "detail": {
4 "callId": "d7a9f1b7-fc17-43fe-8ca7-e584a2b34792",
5 "callType": "outbound",
6 "participant": "+1 (415) 999-0000"
7 }
8}All payloads contain some basic information, such as the event type (type) and a unique call identifier (callId). Events can contain additional values within the detail object. Refer to the table for all the possible properties that can appear within the detail object of the payload.
| Event Name | Payload “detail” Properties |
|---|---|
| AUDIO_STATS |
This event isn't supported in Salesforce Voice (Native Telephony). |
| CALL_STARTED |
This event isn't supported in Salesforce Voice (Native Telephony). |
| CALL_CONNECTED |
|
| CALL_ENDED |
|
| HOLD |
|
| RESUME |
|
| MUTE |
|
| UNMUTE |
|
| PARTICIPANT_ADDED |
|
| PARTICIPANT_REMOVED |
|
| CONFERENCE |
|
| SWAP |
This event isn't supported in Salesforce Voice (Native Telephony). |
| PAUSE_RECORDING |
|
| RESUME_RECORDING |
|
| WRAP_UP_ENDED |
This event isn't supported in Salesforce Voice (Native Telephony). |
Payloads may contain other system-generated information.