hangup method

Future<void> hangup([
  1. String? reason,
  2. bool shouldEmit = true
])

Implementation

Future<void> hangup([String? reason, bool shouldEmit = true]) async {
  await terminate(
      CallParty.kLocal, reason ?? CallErrorCode.UserHangup, shouldEmit);

  try {
    final res =
        await sendHangupCall(room, callId, localPartyId, 'userHangup');
    Logs().v('[VOIP] hangup res => $res');
  } catch (e) {
    Logs().v('[VOIP] hangup error => ${e.toString()}');
  }
}