dtmf method

void dtmf(
  1. String? callID,
  2. String tone
)

Sends a DTMF message with the chosen tone to the call specified via the callID

Implementation

void dtmf(String? callID, String tone) {
  var uuid = const Uuid().v4();
  var dialogParams = DialogParams(
      attach: false,
      audio: true,
      callID: callId,
      callerIdName: sessionCallerName,
      callerIdNumber: sessionCallerNumber,
      clientState: sessionClientState,
      destinationNumber: sessionDestinationNumber,
      remoteCallerIdName: "",
      screenShare: false,
      useStereo: false,
      userVariables: [],
      video: false);

  var infoParams =
      InfoParams(dialogParams: dialogParams, dtmf: tone, sessid: _sessid);

  var dtmfMessageBody = DtmfInfoMessage(
      id: uuid,
      jsonrpc: JsonRPCConstant.jsonrpc,
      method: SocketMethod.INFO,
      params: infoParams);

  String jsonDtmfMessage = jsonEncode(dtmfMessageBody);
  _txSocket.send(jsonDtmfMessage);
}