CallCommon interface

The Call common interface.

Extends

Properties

callEndReason

Containing code/subCode indicating how this call ended.

callerInfo

Caller Information if this call is incoming.

direction

Get the call direction, whether it is Incoming or Outgoing.

id

Get the unique Id for this Call.

isIncomingAudioMuted

Whether local user muted incoming audio.

isLocalVideoStarted

Whether local video is on.

isMuted

Whether local user is muted, locally or remotely.

isScreenSharingOn

Whether screen sharing is on.

kind

Get the kind of call object.

lobby

Get the Teams meeting lobby.

localAudioStreams

Collection of local audio streams being sent to other participants in a call.

localVideoStreams

Collection of local video streams being sent to other participants in a call.

remoteAudioStreams

Collection of remote audio streams being received from the call.

remoteParticipants

Collection of remote participants in this call. In case of calls with participants of hundred or more, only media active participants are present in this collection.

role

Get the role of the local user in the Call.

state

Get the state of this Call.

totalParticipantCount

Count of total number of participants in this call.

Methods

feature<TFeature>(CallFeatureFactory<TFeature>)

Retrieves an initialized and memoized Feature object with extended API. Check the object Features.* for all available extended call features in this package, example:

const call: Call = ...;
call.feature(Features.Recording).isRecordingActive;
call.feature(Features.Captions).startCaptions('en-us')
hangUp(HangUpOptions)

Hang up the call.

hold()

Put this Call on hold.

mute()

Mute local microphone.

muteAllRemoteParticipants()

Mute all remote participants.

muteIncomingAudio()

Mute incoming audio.

off("idChanged", PropertyChangedEvent)

Unsubscribe function for idChanged event.

off("isIncomingAudioMutedChanged", PropertyChangedEvent)

Subscribe function for isIncomingAudioMutedChanged event.

off("isLocalVideoStartedChanged", PropertyChangedEvent)

Unsubscribe function for isLocalVideoStartedChanged event.

off("isMutedChanged", PropertyChangedEvent)

Subscribe function for isMutedChanged event.

off("isScreenSharingOnChanged", PropertyChangedEvent)

Unsubscribe function for isScreenSharingChanged event.

off("localAudioStreamsUpdated", CollectionUpdatedEvent<LocalAudioStream>)

Unsubscribe function for localAudioStreamsUpdated event.

off("localVideoStreamsUpdated", CollectionUpdatedEvent<LocalVideoStream>)

Unsubscribe function for localVideoStreamsUpdated event.

off("remoteAudioStreamsUpdated", CollectionUpdatedEvent<RemoteAudioStream>)

Unsubscribe function for remoteAudioStreamsUpdated event.

off("remoteParticipantsUpdated", CollectionUpdatedEvent<RemoteParticipant>)

Unsubscribe function for remoteParticipantsUpdated event.

off("roleChanged", PropertyChangedEvent)

Unsubscribe function for roleChanged event.

off("stateChanged", PropertyChangedEvent)

Unsubscribe function for stateChanged event.

off("totalParticipantCountChanged", PropertyChangedEvent)

unsubscribe function for totalParticipantCountChanged event.

on("idChanged", PropertyChangedEvent)

Subscribe function for idChanged event.

on("isIncomingAudioMutedChanged", PropertyChangedEvent)

Subscribe function for isIncomingAudioMutedChanged event.

on("isLocalVideoStartedChanged", PropertyChangedEvent)

Subscribe function for isLocalVideoStartedChanged event.

on("isMutedChanged", PropertyChangedEvent)

Subscribe function for isMutedChanged event.

on("isScreenSharingOnChanged", PropertyChangedEvent)

Subscribe function for isScreenSharingChanged event.

on("localAudioStreamsUpdated", CollectionUpdatedEvent<LocalAudioStream>)

Subscribe function for localAudioStreamsUpdated event.

on("localVideoStreamsUpdated", CollectionUpdatedEvent<LocalVideoStream>)

Subscribe function for localVideoStreamsUpdated event.

on("remoteAudioStreamsUpdated", CollectionUpdatedEvent<RemoteAudioStream>)

Subscribe function for remoteAudioStreamsUpdated event.

on("remoteParticipantsUpdated", CollectionUpdatedEvent<RemoteParticipant>)

Subscribe function for remoteParticipantsUpdated event.

on("roleChanged", PropertyChangedEvent)

Subscribe function for roleChanged event.

on("stateChanged", PropertyChangedEvent)

Subscribe function for stateChanged event.

on("totalParticipantCountChanged", PropertyChangedEvent)

Subscribe function for totalParticipantCountChanged event.

resume()

Resume this Call if it is on 'LocalHold' state.

sendDtmf(DtmfTone)

Send DTMF tone.

setConstraints(CallConstraints)

Set call constraints. This method sets the max constraints of based on the values provided. The final applied constraints will be less than or equal to the values provided here to this method. If 0 value is provided, then no constraint will be applied for that constraint. If undefined value is provided, then the previous value used will be used for that constraint.

startAudio(LocalAudioStream)

Start audio in the call with custom localAudioStream.

startScreenSharing()
  • Start sending screen sharing stream in a call. Browser will prompt to select the screen, app, or browser tab.
  • Sending screen sharing stream is not supported on iOS nor Android.
  • Incoming screen sharing stream is supported on iOS and Android.
startScreenSharing(LocalVideoStream)
  • Start sending raw screen sharing stream in a call.
  • Sending raw screen sharing is not supported on iOS nor Android.
  • Incoming raw screen sharing is supported on iOS and Android.
startVideo(LocalVideoStream)

Start sending video stream in the call. Remote participants in the call will receive your video stream so that they can render it in their UIs.

stopAudio()

Stop custom audio in the call and switch to Device manager default audio device.

stopScreenSharing()

Stop local screen sharing.

stopScreenSharing(LocalVideoStream)

Stop local screen sharing.

stopVideo(LocalVideoStream)

Stop sending video stream in the call. Must pass the same LocalVideoStream object that was used to start video in the CallAgent.startCall() API, CallAgent.join() API , IncomingCall.accept() API, or Call.startVideo() API.

unmute()

Unmute local microphone.

unmuteIncomingAudio()

Unmute incoming audio.

Inherited Methods

dispose()

Property Details

callEndReason

Containing code/subCode indicating how this call ended.

callEndReason?: CallEndReason

Property Value

callerInfo

Caller Information if this call is incoming.

callerInfo: CallerInfo

Property Value

direction

Get the call direction, whether it is Incoming or Outgoing.

direction: CallDirection

Property Value

id

Get the unique Id for this Call.

id: string

Property Value

string

isIncomingAudioMuted

Whether local user muted incoming audio.

isIncomingAudioMuted: boolean

Property Value

boolean

isLocalVideoStarted

Whether local video is on.

isLocalVideoStarted: boolean

Property Value

boolean

isMuted

Whether local user is muted, locally or remotely.

isMuted: boolean

Property Value

boolean

isScreenSharingOn

Whether screen sharing is on.

isScreenSharingOn: boolean

Property Value

boolean

kind

Get the kind of call object.

kind: CallKind

Property Value

lobby

Get the Teams meeting lobby.

lobby: Lobby

Property Value

localAudioStreams

Collection of local audio streams being sent to other participants in a call.

localAudioStreams: ReadonlyArray<LocalAudioStream>

Property Value

ReadonlyArray<LocalAudioStream>

localVideoStreams

Collection of local video streams being sent to other participants in a call.

localVideoStreams: ReadonlyArray<LocalVideoStream>

Property Value

ReadonlyArray<LocalVideoStream>

remoteAudioStreams

Collection of remote audio streams being received from the call.

remoteAudioStreams: ReadonlyArray<RemoteAudioStream>

Property Value

ReadonlyArray<RemoteAudioStream>

remoteParticipants

Collection of remote participants in this call. In case of calls with participants of hundred or more, only media active participants are present in this collection.

remoteParticipants: ReadonlyArray<RemoteParticipant>

Property Value

ReadonlyArray<RemoteParticipant>

role

Get the role of the local user in the Call.

role: ParticipantRole

Property Value

state

Get the state of this Call.

state: CallState

Property Value

totalParticipantCount

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Count of total number of participants in this call.

totalParticipantCount: number

Property Value

number

Method Details

feature<TFeature>(CallFeatureFactory<TFeature>)

Retrieves an initialized and memoized Feature object with extended API. Check the object Features.* for all available extended call features in this package, example:

const call: Call = ...;
call.feature(Features.Recording).isRecordingActive;
call.feature(Features.Captions).startCaptions('en-us')
function feature<TFeature>(factory: CallFeatureFactory<TFeature>): TFeature

Parameters

factory

CallFeatureFactory<TFeature>

The factory for the call feature constructor that provides an extended API.

Returns

TFeature

hangUp(HangUpOptions)

Hang up the call.

function hangUp(options?: HangUpOptions): Promise<void>

Parameters

options
HangUpOptions

HangUp options.

Returns

Promise<void>

hold()

Put this Call on hold.

function hold(): Promise<void>

Returns

Promise<void>

mute()

Mute local microphone.

function mute(): Promise<void>

Returns

Promise<void>

muteAllRemoteParticipants()

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Mute all remote participants.

function muteAllRemoteParticipants(): Promise<void>

Returns

Promise<void>

muteIncomingAudio()

Mute incoming audio.

function muteIncomingAudio(): Promise<void>

Returns

Promise<void>

off("idChanged", PropertyChangedEvent)

Unsubscribe function for idChanged event.

function off(event: "idChanged", listener: PropertyChangedEvent)

Parameters

event

"idChanged"

event name.

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event.

off("isIncomingAudioMutedChanged", PropertyChangedEvent)

Subscribe function for isIncomingAudioMutedChanged event.

function off(event: "isIncomingAudioMutedChanged", listener: PropertyChangedEvent)

Parameters

event

"isIncomingAudioMutedChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

off("isLocalVideoStartedChanged", PropertyChangedEvent)

Unsubscribe function for isLocalVideoStartedChanged event.

function off(event: "isLocalVideoStartedChanged", listener: PropertyChangedEvent)

Parameters

event

"isLocalVideoStartedChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

off("isMutedChanged", PropertyChangedEvent)

Subscribe function for isMutedChanged event.

function off(event: "isMutedChanged", listener: PropertyChangedEvent)

Parameters

event

"isMutedChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

off("isScreenSharingOnChanged", PropertyChangedEvent)

Unsubscribe function for isScreenSharingChanged event.

function off(event: "isScreenSharingOnChanged", listener: PropertyChangedEvent)

Parameters

event

"isScreenSharingOnChanged"

event name.

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event.

off("localAudioStreamsUpdated", CollectionUpdatedEvent<LocalAudioStream>)

Unsubscribe function for localAudioStreamsUpdated event.

function off(event: "localAudioStreamsUpdated", listener: CollectionUpdatedEvent<LocalAudioStream>)

Parameters

event

"localAudioStreamsUpdated"

event name.

listener

CollectionUpdatedEvent<LocalAudioStream>

callback fn that was used to subscribe to this event.

off("localVideoStreamsUpdated", CollectionUpdatedEvent<LocalVideoStream>)

Unsubscribe function for localVideoStreamsUpdated event.

function off(event: "localVideoStreamsUpdated", listener: CollectionUpdatedEvent<LocalVideoStream>)

Parameters

event

"localVideoStreamsUpdated"

event name.

listener

CollectionUpdatedEvent<LocalVideoStream>

callback fn that was used to subscribe to this event.

off("remoteAudioStreamsUpdated", CollectionUpdatedEvent<RemoteAudioStream>)

Unsubscribe function for remoteAudioStreamsUpdated event.

function off(event: "remoteAudioStreamsUpdated", listener: CollectionUpdatedEvent<RemoteAudioStream>)

Parameters

event

"remoteAudioStreamsUpdated"

event name.

listener

CollectionUpdatedEvent<RemoteAudioStream>

callback fn that was used to subscribe to this event.

off("remoteParticipantsUpdated", CollectionUpdatedEvent<RemoteParticipant>)

Unsubscribe function for remoteParticipantsUpdated event.

function off(event: "remoteParticipantsUpdated", listener: CollectionUpdatedEvent<RemoteParticipant>)

Parameters

event

"remoteParticipantsUpdated"

event name.

listener

CollectionUpdatedEvent<RemoteParticipant>

callback fn that was used to subscribe to this event.

off("roleChanged", PropertyChangedEvent)

Unsubscribe function for roleChanged event.

function off(event: "roleChanged", listener: PropertyChangedEvent)

Parameters

event

"roleChanged"

event name.

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event.

off("stateChanged", PropertyChangedEvent)

Unsubscribe function for stateChanged event.

function off(event: "stateChanged", listener: PropertyChangedEvent)

Parameters

event

"stateChanged"

event name.

listener
PropertyChangedEvent

callback fn that was used to subscribe to this event.

off("totalParticipantCountChanged", PropertyChangedEvent)

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

unsubscribe function for totalParticipantCountChanged event.

function off(event: "totalParticipantCountChanged", listener: PropertyChangedEvent)

Parameters

event

"totalParticipantCountChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when the participant count changes.

on("idChanged", PropertyChangedEvent)

Subscribe function for idChanged event.

function on(event: "idChanged", listener: PropertyChangedEvent)

Parameters

event

"idChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

on("isIncomingAudioMutedChanged", PropertyChangedEvent)

Subscribe function for isIncomingAudioMutedChanged event.

function on(event: "isIncomingAudioMutedChanged", listener: PropertyChangedEvent)

Parameters

event

"isIncomingAudioMutedChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

on("isLocalVideoStartedChanged", PropertyChangedEvent)

Subscribe function for isLocalVideoStartedChanged event.

function on(event: "isLocalVideoStartedChanged", listener: PropertyChangedEvent)

Parameters

event

"isLocalVideoStartedChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

on("isMutedChanged", PropertyChangedEvent)

Subscribe function for isMutedChanged event.

function on(event: "isMutedChanged", listener: PropertyChangedEvent)

Parameters

event

"isMutedChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

on("isScreenSharingOnChanged", PropertyChangedEvent)

Subscribe function for isScreenSharingChanged event.

function on(event: "isScreenSharingOnChanged", listener: PropertyChangedEvent)

Parameters

event

"isScreenSharingOnChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

on("localAudioStreamsUpdated", CollectionUpdatedEvent<LocalAudioStream>)

Subscribe function for localAudioStreamsUpdated event.

function on(event: "localAudioStreamsUpdated", listener: CollectionUpdatedEvent<LocalAudioStream>)

Parameters

event

"localAudioStreamsUpdated"

event name.

listener

CollectionUpdatedEvent<LocalAudioStream>

callback fn that will be called when this collection will change, it will pass arrays of added and removed elements.

on("localVideoStreamsUpdated", CollectionUpdatedEvent<LocalVideoStream>)

Subscribe function for localVideoStreamsUpdated event.

function on(event: "localVideoStreamsUpdated", listener: CollectionUpdatedEvent<LocalVideoStream>)

Parameters

event

"localVideoStreamsUpdated"

event name.

listener

CollectionUpdatedEvent<LocalVideoStream>

callback fn that will be called when this collection will change, it will pass arrays of added and removed elements.

on("remoteAudioStreamsUpdated", CollectionUpdatedEvent<RemoteAudioStream>)

Subscribe function for remoteAudioStreamsUpdated event.

function on(event: "remoteAudioStreamsUpdated", listener: CollectionUpdatedEvent<RemoteAudioStream>)

Parameters

event

"remoteAudioStreamsUpdated"

event name.

listener

CollectionUpdatedEvent<RemoteAudioStream>

callback fn that will be called when this collection will change, it will pass arrays of added and removed elements.

on("remoteParticipantsUpdated", CollectionUpdatedEvent<RemoteParticipant>)

Subscribe function for remoteParticipantsUpdated event.

function on(event: "remoteParticipantsUpdated", listener: CollectionUpdatedEvent<RemoteParticipant>)

Parameters

event

"remoteParticipantsUpdated"

event name.

listener

CollectionUpdatedEvent<RemoteParticipant>

callback fn that will be called when this collection will change, it will pass arrays of added and removed elements.

on("roleChanged", PropertyChangedEvent)

Subscribe function for roleChanged event.

function on(event: "roleChanged", listener: PropertyChangedEvent)

Parameters

event

"roleChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

on("stateChanged", PropertyChangedEvent)

Subscribe function for stateChanged event.

function on(event: "stateChanged", listener: PropertyChangedEvent)

Parameters

event

"stateChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when value of this property will change.

on("totalParticipantCountChanged", PropertyChangedEvent)

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Subscribe function for totalParticipantCountChanged event.

function on(event: "totalParticipantCountChanged", listener: PropertyChangedEvent)

Parameters

event

"totalParticipantCountChanged"

event name.

listener
PropertyChangedEvent

callback fn that will be called when the participant count changes.

resume()

Resume this Call if it is on 'LocalHold' state.

function resume(): Promise<void>

Returns

Promise<void>

sendDtmf(DtmfTone)

Send DTMF tone.

function sendDtmf(dtmfTone: DtmfTone): Promise<void>

Parameters

dtmfTone
DtmfTone

Returns

Promise<void>

setConstraints(CallConstraints)

Set call constraints. This method sets the max constraints of based on the values provided. The final applied constraints will be less than or equal to the values provided here to this method. If 0 value is provided, then no constraint will be applied for that constraint. If undefined value is provided, then the previous value used will be used for that constraint.

function setConstraints(constraints: CallConstraints): Promise<void>

Parameters

constraints
CallConstraints

Object representing the call constraints to set

Returns

Promise<void>

startAudio(LocalAudioStream)

Start audio in the call with custom localAudioStream.

function startAudio(localAudioStream: LocalAudioStream): Promise<void>

Parameters

localAudioStream
LocalAudioStream

Returns

Promise<void>

startScreenSharing()

  • Start sending screen sharing stream in a call. Browser will prompt to select the screen, app, or browser tab.
  • Sending screen sharing stream is not supported on iOS nor Android.
  • Incoming screen sharing stream is supported on iOS and Android.
function startScreenSharing(): Promise<void>

Returns

Promise<void>

startScreenSharing(LocalVideoStream)

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

  • Start sending raw screen sharing stream in a call.
  • Sending raw screen sharing is not supported on iOS nor Android.
  • Incoming raw screen sharing is supported on iOS and Android.
function startScreenSharing(localVideoStream: LocalVideoStream): Promise<void>

Parameters

localVideoStream
LocalVideoStream

Represents a local raw screen sharing stream that takes a MediaStream in constructor.

Returns

Promise<void>

startVideo(LocalVideoStream)

Start sending video stream in the call. Remote participants in the call will receive your video stream so that they can render it in their UIs.

function startVideo(localVideoStream: LocalVideoStream): Promise<void>

Parameters

localVideoStream
LocalVideoStream

Represents a local video stream that takes a camera source in constructor.

Returns

Promise<void>

stopAudio()

Stop custom audio in the call and switch to Device manager default audio device.

function stopAudio()

stopScreenSharing()

Stop local screen sharing.

function stopScreenSharing(): Promise<void>

Returns

Promise<void>

stopScreenSharing(LocalVideoStream)

Note

This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Stop local screen sharing.

function stopScreenSharing(localVideoStream: LocalVideoStream): Promise<void>

Parameters

localVideoStream
LocalVideoStream

The local screen sharing stream to stop streaming.

Returns

Promise<void>

stopVideo(LocalVideoStream)

Stop sending video stream in the call. Must pass the same LocalVideoStream object that was used to start video in the CallAgent.startCall() API, CallAgent.join() API , IncomingCall.accept() API, or Call.startVideo() API.

function stopVideo(localVideoStream: LocalVideoStream): Promise<void>

Parameters

localVideoStream
LocalVideoStream

The local video stream to stop streaming.

Returns

Promise<void>

unmute()

Unmute local microphone.

function unmute(): Promise<void>

Returns

Promise<void>

unmuteIncomingAudio()

Unmute incoming audio.

function unmuteIncomingAudio(): Promise<void>

Returns

Promise<void>

Inherited Method Details

dispose()

function dispose()

Inherited From Disposable.dispose