CallCommon interface
The Call common interface.
- Extends
Properties
call |
Containing code/subCode indicating how this call ended. |
caller |
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. |
is |
Whether local user muted incoming audio. |
is |
Whether local video is on. |
is |
Whether local user is muted, locally or remotely. |
is |
Whether screen sharing is on. |
kind | Get the kind of call object. |
lobby | Get the Teams meeting lobby. |
local |
Collection of local audio streams being sent to other participants in a call. |
local |
Collection of local video streams being sent to other participants in a call. |
remote |
Collection of remote audio streams being received from the call. |
remote |
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. |
total |
Count of total number of participants in this call. |
Methods
feature<TFeature>(Call |
Retrieves an initialized and memoized Feature object with extended API. Check the object Features.* for all available extended call features in this package, example:
|
hang |
Hang up the call. |
hold() | Put this Call on hold. |
mute() | Mute local microphone. |
mute |
Mute all remote participants. |
mute |
Mute incoming audio. |
off("id |
Unsubscribe function for idChanged event. |
off("is |
Subscribe function for isIncomingAudioMutedChanged event. |
off("is |
Unsubscribe function for isLocalVideoStartedChanged event. |
off("is |
Subscribe function for isMutedChanged event. |
off("is |
Unsubscribe function for isScreenSharingChanged event. |
off("local |
Unsubscribe function for localAudioStreamsUpdated event. |
off("local |
Unsubscribe function for localVideoStreamsUpdated event. |
off("muted |
Unsubscribe function for mutedByOthers event. |
off("remote |
Unsubscribe function for remoteAudioStreamsUpdated event. |
off("remote |
Unsubscribe function for remoteParticipantsUpdated event. |
off("role |
Unsubscribe function for roleChanged event. |
off("state |
Unsubscribe function for stateChanged event. |
off("total |
unsubscribe function for totalParticipantCountChanged event. |
on("id |
Subscribe function for idChanged event. |
on("is |
Subscribe function for isIncomingAudioMutedChanged event. |
on("is |
Subscribe function for isLocalVideoStartedChanged event. |
on("is |
Subscribe function for isMutedChanged event. |
on("is |
Subscribe function for isScreenSharingChanged event. |
on("local |
Subscribe function for localAudioStreamsUpdated event. |
on("local |
Subscribe function for localVideoStreamsUpdated event. |
on("muted |
Subscribe function for mutedByOthers event. |
on("remote |
Subscribe function for remoteAudioStreamsUpdated event. |
on("remote |
Subscribe function for remoteParticipantsUpdated event. |
on("role |
Subscribe function for roleChanged event. |
on("state |
Subscribe function for stateChanged event. |
on("total |
Subscribe function for totalParticipantCountChanged event. |
resume() | Resume this Call if it is on 'LocalHold' state. |
send |
Send DTMF tone. |
set |
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. |
start |
Start audio in the call with custom audio. LocalAudioStream source should be a MediaStream. |
start |
|
start |
|
start |
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. |
stop |
Stop custom audio in the call and switch to Device manager default audio device. |
stop |
Stop local screen sharing. |
stop |
Stop local screen sharing. |
stop |
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. |
unmute |
Unmute incoming audio. |
Inherited Methods
dispose() |
Property Details
callEndReason
Containing code/subCode indicating how this call ended.
callEndReason?: CallEndReason
Property Value
callerInfo
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
lobby
localAudioStreams
Collection of local audio streams being sent to other participants in a call.
localAudioStreams: readonly LocalAudioStream[]
Property Value
readonly LocalAudioStream[]
localVideoStreams
Collection of local video streams being sent to other participants in a call.
localVideoStreams: readonly LocalVideoStream[]
Property Value
readonly LocalVideoStream[]
remoteAudioStreams
Collection of remote audio streams being received from the call.
remoteAudioStreams: readonly RemoteAudioStream[]
Property Value
readonly 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: readonly RemoteParticipant[]
Property Value
readonly RemoteParticipant[]
role
state
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()
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
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
callback fn that was used to subscribe to this event.
off("mutedByOthers", PropertyChangedEvent)
Unsubscribe function for mutedByOthers event.
function off(event: "mutedByOthers", listener: PropertyChangedEvent)
Parameters
- event
-
"mutedByOthers"
event name.
- listener
- PropertyChangedEvent
callback fn that was used to unsubscribe 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
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
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
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
callback fn that will be called when this collection will change, it will pass arrays of added and removed elements.
on("mutedByOthers", PropertyChangedEvent)
Subscribe function for mutedByOthers event.
function on(event: "mutedByOthers", listener: PropertyChangedEvent)
Parameters
- event
-
"mutedByOthers"
event name.
- listener
- PropertyChangedEvent
callback fn that was used to subscribe to this event.
on("remoteAudioStreamsUpdated", CollectionUpdatedEvent<RemoteAudioStream>)
Subscribe function for remoteAudioStreamsUpdated event.
function on(event: "remoteAudioStreamsUpdated", listener: CollectionUpdatedEvent<RemoteAudioStream>)
Parameters
- event
-
"remoteAudioStreamsUpdated"
event name.
- listener
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
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 audio. LocalAudioStream source should be a MediaStream.
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