new Call(id, contact)
Creates a new call
Parameters:
| Name | Type | Description | 
|---|---|---|
id | 
            
            String | call id  | 
        
contact | 
            
            Contact | called contact  | 
        
Fires:
- Call#event:streamAdded
 - Call#event:streamRemoved
 - Call#event:response
 - Call#event:accepted
 - Call#event:declined
 - Call#event:hangup
 - Call#event:localStreamAvailable
 - Call#event:recordAvailable
 - Call#event:statsUpdate
 - Call#event:error
 - Call#event:disconnectionWarning
 - Call#event:userMediaError
 - Call#event:desktopCapture
 - Call#event:remoteStreamUpdated
 - Call#event:recordingStarted
 - Call#event:recordingStopped
 - Call#event:recordingAvailable
 - Call#event:remoteStreamIdUpdated
 
Returns:
this
- Type
 - Call
 
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>
 
 - 
    
getRecordingInfo()
 - 
    
    
Returns the recoding information, if any.
Returns:
- Type
 - RecordingInfo | null
 
 - 
    
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 listenerfunction - Inherited From:
 - Overrides:
 
Returns:
this instance for chaining
- Type
 - Observable
 
 - 
    
removeListener(eventType, listener)
 - 
    
    
Remove existing listener to Observable event
Parameters:
Name Type Description eventTypeString listenerfunction - Inherited From:
 - Overrides:
 
Returns:
this instance for chaining
- Type
 - Observable
 
 - 
    
replacePublishedStreams(newStream, callbacks)
 - 
    
    
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 newStreamStream New stream to be published
callbacksobject Callbacks.
Properties
Name Type Description getStreamfunction A function returning a promise of a stream.
Returns:
The newly assigned stream.
- Type
 - Promise.<Stream>
 
 - 
    
startRecording()
 - 
    
    
Starts recording the call represented by this one.
Only available for initially recorded call.Returns:
- Type
 - Promise
 
 - 
    
stopPublishedStreams(options)
 - 
    
    
Stops the currently published stream.
Parameters:
Name Type Description optionsobject Options.
Returns:
When it is done.
- Type
 - Promise.<Stream>
 
 - 
    
stopRecording()
 - 
    
    
Stops recording the call represented by this one.
Only available for initially recorded call.Returns:
- Type
 - Promise
 
 
Events
- 
    
accepted
 - 
    
    
Fired when contact accepts call
Type: Void
 - 
    
declined
 - 
    
    
Fired when contact decline call
Type: object
Properties:
Name Type Description reasonstring 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, DataChannel_Not_Supported
 - 
    
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 mediasType: object
Properties:
Name Type Description eventString 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 triesstring 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
- ice disconnection detected: ICE_CONNECTION_STATE_DISCONNECTED
 - ice connection failed detected: ICE_CONNECTION_STATE_FAILED
 - distant ice disconnection detected: DISTANT_ICE_CONNECTION_STATE_DISCONNECTED
 - distant ice connection failed detected: DISTANT_ICE_CONNECTION_STATE_FAILED
 - 200OK received but callId is not matching, no process : NOT_MATCHING_CALLID_ON_200OK
 - Cannot find call to process Update : CALL_NOT_FOUND_ON_UPDATE
 - Cannot find call to process 200 Update : CALL_NOT_FOUND_ON_200UPDATE
 - Call aborted after calls retries (maxCallsRetriesDuration reached) : CALL_ABORTED
 - Set local Description Failure : SET_LOCAL_DESCRIPTION_FAILURE
 - Set remote Description Failure : SET_REMOTE_DESCRIPTION_FAILURE
 - parameter error when calling function: setUnidirectionalCall(): PARAMETER_ERROR_SETUNIDIRCALL
 - parameter error when calling function: setNtoNConf(): PARAMETER_ERROR_SETNTONCONF
 - parameter error when calling function: setRTPMedia(): PARAMETER_ERROR_SETRTPMEDIA
 - parameter error when calling function: setMediaRoutingMode(): PARAMETER_ERROR_SETMEDIAROUTINGMODE
 - parameter error when calling function: setUserAcceptOnIncomingCall(): PARAMETER_ERROR_SETUSERACCEPTONINCOCALL
 - Trying to add a listener on an unknown event: UNKNOWN_EVENT_ON_ADDLISTENER
 - parameter error when calling function: setAllowMultipleCalls(): PARAMETER_ERROR_SETALLOWMULTIPLECALLS
 - Room not found when starting recording: START_RECORD_ROOM_NOT_FOUND
 - Caller not found when starting recording: START_RECORD_CALLER_NOT_FOUND
 - Media not found when starting recording: START_RECORD_MEDIA_FOUND
 - Recording is already ongoing: START_RECORD_ALREADY_ON
 - Room not found when stopping recording: STOP_RECORD_ROOM_NOT_FOUND
 - Caller not found when stopping recording: STOP_RECORD_CALLER_NOT_FOUND
 - Media not found when stopping recording: STOP_RECORD_MEDIA_FOUND
 - Recorder not found when stopping recording: STOP_RECORD_ENDPOINT_NOT_FOUND
 - Recording is not started stopping recording: STOP_RECORD_NOT_STARTED
 - Recorder is not ready yet, record is not started: STOP_RECORD_RECORDER_NOT_READY
 - Autoplay was prevented: IOS_AUTOPLAY_PREVENTED
 - Error during media update on call: MEDIA_UPDATE_ERROR
 - Error during media media access: USER_MEDIA_ERROR
 - Error during subscription: STREAM_NOT_AVAILABLE
 
Properties:
Name Type Description errorCodeString Code description of the error. Check possible values below.
errorInfoString Code information about the error. Check possible values below.
Possible errors values are the following: (errorInfo, errorCode)
Connection errors:descriptorCallIceErrorDescriptor | 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 fromstring reasonstring 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, DataChannel_Not_Supported
 - 
    
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 mediaURLstring video file URL
 - 
    
recordingAvailable
 - 
    
    
Fired when a recording is available for play or download.
Type: RecordingInfo
 - 
    
recordingStarted
 - 
    
    
Fired when a recording started.
Type: RecordingInfo
 - 
    
recordingStopped
 - 
    
    
Fired when a recording stopped.
Type: RecordingInfo
 - 
    
remoteStreamIdUpdated
 - 
    
    
Fired when remote streamId is changed after a call to replacePublishedStream().
Type: object
Properties:
Name Type Description callIdstring callId
newStreamIdstring the new streamId
oldStreamIdstring former streamId
 - 
    
remoteStreamIdUpdated
 - 
    
    
Fired when remote streamId is changed after a call to replacePublishedStream().
Type: object
Properties:
Name Type Description callIdstring callId
newStreamIdstring the new streamId
oldStreamIdstring former streamId
 - 
    
remoteStreamUpdated
 - 
    
    
Fired when remote stream properties changed.
Type: object
Properties:
Name Type Description callIdstring callId
audioboolean whether an audio line has been negotiated and active.
audioMutedboolean whether the audio line is muted.
videoboolean whether a video line has been negotiated and active.
videoMutedboolean 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 mediasType: object
Properties:
Name Type Description onCallEstablishmentString true or false, indicate whether access to media has been requested on call establishment or not (can be requested on autoAnswer feature activation)
callTypeString value can be 'media' or screenSharing
errorObject error given by WebRTC API
userMediaStreamIdString stream id
tryAudioCallActivatedBoolean whether apiRTC will try to establish the call in audio only after this error detection