hangUp method

  1. @override
Future<int> hangUp({
  1. required int sessionId,
  2. bool reportToConnectionService = true,
})
override

Terminates an active call.

Invokes the native 'hangUp' method via MethodChannel.

Returns 0 on success, -1 or error code on failure.

Implementation

@override
Future<int> hangUp({
  required int sessionId,
  bool reportToConnectionService = true,
}) async {
  final args = {
    'sessionId': sessionId,
    'reportToConnectionService': reportToConnectionService,
  };
  _logCall('hangUp', args);
  try {
    final result = await methodChannel.invokeMethod<int>('hangUp', args);
    _logResponse('hangUp', result);
    return result ?? -1;
  } on PlatformException catch (e) {
    _logError('hangUp', e);
    return -1;
  }
}