sendCallNegotiate method
Future<String?>
sendCallNegotiate(
- Room room,
- String callId,
- int lifetime,
- String party_id,
- String sdp, {
- String type = 'offer',
- String version = voipProtoVersion,
- String? txid,
- CallCapabilities? capabilities,
- SDPStreamMetadata? metadata,
When local audio/video tracks are added/deleted or hold/unhold,
need to createOffer and renegotiation.
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.
Implementation
Future<String?> sendCallNegotiate(
Room room, String callId, int lifetime, String party_id, String sdp,
{String type = 'offer',
String version = voipProtoVersion,
String? txid,
CallCapabilities? capabilities,
SDPStreamMetadata? metadata}) 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,
'description': {'sdp': sdp, 'type': type},
if (capabilities != null) 'capabilities': capabilities.toJson(),
if (metadata != null) sdpStreamMetadataKey: metadata.toJson(),
};
return await _sendContent(
room,
EventTypes.CallNegotiate,
content,
txid: txid,
);
}