Class: Call

Call

Call

Designates a 1-1 call with another contact.
During a call, both the user and the contact may publish and subscribe to each other's streams.

Extends

Methods


<static> getAvailableEvents()

Returns available events for this class

Returns:
Type
Array.<string>

destroy()

Cleans up all resources attached to this one.


getContact()

Returns called contact

Returns:

Called contact

Type
Contact

getId()

Returns call id

Returns:

Call id

Type
string

getPublishedStreams()

Returns call's currently published streams

Returns:

Array of call currently published streams

Type
Array.<Streams>

getReceivedStreams()

Returns call's currently received streams

Returns:

Array of call currently received streams

Type
Array.<Streams>

getStatus()

Returns called status

Returns:

Call status, value can be CALL_STATUS_WAITING_FOR_CALLEE, CALL_STATUS_ONGOING, CALL_STATUS_ENDED

Type
Symbol

hangUp()

Stops call with contact

Returns:
Type
Void

isRecorded()

Returns whether call is recorded or not

Returns:
Type
boolean

on(listener)

Adds a listener to a Observable event

Parameters:
Name Type Description
listener function
Inherited From:
Returns:

this instance for chaining

Type
Observable

removeListener(eventType, listener)

Remove existing listener to Observable event

Parameters:
Name Type Description
eventType String
listener function
Inherited From:
Returns:

this instance for chaining

Type
Observable

replacePublishedStreams(newStream, callbacks, options)

Replaces the currently published stream by a given one.
If the first parameter is null then the second parameter must provides a property named
getStream. The getStream property shall be a function returning a Promise of a Stream.

Parameters:
Name Type Description
newStream Stream

New stream to be published

callbacks object

Callbacks.

Properties
Name Type Description
getStream function

A function returning a promise of a stream.

options object

Options.

Returns:

The newly assigned stream.

Type
Promise.<Stream>

stopPublishedStreams(options)

Stops the currently published stream.

Parameters:
Name Type Description
options object

Options.

Returns:

When it is done.

Type
Promise.<Stream>

Events


accepted

Fired when contact accepts call

Type: Void

declined

Fired when contact decline call

Type: object
Properties:
Name Type Description
reason string

can be User_Busy, User_Refused_Call, User_Media_Error, Hangup_From_Callee, Hangup_From_Caller, stop_ScreenSharing, Ice_disconnected, Ice_failed, WebRTC_Plugin_Installation_needed, User_Not_Found, disconnected, call take on other device, bye on other device


desktopCapture

Fired on user media access error :
This event is fired when user has not granted the access to his micro and webcam or brower was not able to access medias

Type: object
Properties:
Name Type Description
event String

event that has happened. Values can be : UserMediaError_HTTPS_needed, UserMediaError, Extension_installation_Error, Extension_not_installed, Browser_Not_Compatible


disconnectionWarning

Fired when an disconnection is detected
This event is fired as a warning once a disconnection error was detected on the call.

Type: object
Properties:
Name Type Description
tries string

number of warning send


error

Fired when an error is detected
This event is fired once an error was detected on the call.

Type: object
Properties:
Name Type Description
errorCode string

Code description of the error

errorInfo string

Code information about the error

descriptor object

Detailed descriptor of the error


hangup

Fired when contact hangs up from 1-1 call
'from' property indicates which side initiated the hangup, either 'remote' or 'local'

Type: object
Properties:
Name Type Description
from string
reason string

can be User_Busy, User_Refused_Call, User_Media_Error, Hangup_From_Callee, Hangup_From_Caller, stop_ScreenSharing, Ice_disconnected, Ice_failed, WebRTC_Plugin_Installation_needed, User_Not_Found, disconnected, call take on other device, bye on other device


localStreamAvailable

Fired when local stream is available after calling the contact

Type: Stream

recordAvailable

Fired when call record is available.
This event is fired once the call is ended for both peers if the call was recorded.

Type: object
Properties:
Name Type Description
mediaURL string

video file URL


remoteStreamUpdated

Fired when remote stream properties changed.

Type: object
Properties:
Name Type Description
callId string

callId

audio boolean

whether an audio line has been negotiated and active.

audioMuted boolean

whether the audio line is muted.

video boolean

whether a video line has been negotiated and active.

videoMuted boolean

whether the video line is muted.


response

Fired when contact accepted or declined call

Type: Void

statsUpdate

Fired when call record is available.
This event is fired once the call is ended for both peers if the call was recorded.

Type: CallStats

streamAdded

Fired when contact's stream is received from 1-1 call

Type: Stream

streamRemoved

Fired when contact's stream is removed from 1-1 call, stream may be null

Type: Stream

userMediaError

Fired on user media access error :
This event is fired when user has not granted the access to his micro and webcam or brower was not able to access medias

Type: object
Properties:
Name Type Description
onCallEstablishment String

true or false, indicate whether access to media has been requested on call establishment or not (can be requested on autoAnswer feature activation)

callType String

value can be 'media' or screenSharing

error Object

error given by WebRTC API

userMediaStreamId String

stream id

tryAudioCallActivated Boolean

whether apiRTC will try to establish the call in audio only after this error detection