VICall
Represents a call.
Methods
answer
Future<void>
answer({ settings})
Answers the incoming call.
Additional call parameters are set up via [settings]: video direction for the call, preferred video codec, custom data.
Throws VIException, if an error occurred.
Errors:
- ERROR_MISSING_PERMISSION - Android only. If permissions are not granted for the call: audio calls - RECORD_AUDIO video calls - RECORD_AUDIO and CAMERA
- ERROR_INCORRECT_OPERATION - Android only. If the call is already answered.
Parameters
settings:
OptionalAdditional call parameters like video direction for the call, preferred video codec, custom data.
Returns
type:
Future<void>
currentQualityIssues
Future<Map<VIQualityIssueType, VIQualityIssueLevel>>
currentQualityIssues()
Returns current status for all quality issues.
Returns
type:
Future<Map<VIQualityIssueType, VIQualityIssueLevel>>
decline
Future<void>
decline([Map<String, String>?
headers])
Declines the incoming call.
Should be used only for incoming calls.
Indicates that the user cannot answer the call right now, and VoxEngine terminates the call and any pending calls to other devices of the current user.
Throws VIException, if an error occurred.
Errors:
- ERROR_INCORRECT_OPERATION - Android only. If the call is already answered or ended.
Parameters
headers:
Map<String, String>?
OptionalOptional SIP headers
Returns
type:
Future<void>
getCallDuration
Future<int?>
getCallDuration()
Returns the call duration in milliseconds.
Returns
type:
Future<int?>
hangup
Future<void>
hangup([Map<String, String>?
headers])
Disconnects the call.
Parameters
headers:
Map<String, String>?
OptionalOptional SIP headers
Returns
type:
Future<void>
hold
Future<void>
hold(bool
enable)
Puts the call on/off hold.
Throws VIException, if an error occurred.
Errors:
- ERROR_REJECTED - If the operation is rejected.
- ERROR_ALREADY_IN_THIS_STATE - If the call is already in the requested state.
- ERROR_INCORRECT_OPERATION - If the call is not connected.
- ERROR_INTERNAL - If an internal error occurred.
- ERROR_TIMEOUT - If the operation is not completed in time.
- ERROR_RECONNECTING - If the call is currently reconnecting.
Parameters
enable:
bool
Whether the call should be hold/unhold.
Returns
type:
Future<void>
receiveVideo
Future<void>
receiveVideo()
Starts receiving video if video receive has been disabled before.
Stops receiving video during the call is not supported.
Throws VIException, if an error occurred.
Errors:
- ERROR_REJECTED - If the operation is rejected.
- ERROR_ALREADY_IN_THIS_STATE - If the call is already in the requested state.
- ERROR_INCORRECT_OPERATION - If the call is not connected.
- ERROR_INTERNAL - If an internal error occurred.
- ERROR_TIMEOUT - If the operation is not completed in time.
- ERROR_MISSING_PERMISSION - Android only. If CAMERA permission is not granted.
- ERROR_MEDIA_IS_ON_HOLD - If the call is currently on hold. Put the call off hold and repeat the operation.
- ERROR_RECONNECTING - If the call is currently reconnecting.
Returns
type:
Future<void>
reject
Future<void>
reject([Map<String, String>?
headers])
Rejects the incoming call.
Should be used only for incoming calls.
Indicates that the user is not available only at a particular device.
Throws VIException, if an error occurred.
Errors:
- ERROR_INCORRECT_OPERATION - Android only. If the call is already answered or ended.
Parameters
headers:
Map<String, String>?
OptionalOptional SIP headers
Returns
type:
Future<void>
sendAudio
Future<void>
sendAudio(bool
enable)
Enables or disables audio transfer from microphone into the call.
Parameters
enable:
bool
Whether the audio should be sent
Returns
type:
Future<void>
sendInfo
Future<void>
sendInfo(String
mimeType, String
body, Map<String, String>?
headers)
Sends an INFO message within the call.
INFO message is sent, if the call is establishing or established.
Parameters
mimeType:
String
MIME type of info
body:
String
Custom string data
headers:
Map<String, String>?
Optional SIP headers
Returns
type:
Future<void>
sendMessage
Future<void>
sendMessage(String
message)
Sends a [message] within the call.
Implemented atop SIP INFO for communication between call endpoint and the Voximplant cloud, and is separated from Voximplant messaging API.
Parameters
message:
String
Message text
Returns
type:
Future<void>
sendTone
Future<void>
sendTone(String
key)
Sends DTMFs in the call.
DTMFs can be sent only if the call is connected.
Parameters
key:
String
DTMFs
Returns
type:
Future<void>
sendVideo
Future<void>
sendVideo(bool
enable)
Starts or stops sending video for the call.
Fot the non-conference video call it stops or starts video send (video stream is removed or added).
For the conference call it mutes or un-mutes video send (video stream in the 'muted' state still consumes a small bandwidth).
Throws VIException, if an error occurred.
Errors:
- ERROR_REJECTED - If the operation is rejected.
- ERROR_ALREADY_IN_THIS_STATE - If the call is already in the requested state.
- ERROR_INCORRECT_OPERATION - If the call is not connected.
- ERROR_INTERNAL - If an internal error occurred.
- ERROR_TIMEOUT - If the operation is not completed in time.
- ERROR_MISSING_PERMISSION - Android only. If CAMERA permission is not granted.
- ERROR_MEDIA_IS_ON_HOLD - If the call is currently on hold. Put the call off hold and repeat the operation.
- ERROR_RECONNECTING - If the call is currently reconnecting.
Parameters
enable:
bool
Whether the video should be sent
Returns
type:
Future<void>
Props
callId
String
callId
Call ID.
Returns
type:
String
callKitUUID
String?
callKitUUID
CallKit UUID that may be used to match an incoming call with a push notification received before.
Implemented for iOS only.
Always null for outgoing call on VICall instance creation.
For outgoing calls it is recommended to set CXStartCallAction.callUUID value to this property on handling CXStartCallAction.
Returns
type:
String?
onCallAudioStarted
onCallAudioStarted
Triggered when the endpoint answered the call.
Returns
type:
onCallConnected
onCallConnected
Triggered when the call is connected.
Returns
type:
onCallDisconnected
onCallDisconnected
Triggered when the call is disconnected.
Returns
type:
onCallReconnected
onCallReconnected
Triggered when the call is reconnected.
Returns
type:
onCallReconnecting
onCallReconnecting
Triggered when the call is currently reconnecting.
Returns
type:
onCallRinging
onCallRinging
Triggered when a progress tone is received from the endpoint.
Returns
type:
onEndpointAdded
onEndpointAdded
Triggered when a new endpoint is added to the call.
Returns
type:
onICECompleted
onICECompleted
Triggered when the ICE connection is completed.
Returns
type:
onICETimeout
onICETimeout
Callback for getting notified about failure to connect peers.
Returns
type:
onLocalVideoStreamAdded
onLocalVideoStreamAdded
Triggered when the local video is added to the call.
Returns
type:
onLocalVideoStreamRemoved
onLocalVideoStreamRemoved
Triggered when the local video is removed from the call.
Returns
onMessageReceived
onMessageReceived
Triggered when a message is received.
Returns
type:
onSIPInfoReceived
onSIPInfoReceived
Triggered when an INFO message in received.
Returns
type:
qualityIssuesStream
Stream<VIQualityIssue>
qualityIssuesStream
Stream to monitor issues that affect call quality.
Quality issues are detected only if a call is connected. If a call is reconnecting, all previously detected issues (if any) are reset, their issue level is changed to None
Returns
type:
Stream<VIQualityIssue>