Call
Class that provides API for call operations like answer, reject, hang up, and mid-call operations like hold, start/stop video, and others.
Methods
answer
answer(callSettings: ): void
Answers an incoming call.
Parameters
callSettings:
OptionalOptional set of call settings.
Returns
type:
void
currentQualityIssues
currentQualityIssues(): Promise<{QualityEventTypes: QualityIssueLevel}[],CallError>
Returns current status for all quality issues.
Returns
type:
Promise<{QualityEventTypes: QualityIssueLevel}[],CallError>
decline
decline(headers: object
): void
Rejects an incoming call on all devices, where this user is logged in.
Parameters
headers:
object
OptionalOptional custom parameters (SIP headers) that should be sent after rejecting incoming call. Parameter names should start with "X-" to be processed by application
Returns
type:
void
getDuration
getDuration(): Promise<number,CallError>
Gets the call duration in seconds.
Returns
type:
Promise<number,CallError>
hangup
hangup(headers: object
): void
Hangs up the call.
Parameters
headers:
object
OptionalOptional custom parameters (SIP headers) that should be sent after disconnecting/cancelling call. Parameter names should start with "X-" to be processed by application
Returns
type:
void
hold
hold(enable: boolean
): Promise<void,CallEventTypes.CallOperationFailed>
Holds or unholds the call.
Parameters
enable:
boolean
Whether the call should be put on hold
Returns
type:
Promise<void,CallEventTypes.CallOperationFailed>
off
off(eventType: , event: Function
): void
Removes a handler for the specified call event.
Parameters
eventType:
event:
Function
OptionalHandler function. If not specified, all handlers for the event are removed.
Returns
type:
void
on
on(eventType: , event: Function
): void
Registers 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
eventType:
event:
Function
Handler function. A single parameter is passed - object with event information
Returns
type:
void
receiveVideo
receiveVideo(): Promise<void,CallEventTypes.CallOperationFailed>
Starts receiving video if video receive has been disabled before. Stop receiving video during the call is not supported.
Returns
type:
Promise<void,CallEventTypes.CallOperationFailed>
reject
reject(headers: object
): void
Rejects an incoming call on the part of React Native SDK. If a call is initiated from the PSTN, the network receives the "reject" command. In case of a call from another React Native SDK client, it receives the CallEventTypes.Failed event with the 603 code.
Parameters
headers:
object
OptionalOptional custom parameters (SIP headers) that should be sent after rejecting incoming call. Parameter names should start with "X-" to be processed by application
Returns
type:
void
sendAudio
sendAudio(enable: boolean
): void
Enables/disables audio transfer from the microphone into the call.
Parameters
enable:
boolean
Whether audio should be sent
Returns
type:
void
sendInfo
sendInfo(mimeType: string
, body: string
, extraHeaders: object
): void
Sends an info (SIP INFO) message into the call. You can get this message via the Voxengine CallEventTypes.InfoReceived event in the Voximplant cloud. You can get this message in React Native SDK on other side via the CallEventTypes.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:
object
OptionalOptional custom parameters (SIP headers) that should be sent after rejecting incoming call. Parameter names should start with "X-" to be processed by application
Returns
type:
void
sendMessage
sendMessage(message: string
): void
Sends a 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 CallEventTypes.MessageReceived event in our cloud. You can get this message in React Native SDK on other side via the CallEventTypes.MessageReceived event; see the similar events for the Web, iOS and Android SDKs.
Parameters
message:
string
Message text
Returns
type:
void
sendTone
sendTone(key: string
): void
Sends a tone (DTMF). It triggers the CallEventTypes.ToneReceived event in the Voximplant cloud.
Parameters
key:
string
Send tone according to pressed key: 0-9 , * , #
Returns
type:
void
sendVideo
sendVideo(enable: boolean
): Promise<void,CallEventTypes.CallOperationFailed>
Starts/stops sending video from the call. In case if a remote participant uses a React Native SDK client, it receives either the EndpointEventTypes.RemoteVideoStreamAdded or EndpointEventTypes.RemoteVideoStreamRemoved event accordingly.
Parameters
enable:
boolean
Whether video should be sent
Returns
type:
Promise<void,CallEventTypes.CallOperationFailed>
Props
callId
callId: string
The call id
callKitUUID
callKitUUID: string
| null
CallKit UUID that may be used to match an incoming call with a push notification received before. Always null for outgoing calls on Call instance creation.
For outgoing calls it is recommended to set CXStartCallAction.callUUID value to this property on handling CXStartCallAction
qualityIssues
qualityIssues:
Instance of a class that provides API to subscribe to call quality issues events.