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 |
createCall(to: String): Promise<Call, TypeError> Creates a new call instance for communication with the specified recipient. |
|
public |
getCallLog(): Promise<CallLog> |
|
public |
|
|
public |
getRemoteCalls(): Promise<RemoteCall[]> 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 |
setDefaultMediaConstraints(defaultMediaConstraints: MediaStreamConstraints) 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:
Name | Type | Attribute | Description |
to | String | The user identifier of the call recipient. |
public getRemoteCalls(): Promise<RemoteCall[]> source
Get a list of remote calls where user is currently participating
public async pull(remoteCall: RemoteCall): Promise<Call, Error> source
Pulls remote call from remote session.
Params:
Name | Type | Attribute | Description |
remoteCall | RemoteCall |
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:
Name | Type | Attribute | Description |
defaultMediaConstraints | MediaStreamConstraints |
Example:
callManager.setDefaultMediaConstraints({
audio: {
autoGainControl: true,
echoCancellation: true,
noiseSuppression: true,
},
video: true,
});