newGroupCall method

Future<GroupCall?> newGroupCall(
  1. String roomId,
  2. String type,
  3. String intent
)

Create a new group call in an existing room.

roomId The room id to call

type The type of call to be made.

intent The intent of the call.

Implementation

Future<GroupCall?> newGroupCall(
    String roomId, String type, String intent) async {
  if (getGroupCallForRoom(roomId) != null) {
    Logs().e('[VOIP] [$roomId] already has an existing group call.');
    return null;
  }
  final room = client.getRoomById(roomId);
  if (room == null) {
    Logs().v('[VOIP] Invalid room id [$roomId].');
    return null;
  }
  final groupId = genCallID();
  final groupCall = GroupCall(
    groupCallId: groupId,
    client: client,
    voip: this,
    room: room,
    type: type,
    intent: intent,
  ).create();
  groupCalls[groupId] = groupCall;
  groupCalls[roomId] = groupCall;
  return groupCall;
}