Skip to navigation

CallManager (interface)

Web SDK v5 API reference
View as Markdown

Call

Methods

addEventListener

addEventListener(eventName: CallManagerEvent.IncomingCall, listener: (event: CallManagerIncomingCall) => void | Promise<void>, options: ListenerOptions): void

Registers a handler for the specified event.

One event can have more than one handler; handlers are executed in order of their registration.

Parameters

ParameterTypeRequirementDescription
eventNameCallManagerEvent.IncomingCallRequiredEvent name
listener(event: CallManagerIncomingCall) => void | Promise<void>RequiredHandler function that is triggered when an event of the specified type occurs
optionsListenerOptionsRequiredObject that specifies characteristics about the event listener

Returns: void

createCall

createCall(destination: string, settings?: CallSettings): Call

Creates a new call instance.

The call should be started via the Call.start method.

Parameters

ParameterTypeRequirementDescription
destinationstringRequiredSIP URI, username or phone number to make call to. Actual routing is then performed by a VoxEngine scenario
settingsCallSettingsOptionalCall settings with additional call parameters, such as the preferred video codec, custom data, extra headers, etc.

Returns: Call

Throws

RequiredParameterError if the destination parameter is undefined or an empty string

getCalls

getCalls(): Map<string, Call>

Returns a map of actual calls with their ids.

Returns: Map<string, Call>

removeEventListener

removeEventListener(eventName: CallManagerEvent.IncomingCall, listener: (event: CallManagerIncomingCall) => void | Promise<void>): void

Removes a previously registered handler for the specified event.

Parameters

ParameterTypeRequirementDescription
eventNameCallManagerEvent.IncomingCallRequiredEvent name
listener(event: CallManagerIncomingCall) => void | Promise<void>RequiredHandler function to remove from the event target

Returns: void

transferCall

transferCall(call1Id: string, call2Id: string): Promise<void>

Transfers a call.

Returns a promise that is resolved when the call transfer is completed successfully.

Parameters

ParameterTypeRequirementDescription
call1IdstringRequiredCall to transfer
call2IdstringRequiredDestination call where the call1 needs to be transferred

Returns: Promise<void>

Throws