TeamsCallAgent interface

The TeamsCallAgent is used to handle Teams calls.

Extends

Properties

calls

Get the calls.

Inherited Properties

connectionState

Get the connection state.

kind

Get the kind of call agent object.

Methods

join(MeetingLocator, JoinCallOptions)

Join a Teams meeting. To join a Teams meeting, pass a meeting link or meeting id or meeting coordinates.

join(TeamsMeetingIdLocator, JoinCallOptions)

Join a Teams meeting. To join a Teams meeting, pass a meeting id and passcode.

join(TeamsMeetingLinkLocator, JoinCallOptions)

Join a Teams meeting. To join a Teams meeting, pass a meeting link.

off("callsUpdated", CollectionUpdatedEvent<TeamsCall>)

Unsubscribe function for callsUpdated event.

off("connectionStateChanged", ConnectionStateChangedEvent)

Unsubscribe function for connectionStateChanged event.

off("incomingCall", TeamsIncomingCallEvent)

Unsubscribe function for incomingCall event.

on("callsUpdated", CollectionUpdatedEvent<TeamsCall>)

Subscribe function for callsUpdated event.

on("connectionStateChanged", ConnectionStateChangedEvent)

Subscribe function for connectionStateChanged event.

on("incomingCall", TeamsIncomingCallEvent)

Subscribe function for incomingCall event.

startCall((PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier)[], StartTeamsGroupCallOptions)

Start a 1:N call.

startCall(PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier, StartTeamsCallOptions)

Start 1:1 call.

Inherited Methods

dispose()

Dispose of this Call Agent

feature<TFeature>(CallAgentFeatureFactory<TFeature>)

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

handlePushNotification(IncomingCallPushNotificationData)

Handles a push notification.

Property Details

calls

Get the calls.

calls: readonly TeamsCall[]

Property Value

readonly TeamsCall[]

Inherited Property Details

connectionState

Get the connection state.

connectionState: ConnectionState

Property Value

Inherited From CallAgentCommon.connectionState

kind

Get the kind of call agent object.

kind: CallAgentKind

Property Value

Inherited From CallAgentCommon.kind

Method Details

join(MeetingLocator, JoinCallOptions)

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.

Join a Teams meeting. To join a Teams meeting, pass a meeting link or meeting id or meeting coordinates.

function join(meetingLocator: MeetingLocator, options?: JoinCallOptions): TeamsCall

Parameters

meetingLocator
MeetingLocator

Meeting information.

options
JoinCallOptions

Teams call start options.

Returns

The TeamsCall object associated with the call.

join(TeamsMeetingIdLocator, JoinCallOptions)

Join a Teams meeting. To join a Teams meeting, pass a meeting id and passcode.

function join(meetingLocator: TeamsMeetingIdLocator, options?: JoinCallOptions): TeamsCall

Parameters

meetingLocator
TeamsMeetingIdLocator

Meeting information.

options
JoinCallOptions

Call start options.

Returns

The Call object associated with the call.

join(TeamsMeetingLinkLocator, JoinCallOptions)

Join a Teams meeting. To join a Teams meeting, pass a meeting link.

function join(meetingLocator: TeamsMeetingLinkLocator, options?: JoinCallOptions): TeamsCall

Parameters

meetingLocator
TeamsMeetingLinkLocator

Meeting information.

options
JoinCallOptions

Call start options.

Returns

The Call object associated with the call.

off("callsUpdated", CollectionUpdatedEvent<TeamsCall>)

Unsubscribe function for callsUpdated event.

function off(event: "callsUpdated", listener: CollectionUpdatedEvent<TeamsCall>)

Parameters

event

"callsUpdated"

event name.

listener

CollectionUpdatedEvent<TeamsCall>

allback fn that was used to subscribe to this event.

off("connectionStateChanged", ConnectionStateChangedEvent)

Unsubscribe function for connectionStateChanged event.

function off(event: "connectionStateChanged", listener: ConnectionStateChangedEvent)

Parameters

event

"connectionStateChanged"

event name.

listener
ConnectionStateChangedEvent

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

off("incomingCall", TeamsIncomingCallEvent)

Unsubscribe function for incomingCall event.

function off(event: "incomingCall", listener: TeamsIncomingCallEvent)

Parameters

event

"incomingCall"

event name.

listener
TeamsIncomingCallEvent

callback fn that was used to subscribe to this event.

on("callsUpdated", CollectionUpdatedEvent<TeamsCall>)

Subscribe function for callsUpdated event.

function on(event: "callsUpdated", listener: CollectionUpdatedEvent<TeamsCall>)

Parameters

event

"callsUpdated"

event name.

listener

CollectionUpdatedEvent<TeamsCall>

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

on("connectionStateChanged", ConnectionStateChangedEvent)

Subscribe function for connectionStateChanged event.

function on(event: "connectionStateChanged", listener: ConnectionStateChangedEvent)

Parameters

event

"connectionStateChanged"

event name.

listener
ConnectionStateChangedEvent

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

on("incomingCall", TeamsIncomingCallEvent)

Subscribe function for incomingCall event.

function on(event: "incomingCall", listener: TeamsIncomingCallEvent)

Parameters

event

"incomingCall"

event name.

listener
TeamsIncomingCallEvent

callback fn that will be called when this callAgent will receive an incoming call.

startCall((PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier)[], StartTeamsGroupCallOptions)

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 a 1:N call.

function startCall(participants: (PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier)[], options?: StartTeamsGroupCallOptions): TeamsCall

Parameters

Returns

The TeamsCall object associated with the call.

startCall(PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier, StartTeamsCallOptions)

Start 1:1 call.

function startCall(participant: PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | MicrosoftTeamsAppIdentifier | UnknownIdentifier, options?: StartTeamsCallOptions): TeamsCall

Parameters

Returns

The TeamsCall object associated with the call.

Inherited Method Details

dispose()

Dispose of this Call Agent

function dispose(): Promise<void>

Returns

Promise<void>

Inherited From CallAgentCommon.dispose

feature<TFeature>(CallAgentFeatureFactory<TFeature>)

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.

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

function feature<TFeature>(factory: CallAgentFeatureFactory<TFeature>): TFeature

Parameters

factory

CallAgentFeatureFactory<TFeature>

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

Returns

TFeature

Inherited From CallAgentCommon.feature

handlePushNotification(IncomingCallPushNotificationData)

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.

Handles a push notification.

function handlePushNotification(data: IncomingCallPushNotificationData): Promise<void>

Parameters

data
IncomingCallPushNotificationData

Push notification data

Returns

Promise<void>

Inherited From CallAgentCommon.handlePushNotification