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
answer(callSettings: ): void
Answer the 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
Reject incoming call on all devices, where this user logged in.
Parameters
headers:
object
OptionalOptional 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
getDuration
getDuration(): Promise<number,CallError>
Get the call duration in seconds
Returns
type:
Promise<number,CallError>
hangup
hangup(headers: object
): void
Hangup the call
Parameters
headers:
object
OptionalOptional custom parameters (SIP headers) that should be sent after disconnecting/cancelling call. Parameter names must start with "X-" to be processed by application
Returns
type:
void
hold
hold(enable: boolean
): Promise<void,CallEventTypes.CallOperationFailed>
Hold or unhold the call
Parameters
enable:
boolean
True if the call should be put on hold, false for unhold
Returns
type:
Promise<void,CallEventTypes.CallOperationFailed>
off
off(eventType: , event: Function
): void
Remove a handler for the specified call event.
Parameters
eventType:
event:
Function
OptionalHandler function. If not specified, all handlers for the event will be removed.
Returns
type:
void
on
on(eventType: , event: 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
eventType:
event:
Function
Handler function. A single parameter is passed - object with event information
Returns
type:
void
receiveVideo
receiveVideo(): Promise<void,CallEventTypes.CallOperationFailed>
Start receive video if video receive was disabled before. Stop receiving video during the call is not supported.
Returns
type:
Promise<void,CallEventTypes.CallOperationFailed>
reject
reject(headers: object
): void
Reject incoming call on the part of React Native SDK. If a call is initiated from the PSTN, the network will receive "reject" command. In case of a call from another React Native SDK client, it will receive 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 must start with "X-" to be processed by application
Returns
type:
void
sendAudio
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
Returns
type:
void
sendInfo
sendInfo(mimeType: string
, body: string
, extraHeaders: object
): void
Send Info (SIP INFO) message inside 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 must start with "X-" to be processed by application
Returns
type:
void
sendMessage
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 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
Send 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>
Start/stop sending video from a call. In case of a remote participant uses a React Native SDK client, it will receive either the EndpointEventTypes.RemoteVideoStreamAdded or EndpointEventTypes.RemoteVideoStreamRemoved event accordingly.
Parameters
enable:
boolean
True if video should be sent, false otherwise
Returns
type:
Promise<void,CallEventTypes.CallOperationFailed>
Props
callId
callId: string
The call id
callKitUUID
callKitUUID: string
| null
The 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 may be used to subscribe to call quality issues events.