acceptCall method

void acceptCall({
  1. dynamic completion(
    1. bool
    )?,
})

Implementation

void acceptCall({Function(bool)? completion}) async {
  final microphoneStatus = await Permission.microphone.request();
  final deviceId = await _getDeviceId();
  _addStep(step: "acceptCall", data: {"microphone": microphoneStatus.isGranted, "deviceId":deviceId});
  if (microphoneStatus.isGranted == false) {
    final callback = completion;
    if (callback != null) {
      callback(false);
    }
  } else {
    final callback = completion;
    if (callback != null) {
      callback(true);
    }
    _callAccepted = true;
    _addDelegateEvent(name: kNotiWebRtcConfOnConnecting);
    _sendCallReady();
  }
}