acceptCall method

void acceptCall(
  1. IncomingInviteParams invite,
  2. String callerName,
  3. String callerNumber,
  4. String clientState, {
  5. Map<String, String> customHeaders = const {},
})

Accepts the incoming call specified via the invite parameter, sending your local specified callerName, callerNumber and clientState

Implementation

void acceptCall(IncomingInviteParams invite, String callerName,
    String callerNumber, String clientState,
    {Map<String, String> customHeaders = const {}}) {
  callId = invite.callID;

  sessionCallerName = callerName;
  sessionCallerNumber = callerNumber;
  sessionDestinationNumber = invite.callerIdName ?? "Unknown Caller";
  sessionClientState = clientState;

  var destinationNum = invite.callerIdNumber;

  peerConnection = Peer(_txSocket);
  peerConnection?.accept(callerName, callerNumber, destinationNum!,
      clientState, callId!, invite, customHeaders);

  stopAudio();
}