statsEndCall method
Implementation
Future<void> statsEndCall() async {
// // callEndBattery = await battery.batteryLevel;
// String osVersion = "";
// if (Device.get().isTablet) {
// deviceCategory = "tablet";
// print("this is device category $deviceCategory");
// } else if (Device.get().isPhone) {
// deviceCategory = "mobile";
// print("this is device category $deviceCategory");
// } else {}
// if (Device.get().isAndroid) {
// deviceType = "android";
// AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
// deviceModel = androidInfo.manufacturer! + androidInfo.model.toString();
// osVersion = androidInfo.version.sdkInt.toString();
// print(
// "this is android info $deviceModel ${androidInfo.version.sdkInt} ${androidInfo.product} ");
// } else {
// deviceType = "ios";
// // DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
// IosDeviceInfo iosInfo = await deviceInfo.iosInfo;
// deviceModel = iosInfo.name! + iosInfo.model!;
// osVersion = iosInfo.systemVersion.toString();
// // print(
// // "this is ios info $deviceModel ${iosInfo.version} ${iosInfo.product} ");
// }
// final ipv4 = await Ipify.ipv4();
// //print("this is battttery ${await battery.batteryLevel}");
// // var wifiIP = await WifiInfo().getWifiIP();
// Map<String, dynamic> callEndStatsjsonData = {
// "mcToken": mcToken,
// "referenceId": ref_id,
// "requestId": _generateMd5(
// DateTime.now().millisecondsSinceEpoch.toString() +
// tenantID +
// ref_id!),
// "sessionUuid": callSessionUUID,
// "stats": {
// "type": "data",
// "userType": userType,
// "joinTime": starttime == null
// ? "0"
// : starttime?.millisecondsSinceEpoch.toString(),
// "leftTime": DateTime.now().millisecondsSinceEpoch.toString(),
// "deviceCategory": deviceCategory,
// "deviceType": Platform.isAndroid ? "flutter_android" : "flutter_ios",
// "deviceModel": deviceModel,
// "deviceOs": osVersion,
// "localIp": "192.168.0.1",
// "publicIp": ipv4,
// "batteryUsage": callStartBattery == 0
// ? "0"
// : (callStartBattery - callEndBattery).toString(),
// "totalUploadedBytes": "0",
// "totalDownloadedBytes": "0"
// },
// "type": "request",
// "requestType": "stats_information"
// };
// print("THIIS IS CALL END STATSSSSSSS $callEndStatsjsonData");
// _socket?.send(callEndStatsjsonData);
}