SIGN UP

Call

CLass that may be used for call operations like answer, reject, hang up abd mid-call operations like hold, start/stop video and others.

Methods

answer(callSettings: CallSettings): void

Answer the incoming call.

Parameters

  • callSettings:

    CallSettingsOptional

    Optional set of call settings.

decline(headers: object): void

Reject incoming call on all devices, where this user logged in.

Parameters

  • headers:

    objectOptional

    Optional custom parameters (SIP headers) that should be sent after rejecting incoming call. Parameter names must start with "X-" to be processed by application

getEndpoints(): Array<Endpoint>

Get all current Endpoints in the call.

Returns

hangup(headers: object): void

Hangup the call

Parameters

  • headers:

    objectOptional

    Optional custom parameters (SIP headers) that should be sent after disconnecting/cancelling call. Parameter names must start with "X-" to be processed by application

hold(enable: boolean): Promise<(void|CallOperationFailed)>

Hold or unhold the call

Parameters

  • enable:

    boolean

    True if the call should be put on hold, false for unhold

Returns

off(event: CallEvents, handler: function): void

Remove a handler for the specified call event.

Parameters

on(event: CallEvents, handler: function): void

Register a handler for the specified call event. One event can have more than one handler. Use the Call.off method to delete a handler.

Parameters

  • handler:

    function

    Handler function. A single parameter is passed - object with event information

receiveVideo(): Promise<(void|CallOperationFailed)>

Start receive video if video receive was disabled before. Stop receiving video during the call is not supported.

Returns

reject(headers: object): void

Reject incoming call on the part of Web SDK. If a call is initiated from the PSTN, the network will receive "reject" command. In case of a call from another Web SDK client, it will receive the CallEvents.Failed event with the 603 code.

Parameters

  • headers:

    objectOptional

    Optional custom parameters (SIP headers) that should be sent after rejecting incoming call. Parameter names must start with "X-" to be processed by application

sendAudio(enable: boolean): void

Enables or disables audio transfer from microphone into the call.

Parameters

  • enable:

    boolean

    True if audio should be sent, false otherwise

sendInfo(mimeType: string, body: string, extraHeaders: object): void

Send Info (SIP INFO) message inside the call. You can get this message via the Voxengine CallEvents.InfoReceived event in the Voximplant cloud. You can get this message in Web SDK on other side via the CallEvents.InfoReceived event; see the similar events for the Web, iOS and Android SDKs.

Parameters

  • mimeType:

    string

    MIME type of the message, for example "text/plain", "multipart/mixed" etc.

  • body:

    string

    Message content

  • extraHeaders:

    objectOptional

    Optional custom parameters (SIP headers) that should be sent after rejecting incoming call. Parameter names must start with "X-" to be processed by application

sendMessage(message: string): void

Send text message. It is a special case of the Call.sendInfo method as it allows to send messages only of "text/plain" type. You can get this message via the Voxengine CallEvents.MessageReceived event in our cloud. You can get this message in Web SDK on other side via the CallEvents.MessageReceived event; see the similar events for the Web, iOS and Android SDKs.

Parameters

  • message:

    string

    Message text

sendTone(key: string): void

Send tone (DTMF). It triggers the CallEvents.ToneReceived event in the Voximplant cloud.

Parameters

  • key:

    string

    Send tone according to pressed key: 0-9 , * , #

sendVideo(enable: boolean): Promise<(void|CallOperationFailed)>

Start/stop sending video from a call. In case of a remote participant uses a React Native SDK client, it will receive either the EndpointEvents.RemoteVideoStreamAdded or EndpointEvents.RemoteVideoStreamRemoved event accordingly.

Parameters

  • enable:

    boolean

    True if video should be sent, false otherwise

Returns

Properties

The call id