VICall
Represents a call.
Methods
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>
Future<Map<VIQualityIssueType, VIQualityIssueLevel>>
currentQualityIssues()Returns current status for all quality issues.
Returns
type:
Future<Map<VIQualityIssueType, VIQualityIssueLevel>>
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>
Future<int?>
getCallDuration()Returns the call duration in milliseconds.
Returns
type:
Future<int?>
Future<void>
hangup([Map<String, String>?
headers])Disconnects the call.
Parameters
headers:
Map<String, String>?
OptionalOptional SIP headers
Returns
type:
Future<void>
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>
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>
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>
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>
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>
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>
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>
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
String
callIdCall ID.
Returns
type:
String
String?
callKitUUIDCallKit 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?
onCallAudioStartedTriggered when the endpoint answered the call.
Returns
type:
onCallConnectedTriggered when the call is connected.
Returns
type:
onCallDisconnectedTriggered when the call is disconnected.
Returns
type:
onCallReconnectedTriggered when the call is reconnected.
Returns
type:
onCallReconnectingTriggered when the call is currently reconnecting.
Returns
type:
onCallRingingTriggered when a progress tone is received from the endpoint.
Returns
type:
onEndpointAddedTriggered when a new endpoint is added to the call.
Returns
type:
onICECompletedTriggered when the ICE connection is completed.
Returns
type:
onICETimeoutCallback for getting notified about failure to connect peers.
Returns
type:
onLocalVideoStreamAddedTriggered when the local video is added to the call.
Returns
type:
onLocalVideoStreamRemovedTriggered when the local video is removed from the call.
Returns
onMessageReceivedTriggered when a message is received.
Returns
type:
onSIPInfoReceivedTriggered when an INFO message in received.
Returns
type:
Stream<VIQualityIssue>
qualityIssuesStreamStream 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>