Newer Version Available

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

Service Cloud Voice Aura Toolkit API Telephony Events

Make your components context-aware by listening to events that take place during phone calls.

The following telephony events are available.

Event Name Description
CALL_STARTED Sent when the call starts.
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.
PAUSE_RECORDING Sent when the agent pauses call recording.
RESUME_RECORDING Sent when the agent resumes call recording.
WRAP_UP_ENDED Sent when the agent exits after call work status.

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 the following 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 following table for all the possible properties that can appear within the detail object of the payload.

Event Name Payload “detail” Properties
CALL_STARTED
  • callId (string): Unique call identifier value
  • callType (string): "inbound" or "outbound"
  • participant (string): the phone number
CALL_CONNECTED
  • callId (string): Unique call identifier value
  • callType (string): "inbound" or "outbound"
  • participant (string): the phone number
CALL_ENDED
  • callId (string): Unique call identifier value
HOLD
  • callId (string): Unique call identifier value
  • participant (string): the phone number or Amazon Quick Connect name

RESUME
  • callId (string): Unique call identifier value
  • participant (string): the phone number or Amazon Quick Connect name

MUTE
  • callId (string): Unique call identifier value
UNMUTE
  • callId (string): Unique call identifier value
PARTICIPANT_ADDED
  • callId (string): Unique call identifier value
  • participant (string): the phone number or Amazon Quick Connect name

PARTICIPANT_REMOVED
  • callId (string): Unique call identifier value
  • participant (string): the phone number or Amazon Quick Connect name
CONFERENCE
  • callId (string): Unique call identifier value
SWAP
  • callId (string): Unique call identifier value
PAUSE_RECORDING
  • callId (string): Unique call identifier value
RESUME_RECORDING
  • callId (string): Unique call identifier value
WRAP_UP_ENDED
  • callId (string): Unique call identifier value

Payloads may contain other system-generated information.