accept method

void accept(
  1. String callerName,
  2. String callerNumber,
  3. String destinationNumber,
  4. String clientState,
  5. String callId,
  6. IncomingInviteParams invite,
  7. Map<String, String> customHeaders,
)

Implementation

void accept(
    String callerName,
    String callerNumber,
    String destinationNumber,
    String clientState,
    String callId,
    IncomingInviteParams invite,
    Map<String, String> customHeaders) async {
  var sessionId = _selfId;
  Session session = await _createSession(null,
      peerId: "0", sessionId: sessionId, media: "audio");
  _sessions[sessionId] = session;

  await session.peerConnection
      ?.setRemoteDescription(RTCSessionDescription(invite.sdp, "offer"));

  _createAnswer(session, "audio", callerName, callerNumber, destinationNumber,
      clientState, callId, customHeaders);

  onCallStateChange?.call(session, CallState.newCall);
}