declineCall method

dynamic declineCall(
  1. dynamic from,
  2. dynamic mcToken
)

Implementation

declineCall(from, mcToken) {
  print(
      "i am here in decline call $from $mcToken $callSessionUUID $ismultisession $screenSessionUUID");
  if (ismultisession) {
    Map<String, dynamic> jsonData = {
      "type": "response",
      "from": from,
      "requestType": "session_cancel",
      "requestId": _generateMd5(
          DateTime.now().millisecondsSinceEpoch.toString() +
              tenantID +
              ref_id!),
      "sessionUuid": callSessionUUID,
      "mcToken": mcToken
    };

    print("this is json data in declinee calll $jsonData");
    _socket?.send(jsonData);

    Map<String, dynamic> jsonData1 = {
      "type": "response",
      "from": from,
      "requestType": "session_cancel",
      "requestId": _generateMd5(
          DateTime.now().millisecondsSinceEpoch.toString() +
              tenantID +
              ref_id!),
      "sessionUuid": screenSessionUUID,
      "mcToken": mcToken
    };

    print("this is json data in declinee calll $jsonData1");
    _socket?.send(jsonData1);
    inCall = false;
  } else {
    Map<String, dynamic> jsonData = {
      "type": "response",
      "from": from,
      "requestType": "session_cancel",
      "requestId": _generateMd5(
          DateTime.now().millisecondsSinceEpoch.toString() +
              tenantID +
              ref_id!),
      "sessionUuid": callSessionUUID,
      "mcToken": mcToken
    };

    print("this is json data in declinee calll $jsonData");
    _socket?.send(jsonData);
    inCall = false;
  }
}