sendSelectCallAnswer method

Future<String?> sendSelectCallAnswer(
  1. Room room,
  2. String callId,
  3. int lifetime,
  4. String party_id,
  5. String selected_party_id, {
  6. String version = voipProtoVersion,
  7. String? txid,
})

The calling party sends the party_id of the first selected answer.

Usually after receiving the first answer sdp in the client.onCallAnswer event, save the party_id, and then send CallSelectAnswer to others peers that the call has been picked up.

callId is a unique identifier for the call. version is the version of the VoIP specification this message adheres to. This specification is version 1. party_id The party ID for call, Can be set to client.deviceId. selected_party_id The party ID for the selected answer.

Implementation

Future<String?> sendSelectCallAnswer(Room room, String callId, int lifetime,
    String party_id, String selected_party_id,
    {String version = voipProtoVersion, String? txid}) async {
  txid ??= 'txid${DateTime.now().millisecondsSinceEpoch}';

  final content = {
    'call_id': callId,
    'party_id': party_id,
    if (groupCallId != null) 'conf_id': groupCallId,
    'version': version,
    'lifetime': lifetime,
    'selected_party_id': selected_party_id,
  };

  return await _sendContent(
    room,
    EventTypes.CallSelectAnswer,
    content,
    txid: txid,
  );
}