CallManager
Methods
addEventListener
addEventListener(eventName: , listener: (event: CallManagerIncomingCall) => void | Promise<void>
, options: ): 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
eventName:
Event name
listener:
(event: CallManagerIncomingCall) => void | Promise<void>
Handler function that is triggered when an event of the specified type occurs
options:
Object that specifies characteristics about the event listener
Returns
type:
void
createCall
createCall(destination: string
, settings: ):
Creates a new call instance.
The call should be started via the Call.start method.
Parameters
destination:
string
SIP URI, username or phone number to make call to. Actual routing is then performed by a VoxEngine scenario
settings:
OptionalCall settings with additional call parameters, such as the preferred video codec, custom data, extra headers, etc.
Returns
type:
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
type:
Map<string, Call>
removeEventListener
removeEventListener(eventName: , listener: (event: CallManagerIncomingCall) => void | Promise<void>
): void
Removes a previously registered handler for the specified event.
Parameters
eventName:
Event name
listener:
(event: CallManagerIncomingCall) => void | Promise<void>
Handler function to remove from the event target
Returns
type:
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.
Throws:
- CallNotFoundError if there are no call(s) with the provided call ids
- CallWrongStateError if the call(s) with the provided id is not in the CallState.Connected state
- CallTransferTimeoutError if the operation is not completed in time
- CallTransferFailedError if the operation has failed
Parameters
call1Id:
string
Call to transfer
call2Id:
string
Destination call where the call1 needs to be transferred
Returns
type:
Promise<void>