acceptCall method

Future<void> acceptCall({
  1. RTCSessionDescription? answer,
})

Accept the incoming call

sends request with payload as: `{ "request" : "accept",

}`

along with the payload it internally creates the answer with sendRecv true and sends it.

Optionally you can provide your own answer if you want, in answer property.

Since it is asynchronous request result can only be extracted from event messages

Implementation

Future<void> acceptCall({RTCSessionDescription? answer}) async {
  var payload = {"request": "accept"};
  if (answer == null) {
    answer = await createAnswer();
  }
  await this.send(data: payload, jsep: answer);
}