sendCallCandidates method
This is sent by callers after sending an invite and by the callee after answering. Its purpose is to give the other party additional ICE candidates to try using to communicate.
callId
The ID of the call this event relates to.
version
The version of the VoIP specification this messages adheres to. This specification is version 1.
party_id
The party ID for call, Can be set to client.deviceId.
candidates
Array of objects describing the candidates. Example:
[
{
"candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0",
"sdpMLineIndex": 0,
"sdpMid": "audio"
}
],
Implementation
Future<String?> sendCallCandidates(
Room room,
String callId,
String party_id,
List<Map<String, dynamic>> candidates, {
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,
'candidates': candidates,
};
return await _sendContent(
room,
EventTypes.CallCandidates,
content,
txid: txid,
);
}