startCall method

dynamic startCall({
  1. Map<String, dynamic>? customData,
  2. String? from,
  3. List<String>? to,
  4. String? mcToken,
  5. String? mediaType,
  6. String? callType,
  7. String? sessionType,
})

Implementation

startCall(
    {Map<String, dynamic>? customData,
    String? from,
    List<String>? to,
    String? mcToken,
    String? mediaType,
    String? callType,
    String? sessionType}) async {
  screenShareflag = false;
  userType = "caller";
  // mcTokenCurrent = mcToken;
  // bool isPermissionsGranted = kIsWeb
  //     ? true
  //     : Platform.isAndroid
  //         ? await _getPermissions(meidaType!)
  //         : true;
  // if (isPermissionsGranted) {
  try {
    iscallmanytomany = true;
    isCallInProgress = true;
    print("this is sdk $mediaType");
    mediatype = mediaType;
    startCallObject = {
      "from": from,
      "to": to,
      "mediaType": mediaType,
      "callType": callType,
      "sessionType": sessionType
    };
    //  callParticipants = to[0];
    print("THSI IS STARTCALL OBJECT $startCallObject");
    callSessionUUID = _generateMd5(
        DateTime.now().millisecondsSinceEpoch.toString() +
            tenantID +
            ref_id!);
    await _createPeerConnection(mediaType!);
    _createOffer(from!, to!, mcToken!, mediaType, callType!, sessionType!,
        customData!);
  } catch (e) {
    print("this is error $e");
  }
  onCallDial?.call();
  // } else {
  //   print("permission not granted");
  // }
}