toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['attach'] = attach;
  data['audio'] = audio;
  data['callID'] = callID;
  data['caller_id_name'] = callerIdName;
  data['caller_id_number'] = callerIdNumber;
  data['clientState'] = clientState;
  data['destination_number'] = destinationNumber;
  data['remote_caller_id_name'] = remoteCallerIdName;
  data['screenShare'] = screenShare;
  data['useStereo'] = useStereo;
  if (userVariables != null) {
    data['userVariables'] = userVariables!.map((v) => v.toJson()).toList();
  }
  if (customHeaders != null) {
    final headers = <CustomHeader>[];
    customHeaders!.forEach((key, value) {
      headers.add(CustomHeader(name: key, value: value));
    });
    data['custom_headers'] = headers.map((e) => e.toJson()).toList();
  }
  data['video'] = video;
  return data;
}