sendCallReject method

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

Reject a call 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?> sendCallReject(
    Room room, String callId, int lifetime, String party_id, String? reason,
    {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,
    if (reason != null) 'reason': reason,
    'version': version,
    'lifetime': lifetime,
  };

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