newInvite method

void newInvite(
  1. String callerName,
  2. String callerNumber,
  3. String destinationNumber,
  4. String clientState, {
  5. Map<String, String> customHeaders = const {},
  6. bool debug = false,
})

Creates an invitation to send to a destinationNumber or SIP Destination using the provided callerName, callerNumber and a clientState

@param callerName The name of the caller @param callerNumber The number of the caller @param destinationNumber The number to call @param clientState Custom client state to pass with the call @param customHeaders Optional custom SIP headers @param debug Whether to enable call quality metrics (default: false)

Implementation

void newInvite(
  String callerName,
  String callerNumber,
  String destinationNumber,
  String clientState, {
  Map<String, String> customHeaders = const {},
  bool debug = false,
}) {
  // Store the session information for later use
  sessionCallerName = callerName;
  sessionCallerNumber = callerNumber;
  sessionDestinationNumber = destinationNumber;
  sessionClientState = clientState;
  this.customHeaders = Map.from(customHeaders);

  _txClient.newInvite(
    callerName,
    callerNumber,
    destinationNumber,
    clientState,
    customHeaders: customHeaders,
  );
}