conference method
Creates a new VICall instance and starts the conference.
conference
- The call destination.
For SIP compatibility reasons it should be a non-empty string even
if the number itself is not used by a Voximplant cloud scenario.
Optional settings
- Additional call parameters like video direction
for the call, preferred video codec, custom data.
Throws VIException, if the client is not logged in, otherwise returns VICall instance.
Errors:
- VICallError.ERROR_CLIENT_NOT_LOGGED_IN - If the client is not logged in
- VICallError.ERROR_MISSING_PERMISSION - Android only. If permissions are not granted for the call: audio calls - RECORD_AUDIO video calls - RECORD_AUDIO and CAMERA
Implementation
Future<VICall> conference(
String conference, {
VICallSettings? settings,
}) async {
try {
if (settings == null) {
settings = VICallSettings();
}
Map<String, dynamic>? data = await _channel
.invokeMapMethod<String, dynamic>('Client.call', <String, dynamic>{
'number': conference,
'sendVideo': settings.videoFlags.sendVideo,
'receiveVideo': settings.videoFlags.receiveVideo,
'videoCodec': settings.preferredVideoCodec.toString(),
'customData': settings.customData,
'extraHeaders': settings.extraHeaders,
'conference': true,
'enableSimulcast': settings.enableSimulcast,
});
if (data == null) {
_VILog._e('VIClient: conference: data was null, skipping');
throw VIException(
VIClientError.ERROR_INTERNAL,
'VIClient:conference: data was null',
);
}
VICall call = VICall._(data['callId'], _channel);
return call;
} on PlatformException catch (e) {
throw VIException(e.code, e.message);
}
}