CallClient class

The CallClient is the main entry point to the SDK. The CallClient is used to create the CallAgent and to get the DeviceManager.

Constructors

CallClient(CallClientOptions)

Create a CallClient.

Methods

createCallAgent(CommunicationTokenCredential, CallAgentOptions)

The CallAgent is used to handle calls. To create the CallAgent, pass a CommunicationTokenCredential object provided from SDK.

  • The CallClient can only have one active CallAgent instance at a time.
  • You can create a new CallClient instance to create a new CallAgent.
  • You can dispose of a CallClient's current active CallAgent, and call the CallClient's createCallAgent() method again to create a new CallAgent.
createTeamsCallAgent(CommunicationTokenCredential, TeamsCallAgentOptions)

The TeamsCallAgent is used to handle Teams calls. To create the TeamsCallAgent, pass a CommunicationTokenCredential object provided from SDK.

  • The CallClient can only have one active TeamsCallAgent instance at a time.
  • You can create a new CallClient instance to create a new TeamsCallAgent.
  • You can dispose of a CallClient's current active TeamsCallAgent, and call the CallClient's createTeamsCallAgent() method again to create a new TeamsCallAgent.
feature<TFeature>(CallClientFeatureFactory<TFeature>)

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

getDeviceManager()

The DeviceManager is used to handle media devices such as cameras, microphones, and speakers.

Constructor Details

CallClient(CallClientOptions)

Create a CallClient.

new CallClient(options?: CallClientOptions)

Parameters

Method Details

createCallAgent(CommunicationTokenCredential, CallAgentOptions)

The CallAgent is used to handle calls. To create the CallAgent, pass a CommunicationTokenCredential object provided from SDK.

  • The CallClient can only have one active CallAgent instance at a time.
  • You can create a new CallClient instance to create a new CallAgent.
  • You can dispose of a CallClient's current active CallAgent, and call the CallClient's createCallAgent() method again to create a new CallAgent.
function createCallAgent(tokenCredential: CommunicationTokenCredential, options?: CallAgentOptions): Promise<CallAgent>

Parameters

tokenCredential
CommunicationTokenCredential

The token credential. Use AzureCommunicationTokenCredential from @azure/communication-common to create a credential.

options
CallAgentOptions

The CallAgentOptions for additional options like display name.

Returns

Promise<CallAgent>

createTeamsCallAgent(CommunicationTokenCredential, TeamsCallAgentOptions)

The TeamsCallAgent is used to handle Teams calls. To create the TeamsCallAgent, pass a CommunicationTokenCredential object provided from SDK.

  • The CallClient can only have one active TeamsCallAgent instance at a time.
  • You can create a new CallClient instance to create a new TeamsCallAgent.
  • You can dispose of a CallClient's current active TeamsCallAgent, and call the CallClient's createTeamsCallAgent() method again to create a new TeamsCallAgent.
function createTeamsCallAgent(tokenCredential: CommunicationTokenCredential, options?: TeamsCallAgentOptions): Promise<TeamsCallAgent>

Parameters

tokenCredential
CommunicationTokenCredential

The token credential. Use AzureCommunicationTokenCredential from @azure/communication-common to create a credential.

options
TeamsCallAgentOptions

The CallAgentOptions for additional options like display name.

Returns

Promise<TeamsCallAgent>

feature<TFeature>(CallClientFeatureFactory<TFeature>)

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

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

Parameters

factory

CallClientFeatureFactory<TFeature>

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

Returns

TFeature

getDeviceManager()

The DeviceManager is used to handle media devices such as cameras, microphones, and speakers.

function getDeviceManager(): Promise<DeviceManager>

Returns

Promise<DeviceManager>