Rate this page:

Call

The Call class represents a single call, inbound or outbound. For outbound call it is retrieved from the Client class instance. For inbound call use a handler for the Events.IncomingCall event. Note that Web SDK allows is able to manage a lot of calls.

Methods

active

Copy URL
active(): 

boolean

Returns 'true' if a call is active, otherwise returns 'false'. A single call (either inbound or outbound) is active by default, all other calls are inactive and should be activated via the setActive method. Only the active call sends and receives an audio/video stream.

Returns

  • type:

    boolean

answer

Copy URL
answer(customData: 

string

,
extraHeaders:

{[id: string]: string}

,
useVideo:

VideoFlags

,
H264first:

boolean

):

void

Answer the incoming call. There are two methods for an Events.IncomingCall: Call.answer and Call.decline. Voice can be sended only after the Call.answer method call.

Parameters

  • customData:

    string

    Optional

    Set custom string associated with call session. It can be later obtained from Call History using HTTP API, see the custom_data field in result. Custom data can be retrieved on the part of Voxengine via the customData method. Maximum size is 200 bytes.

  • extraHeaders:

    {[id: string]: string}

    Optional

    Optional custom parameters (SIP headers) that are sent to another participant after accepting an incoming call. Header names have to begin with the 'X-' prefix. The "X-" headers could be handled only by SIP phones/devices.

  • useVideo:

    VideoFlags

    Optional

    A set of flags defining if sending and receiving video is allowed.

  • H264first:

    boolean

    Optional

    Use H264 video codec, if exist

Returns

  • type:

    void

decline

Copy URL
decline(extraHeaders: 

{[id: string]: string}

):

void

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

Parameters

  • extraHeaders:

    {[id: string]: string}

    Optional

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

Returns

  • type:

    void

displayName

Copy URL
displayName(): 

string

Returns

  • type:

    string

getCallDuration

Copy URL
getCallDuration(): 

number

Returns

  • type:

    number

getEndpoints

Copy URL
getEndpoints(): 

Endpoint[]

Get all current Endpoints in the call.

Returns

hangup

Copy URL
hangup(extraHeaders: 

{[p: string]: string}

):

void

Parameters

  • extraHeaders:

    {[p: string]: string}

    Optional

Returns

  • type:

    void

headers

Copy URL
headers(): 

{[id: string]: string}

Returns headers

Returns

  • type:

    {[id: string]: string}

id

Copy URL
id(): 

string

Returns

  • type:

    string

isMicrophoneMuted

Copy URL
isMicrophoneMuted(): 

boolean

Returns the current state of the microphone in this call.

Returns

  • type:

    boolean

muteMicrophone

Copy URL
muteMicrophone(): 

void

Returns

  • type:

    void

mutePlayback

Copy URL
mutePlayback(): 

void

Mute sound

Returns

  • type:

    void

number

Copy URL
number(): 

string

Returns

  • type:

    string

off

Copy URL
off(event: 

CallEvents

,
handler:

Function

):

void

Remove a handler for the specified event. The method is a shorter equivalent for removeEventListener. If a number of events has the same function as a handler, the method can be called multiple times with the same handler argument.

Parameters

Returns

  • type:

    void

on

Copy URL
on(event: 

CallEvents

,
handler:

Function

,
options:

EventListenerOption

):

void

Register a handler for the specified event. The method is a shorter equivalent for addEventListener. One event can have more than one handler; handlers are executed in order of registration. Use the Call.off method to delete a handler.

Parameters

  • Event class (i.e. CallEvents.Connected. See CallEvents.

  • handler:

    Function

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

  • options:

    EventListenerOption

    Optional

Returns

  • type:

    void

reject

Copy URL
reject(extraHeaders: 

{[id: string]: string}

):

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

  • extraHeaders:

    {[id: string]: string}

    Optional

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

Returns

  • type:

    void

sendInfo

Copy URL
sendInfo(mimeType: 

string

,
body:

string

,
extraHeaders:

{[id: string]: string}

):

void

Send Info (SIP INFO) message inside the callYou can get this message via the Voxengine CallEvents.InfoReceived event in our cloud.

You can get this message in Web SDK on other side via the CallEvents.InfoReceived event; see the similar events for the iOS and Android SDKs.

Parameters

  • mimeType:

    string

    MIME type of the message, e.g. "text/plain", "multipart/mixed" etc.

  • body:

    string

    Message content

  • extraHeaders:

    {[id: string]: string}

    Optional

    Optional headers to be passed with the message

Returns

  • type:

    void

sendMessage

Copy URL
sendMessage(msg: 

string

):

void

Parameters

  • msg:

    string

Returns

  • type:

    void

sendTone

Copy URL
sendTone(key: 

string

):

void

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

Parameters

  • key:

    string

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

Returns

  • type:

    void

sendVideo

Copy URL
sendVideo(flag: 

boolean

):

Promise<CallEvents.Updated>

Parameters

  • flag:

    boolean

Returns

setActive

Copy URL
setActive(flag: 

boolean

):

Promise<CallEvents.Updated>

The method makes a call active, i.e. change the active flag to 'true'. A single call (either inbound or outbound) is active by default, all other calls are inactive and should be activated.

Parameters

  • flag:

    boolean

Returns

shareScreen

Copy URL
shareScreen(showLocalView: 

boolean

,
replaceVideo:

boolean

):

Promise<CallEvents.Updated>

Starts screen sharing and replaces local and sent video. Since the 4.6.0 version, the showLocalView and replaceVideo arguments are deprecated.

Parameters

  • showLocalView:

    boolean

    Optional
  • replaceVideo:

    boolean

    Optional

Returns

state

Copy URL
state(): 

CallState

Returns

stopSharingScreen

Copy URL
stopSharingScreen(): 

Promise<SharingStopped>

Stops screen sharing started via the shareScreen() method. Since the 4.6.0 version, the BeforeMediaRendererRemoved and MediaRendererRemoved events are deprecated for the local video. Use MediaRendererUpdated instead.

Returns

unmuteMicrophone

Copy URL
unmuteMicrophone(): 

void

Returns

  • type:

    void

unmutePlayback

Copy URL
unmutePlayback(): 

void

Unmute sound

Returns

  • type:

    void

Props

audioMediaTrackTransform

Copy URL
audioMediaTrackTransform: 

(MediaStreamTrack: any) => MediaStreamTrack

audioSenderTransform

Copy URL
audioSenderTransform: 

TransformStream

rearangeCodecs

Copy URL
rearangeCodecs: 

(codecList: CodecSorterUserCodecList, incoming: boolean) => Promise<CodecSorterUserCodecList>

Callback for manual rearrangement or setup compatible codec list. If will set unknown/unsupported codec - it will be ignored

videoMediaTrackTransform

Copy URL
videoMediaTrackTransform: 

(MediaStreamTrack: any) => MediaStreamTrack

videoSenderTransform

Copy URL
videoSenderTransform: 

TransformStream