startCallOneToOne method

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

Implementation

startCallOneToOne(
    {String? from,
    Map<String, dynamic>? customData,
    List<String>? to,
    String? mediaType,
    String? mcToken,
    String? callType,
    String? sessionType}) async {
  screenShareflag = false;
  try {
    userType = "caller";
    isCallInProgress = true;
    startCallObject = {"mediaType": mediaType, "sessionType": sessionType};
    callend = false;
    print("i am here in start call oneto one");

    starttime = DateTime.now();
    iscallonetoone = true;

    callSessionUUID = _generateMd5(
        DateTime.now().millisecondsSinceEpoch.toString() +
            tenantID +
            ref_id!);
    onetooneparticipantrefid = to![0].toString();
    _peerConnection = await _createPeerConnectiononetoone(mediaType!);
    print(
        "this is peerconnection $_peerConnection $from!, $to,  mediaType, callType!, sessionType!, customData!");

    _createOfferonetoone(
        from!, to, mediaType, callType!, sessionType!, customData!);
  } catch (e) {
    print("this is error in start call one2one $e");
  }
  onCallDial?.call();
  // } else {
  //   print("permissions not granted");
  // }
}