-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhandshake_action.dart
More file actions
66 lines (55 loc) · 2.38 KB
/
Copy pathhandshake_action.dart
File metadata and controls
66 lines (55 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import 'package:webtrit_signaling/webtrit_signaling.dart';
/// Actions returned by [HandshakeProcessor.process] describing what the BLoC
/// should do after processing the signaling [StateHandshake].
sealed class HandshakeAction {
const HandshakeAction();
}
/// Send a [HangupRequest] to the signaling server and stop processing.
///
/// Emitted when the Callkeep connection for the line is [CallkeepConnectionState.stateDisconnected]
/// and the latest call event is [AcceptedEvent] or [ProceedingEvent].
final class HangupSignalingAction extends HandshakeAction {
const HangupSignalingAction({required this.line, required this.callId});
final int? line;
final String callId;
}
/// Send a [DeclineRequest] to the signaling server and stop processing.
///
/// Emitted when the Callkeep connection for the line is [CallkeepConnectionState.stateDisconnected]
/// and the latest call event is [IncomingCallEvent].
final class DeclineSignalingAction extends HandshakeAction {
const DeclineSignalingAction({required this.line, required this.callId});
final int? line;
final String callId;
}
/// Re-negotiate WebRTC media for an already-accepted incoming call (WT-1167 Subtask 2).
///
/// Emitted when the handshake contains both [IncomingCallEvent] (oldest) and [AcceptedEvent]
/// (newest) for a line, the Callkeep connection is absent, and the call is not already in
/// the BLoC state. This covers the case of Android Activity recreation during an active call.
final class RestoreCallAction extends HandshakeAction {
const RestoreCallAction({
required this.line,
required this.callId,
required this.incomingCallEvent,
required this.acceptedTime,
});
final int line;
final String callId;
final IncomingCallEvent incomingCallEvent;
final DateTime acceptedTime;
}
/// Deliver an unanswered [IncomingCallEvent] to the BLoC signaling handler.
///
/// Emitted when the line's [callLogs] contains a single [CallEventLog] carrying
/// an [IncomingCallEvent] — the call has not been answered yet.
final class HandleIncomingCallAction extends HandshakeAction {
const HandleIncomingCallAction({required this.event});
final IncomingCallEvent event;
}
/// Call [Callkeep.endCall] for a local connection that is no longer present in
/// the signaling state.
final class EndLocalCallAction extends HandshakeAction {
const EndLocalCallAction({required this.callId});
final String callId;
}