Home Reference Source
import {CallManager} from '@quobis/sippojs'
public class | source

CallManager

This class provides access to every call related feature This class must never be directly instantiated, instances of this class can be obtained using Session#getCallManager.

Events

  • incomingCall (Call) - Emitted every time a new incoming call is received.

Member Summary

Public Members
public

emitter: EventEmitter

Method Summary

Public Methods
public

Creates a new call instance for communication with the specified recipient.

public
public
public

Get a list of remote calls where user is currently participating

public

async pull(remoteCall: RemoteCall): Promise<Call, Error>

Pulls remote call from remote session.

public

Sets the constraints that will be used as initial value for media requests when initializing calls.

Public Members

public emitter: EventEmitter source

Public Methods

public createCall(to: String): Promise<Call, TypeError> source

Creates a new call instance for communication with the specified recipient.

Params:

NameTypeAttributeDescription
to String

The user identifier of the call recipient.

Return:

Promise<Call, TypeError>

public getCallLog(): Promise<CallLog> source

Return:

Promise<CallLog>

public getDefaultMediaConstraints(): MediaStreamConstraints source

public getRemoteCalls(): Promise<RemoteCall[]> source

Get a list of remote calls where user is currently participating

Return:

Promise<RemoteCall[]>

public async pull(remoteCall: RemoteCall): Promise<Call, Error> source

Pulls remote call from remote session.

Params:

NameTypeAttributeDescription
remoteCall RemoteCall

Return:

Promise<Call, Error>

Example:

 const callManager = await session.getCallManager();
 const calls = await callManager.getRemoteCalls();
 console.log('got remote calls', calls);
 if (!calls) {
   return;
 }
 const call = await cm.pull(calls[0]);
 await call.connect();

public setDefaultMediaConstraints(defaultMediaConstraints: MediaStreamConstraints) source

Sets the constraints that will be used as initial value for media requests when initializing calls. For more information about valid values see https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamConstraints

Params:

NameTypeAttributeDescription
defaultMediaConstraints MediaStreamConstraints

Example:

Enabling noise reduction techniques
callManager.setDefaultMediaConstraints({
  audio: {
    autoGainControl: true,
    echoCancellation: true,
    noiseSuppression: true,
  },
  video: true,
});