hangup method

bool hangup({
  1. String? callId,
})

Implementation

bool hangup({String? callId}) {
  if (callId == null) {
    if (!callCurrentIsEmpty() &&
        _sipuaHelper.findCall(_callIdCurrent!) != null) {
      _releaseCall(callId: _callIdCurrent);
      return true;
    } else {
      _releaseCall(callId: null); //! WARNING: check releaseCall
      // _logger.error('You have to set callIdCurrent or pass param callId');
      return true;
    }
  } else {
    if (_sipuaHelper.findCall(callId) != null) {
      _releaseCall(callId: callId);
      return true;
    }
    return false;
  }
}