hangUp method

  1. @override
Future<int> hangUp({
  1. required int sessionId,
})
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}) async {
  final args = {'sessionId': sessionId};
  _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;
  }
}