Metadata
Metadata describes the state of the ongoing call.
It can take different shapes depending on the type of the call.
Shapes
Common shape
interface CommonMetadataPayload {
callUuid: string;
/**
* undefined is used if the call is on a line not assigned to the current user;
* i.e. an incoming transfer call
*/
line: Line | undefined;
canControlRecording: boolean;
recordingState: 'idle' | 'started' | 'paused';
direction: 'incoming' | 'outgoing';
me: Participant;
}
Participant
interface CommonParticipant {
legId: string;
state: AasmState;
isHeld: boolean;
}
Another Agent on the call
type UserParticipant = CommonParticipant & { user: SimpleUser };
External on the call
type ExternalParticipant = CommonParticipant & { external: External };
Final shape
type Participant = UserParticipant | ExternalParticipant;
Regular calls
Regular call with an external number, thus there is only one participant present.
interface RegularCallMetadata extends CommonMetadataPayload {
activeParticipant: Participant;
}
Warm Transfer call
Warm transfer is a "parallel" call so there will always be one active and one inactive participant present.
interface WarmTransferCallMetadata extends CommonMetadataPayload {
activeParticipant: Participant;
inactiveParticipant: Participant;
}
Metadata
Final shape:
type Metadata = RegularCallMetadata | WarmTransferCallMetadata;