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 can't answer the call right now, and VoxEngine will terminate 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
True if the call should be put on hold, false for unhold
Returns
type:
Future<void>
receiveVideo
Future<void>
receiveVideo()
Starts to receive video if video receive was disabled before.
Stop 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
True if audio should be sent, false otherwise
Returns
type:
Future<void>
sendInfo
Future<void>
sendInfo(String
mimeType, String
body, Map<String, String>?
headers)
Send INFO message within the call.
INFO message will be 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 [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 will still consume 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
True if video should be sent, false otherwise
Returns
type:
Future<void>
Props
callId
String
callId
The call id.
Returns
type:
String
callKitUUID
String?
callKitUUID
The 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?
endpoints
List<VIEndpoint>
endpoints
The endpoints associated with the call.
Returns
type:
List<VIEndpoint>
localVideoStream
localVideoStream
The active local video stream.
Returns
type:
onCallAudioStarted
onCallAudioStarted
Callback for getting notified when the endpoint answered the call.
Returns
type:
onCallConnected
onCallConnected
Callback for getting notified when the call is connected.
Returns
type:
onCallDisconnected
onCallDisconnected
Callback for getting notified when the call is disconnected.
Returns
type:
onCallFailed
onCallFailed
Callback for getting notified when the call is failed.
Returns
type:
onCallReconnected
onCallReconnected
Callback for getting notified when the call is reconnected.
Returns
type:
onCallReconnecting
onCallReconnecting
Callback for getting notified when the call is currently reconnecting.
Returns
type:
onCallRinging
onCallRinging
Callback for getting notified when progress signal is received from the endpoint.
Returns
type:
onEndpointAdded
onEndpointAdded
Callback for getting notified when new endpoint is added to the call.
Returns
type:
onICECompleted
onICECompleted
Callback for getting notified when ICE connection is completed.
Returns
type:
onICETimeout
onICETimeout
Callback for getting notified about failure to connect peers.
Returns
type:
onLocalVideoStreamAdded
onLocalVideoStreamAdded
Callback for getting notified when local video is added to the call.
Returns
type:
onLocalVideoStreamRemoved
onLocalVideoStreamRemoved
Callback for getting notified when local video is removed from the call.
Returns
onMessageReceived
onMessageReceived
Callback for getting notified when message is received.
Returns
type:
onSIPInfoReceived
onSIPInfoReceived
Callback for getting notified when 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>