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

Call

Provides access to methods for managing outgoing or incoming calls. Call objects are obtained calling CallManager#createCall method or handling the onIncoming event of a connected CallManager instance.

Events

Member Summary

Public Members
public

emitter: EventEmitter

Method Summary

Public Methods
public

async connect(): Promise<Call, Error>

Attempts to reach the call recipient and establish a connection.

public

Create an object to manage the remote recording

public

async disconnect(): Promise<Call>

Disconnects or rejects the call

public

Returns actual call context

public

Returns the direction of the call

public

Returns the end reason of the call.

public
public

Allows access to local streams and actions related to changing which local media is shared

public

Returns a set containing the local only streams

public

Returns a the remote gateway user

public

Returns a set containing the remote streams

public

Returns a user object representing the remote user if exists

public

Returns the current status of the call

public

Returns a boolean value indicating if the call has a local only video track

public

Returns a boolean value indicating if the call has a remote audio track

public

Returns a boolean value indicating if the call has a remote video track

public

Returns true if Call is in any of the specified status

public

Holds this call

public

Returns true if the Call is polling

public

Resumes this call

public

Send a DTMF tone

public

setContext(context: Object): Call

Set some optional data that will be sent when creating the call.

public
public

Returns a promise that is resolved when the call changes to the requested status

Public Members

public emitter: EventEmitter source

Public Methods

public async connect(): Promise<Call, Error> source

Attempts to reach the call recipient and establish a connection.

Return:

Promise<Call, Error>

public createCallRecorder(type: String): CallRemoteRecorder source

Create an object to manage the remote recording

Params:

NameTypeAttributeDescription
type String
  • optional
  • default: 'remote'

Type of the recording

public async disconnect(): Promise<Call> source

Disconnects or rejects the call

Return:

Promise<Call>

public getContext(): Object source

Returns actual call context

Return:

Object

call context

public getDirection(): CallDirection source

Returns the direction of the call

Return:

CallDirection

public getEndReason(): CallEndReason source

Returns the end reason of the call. This value is only specified when the status of the call is DISCONNECTED

Return:

CallEndReason

public getId(): string source

Return:

string

public getLocalMediaHandler(): LocalMediaHandler source

Allows access to local streams and actions related to changing which local media is shared

public getLocalOnlyStreams(): ImmutableSet<ManagedStream> source

Returns a set containing the local only streams

public getRemoteGatewayUser(): string source

Returns a the remote gateway user

Return:

string

public getRemoteStreams(): ImmutableSet<ManagedStream> source

Returns a set containing the remote streams

public getRemoteUser(): User source

Returns a user object representing the remote user if exists

Return:

User

public getStatus(): CallStatus source

Returns the current status of the call

Return:

CallStatus

public hasLocalOnlyVideo(): boolean source

Returns a boolean value indicating if the call has a local only video track

Return:

boolean

public hasRemoteAudio(): boolean source

Returns a boolean value indicating if the call has a remote audio track

Return:

boolean

public hasRemoteVideo(): boolean source

Returns a boolean value indicating if the call has a remote video track

Return:

boolean

public hasStatus(args: ...CallStatus): boolean source

Returns true if Call is in any of the specified status

Params:

NameTypeAttributeDescription
args ...CallStatus

Return:

boolean

public hold(): Promise source

Holds this call

Return:

Promise

public isPolling(): boolean source

Returns true if the Call is polling

Return:

boolean

public resume(): Promise source

Resumes this call

Return:

Promise

public sendDtmf(key: string) source

Send a DTMF tone

Params:

NameTypeAttributeDescription
key string

The key of the DTMF tone to send

public setContext(context: Object): Call source

Set some optional data that will be sent when creating the call. Note that this method must be used before the call is connected.

Params:

NameTypeAttributeDescription
context Object

Any JSON serializable object that will be sent to the server when the call starts

Return:

Call

public async transfer(to: string): Promise<boolean, Error> source

Params:

NameTypeAttributeDescription
to string

Return:

Promise<boolean, Error>

true if the call is correctly transferred and false if the transfer is rejected or can not be done

public waitForStatus(statusList: ...CallStatus): Promise<CallStatus> source

Returns a promise that is resolved when the call changes to the requested status

Params:

NameTypeAttributeDescription
statusList ...CallStatus

Return:

Promise<CallStatus>

A promise that is resolved with the received status