1- # MSC4075: MatrixRTC Call Ringing
1+ # MSC4075: MatrixRTC Ringing
22
3- It is important that a call initiated on clientA can make targeted clients ring.
3+ It is important that an RTC session initiated on clientA can make targeted clients ring.
44This is of interest in 1:1 Rooms/Calls but also in bigger rooms ringing can be desired.
55
6- Legacy calls are using room events to negotiate the call.
7- A client could use the initial steps in the negotiation to also make the phone ring.
6+ The existing "legacy" [ 1:1 VoIP calling in Matrix] ( https://spec.matrix.org/v1.11/client-server-api/#voice-over-ip )
7+ uses room events to negotiate the call.
8+ A client can use the initial steps in the negotiation to also make the phone ring.
89
9- With MatrixRTC based calls this signalling is done over state events.
10- Also MatrixRTC enables large group calls which makes it very
10+ With [ MSC4143: MatrixRTC] ( https://github.com/matrix-org/matrix-spec-proposals/pull/4143 )
11+ this signalling is done over state events. Furthermore, [ MatrixRTC] ( https://github.com/matrix-org/matrix-spec-proposals/pull/4143 )
12+ allows for large group calls (not just 1:1) which makes it very
1113desirable to have more configurations over the ringing process.
1214
1315## Proposal
1416
15- A new event ` m.call.notify ` is proposed which can be sent by a client that
16- wants to start a call. This event is added to the push rules for clients which
17- support calling so they get push notifications. The push rules for intentional
17+ A new event ` m.rtc.notify ` is proposed which can be sent by a client that
18+ wants to notify others about the existence of an session for an MatrixRTC application.
19+ This event is added to the push rules for clients which
20+ support the application type so they receive push notifications. The push rules for intentional
1821mentions make sure no unnecessary push notification is sent.
1922
20- This event contains the following fields including intentional mentions and extensible events .
23+ This event contains the following fields by leveraging intentional mentions.
2124
2225``` json5
2326{
24- " type" : " m.call.notify" ,
2527 " content" : {
26- " application" : " m.call | m.other_matrix_session_type | ..." ,
2728 " m.mentions" : {" user_ids" : [], " room" : true | false },
2829 " notify_type" : " ring | notification" ,
30+ " session" : {
31+ // session content from the corresponding m.rtc.member event
32+ " application" : " m.call | m.other_matrix_session_type | ..." ,
33+ },
2934 // Application specific data,
3035 // optional fields to disambiguate which session
3136 // this notify event belongs to:
32-
33- // for application = "m.call":
34- " call_id" : " some_id" ,
35- // Extensible events fallback
36- " m.text" : " <@room|@user1, @user2 and @user3>
37- <notify_type == 'ring' ? 'RingRing!!' : ''> Join the call in this room with a supported client."
38- }
37+ }
3938}
4039```
4140
41+ The fields are defined as follows:
42+
43+ - ` m.mentions ` optional:\
44+ Has the structure as defined for ` m.mentions ` in the [ Client-Server API] ( https://spec.matrix.org/v1.11/client-server-api/#definition-mmentions ) .
45+ - ` notify_type ` required string:\
46+ The type of notification to send.\
47+ ` ring ` : The client should ring.\
48+ ` notification ` : The client should show a notification.
49+ - ` session ` required object: the ` session ` content from the corresponding ` m.rtc.member ` event.
50+
4251In the following we define ** call** as any MatrixRTC session with the
43- same ` "application" ` and the same application specific data.
44- In the case of ` "m.call" ` , the same ` "call_id" ` .
52+ same ` "session" ` contents.
4553
46- If it does support the event it should not be rendered in the timeline.
47- (Call timeline elements are done using the ` m.call.member ` state events.)
54+ ### Client behaviour on receiving a ` m.rtc.notify ` event
4855
49- But, if the notify conditions (listed below) apply,
50- the client has to inform the user about the ** call** with an appropriate user experience.
51- For ` notify_by == "ring" ` some kind of sound is required
56+ On retrieval, the client should not render the event in the timeline.
57+ If the notify conditions (listed below) apply,
58+ the client has to inform the user about the ** call** with an appropriate user flow.
59+ For ` notify_type == "ring" ` some kind of sound is required
5260(except if overwritten by another client specific setting),
53- for ` notify_by == "notification"` a visual indication is enough.
61+ for ` notify_type == "notification"` a visual indication is enough.
5462This visual indication should be more than an unread indicator
5563and similar to a notification banner.
5664This is not enforced by the spec however and ultimately a client choice.
5765
58- Ringing (or notifying) should happen only if all these conditions apply:
66+ The client should only inform the user if all of the following conditions apply:
5967
60- - ` m.call .notify ` content:\
61- If the user is not part of the ` m.mentions ` section as defined in
62- [ MSC3952 ] ( https://github.com/ matrix- org/matrix-spec-proposals/pull/3952 )
63- this event can be ignored. (Push notifications are automatically filtered
68+ - ` m.rtc .notify ` content:\
69+ If the user is * not* listed in the ` m.mentions ` section as defined in the \
70+ [ Client-Server API ] ( https://spec. matrix. org/v1.11/client-server-api/#definition-mmentions ) , \
71+ the event should be ignored. (Push notifications are automatically filtered
6472 so this only is important for events received via a sync)
6573- Local notification settings:\
66- If the room is set to silent, it will never play a ring sound. A ` m.call.notify `
67- event will at most be used to mark the room as unread or update the rooms
74+ If the room is set to silent, the client should never play a ring sound.
75+ In this scenario, a ` m.rtc.notify `
76+ event should at most be used to mark the room as unread or update the rooms
6877 "has active ** call** icon". (the exact behavior is up to the client)
6978- Currently playing a ring sound (room timeline):\
7079 If the user already received a ring event for this ** call** and is playing
71- the ring sound any incoming ` m.call .notify ` for the same ** call**
72- should be ignored. If the user failed to pick up and a new ` m.call .notify `
80+ the ring sound any incoming ` m.rtc .notify ` for the same ** call**
81+ should be ignored. If the user failed to pick up and a new ` m.rtc .notify `
7382 arrives for the same room the device should ring again.
7483- Current user is a member of the the ** call** (room state):\
75- None of the devices should ring if they receive a ` m.call .notify ` if the
76- rooms state ` m.call .member ` event of the user contains a membership for
77- the ** call** in the ` m.call .notify ` event.
84+ None of the devices should ring if they receive a ` m.rtc .notify ` if the
85+ rooms state ` m.rtc .member ` event of the user contains a membership for
86+ the ** call** in the ` m.rtc .notify ` event.
7887 This includes stopping the current ring sound if the room state updates so
7988 this condition is true.
8089- If a notify event is received in "real time":\
@@ -85,77 +94,72 @@ Ringing (or notifying) should happen only if all these conditions apply:
8594 is allowed. Any client which is not able to receive the event in this period should
8695 not ring to prohibit (annoying/misleading/irrelevant) outdated rings.
8796
88- Sending a ` m.call.notify ` should happen only if all of these conditions apply:
97+ ### Client behaviour when sending a ` m.rtc.notify ` event
98+
99+ Sending a ` m.rtc.notify ` should happen only if all of these conditions apply:
89100
90101- If the user deliberately wants to send a new notify event
91- (It is possible to send a ` m.call .notify ` for an ongoing call if that
102+ (It is possible to send a ` m.rtc .notify ` for an ongoing call if that
92103 makes sense. Starting a call ahead of time, planning in a small group,
93104 ringing another set of users at a specific time so they don't forget to join.
94105 Ringing one specific user again who missed joining during the first ring.)
95- - If the user has not yet received a ` m.call .notify ` for the ** call** they want to
106+ - If the user has not yet received a ` m.rtc .notify ` for the ** call** they want to
96107 participate but the other condition applies. (So the obvious case is, that this
97108 is the first user in a new call session).
98109
99- ### Fallback with extensible events
100-
101- If clients do not support ` m.call.notify ` events, they will however draw the extensible event fallback.
102- The exact content is up the the sending client and can contain more detailed instructions on how to get
103- access to a supporting client. It has to include the ` @room ` or the mentioned user list and has
104- to communicate the message that those users are invited to participate in a call.
105-
106110### Limitations and recommendations
107111
108112- Encrypted rooms configured as ` mentions only ` are currently not sending push
109113 notifications for encrypted events. Hence the client would not ring even though
110114 the ring event contains ` m.mentions ` .
111- - As a stop gap , it is recommended, that the client sends unencrypted ` m.call .notify `
115+ - As a stop gat , it is recommended, that the client sends unencrypted ` m.rtc .notify `
112116 events in such rooms.
113117 - As soon as [ MSC3996: Encrypted mentions-only rooms] ( https://github.com/matrix-org/matrix-spec-proposals/pull/3996 )
114118 is supported ` m.has_mentions ` should be used instead of unencrypted call
115119 notify events.
116- - Ringing a user who you do not have a shared room with is not supported
117- by this MSC.
120+ - Wanting to ring a user who you do not have a shared room with is not possible.
118121 It might be an undesired capability that your device can be started to ring
119122 by users you have not yet interacted on matrix.
120- On the other hand this might be desired to mimic what people expect from using
123+ On the other hand this might be desired to mimic what ppl expect from using
121124 the telephone network.
122- (It should be possible to disable/configure this on the receiving
125+ Entering a matrix userId allows to call someone (Ring their phone).
126+ (It would be possible to disable/configure this on the receiving
123127 device)
124128 - The location to put this information would be the invite event.
125- This would be an edge case and only required for the specific use case
129+ This would be an edge case and only required for the specific usecase
126130 of being able to ring without a shared DM/Room.
127131 It should be discussed in an additional MSC and is not part of this proposal.
128132
129133## Alternatives
130134
131- It could be possible to use the call member room state events to determine a call
135+ ### Use call member room state events
136+
137+ It would be possible to use the call member room state events to determine a call
132138start.
133139The logic would be as following:
134- _ If we receive an event we check if there are already other members
140+ _ If we receive an event we check if are already other members
135141(call.member events) for the call. In case there is not we make the phone ring._
136142
137143Pros:
138144
139145- This would not require any new event.
140- - The clients can not "forget" to ring the others when they
141- start a new call, because they would automatically send an event by joining.
142- - There would be less traffic. With the proposed solution in this MSC, the first
143- client who joins needs to send a ` m.call.notify ` event and a ` m.call.member `
144- state event.
146+ - The clients can not "forget" to ring the others about the when they
147+ start a new call. Because they would automatically send an event by joining.
148+ - There would be less traffic. With the proposed solution the first one who joins
149+ needs to send a ` m.rtc.notify ` event and a ` m.rtc.member ` state event.
145150
146151Cons
147152
148153- All the ringing conditions run on the receiving user. There is no way for the
149- user who starts the call to decide if it should ring the other participants.
154+ user who start the call to decide if it should ring the other participants.
150155 (Consider a very large room where I want to start a call only for the interested
151156 ones who want to discuss a side project. It would be very annoying if the
152157 initiator could not control how and who is going to be informed about that call.)
153-
154158- Additionally, it is not as flexible as the proposed separate event.
155159 Which allows an external instance (a meeting organizer bot) to
156160 just ring all the users which are invited to a meeting without needing to
157- participate in the call with a ` m.call .member ` event of the call.
158- - Push notifications would need to be sent for EVERY ` m.call .member ` state event
161+ participate in the call with a ` m.rtc .member ` event of the call.
162+ - Push notifications would need to be sent for EVERY ` m.rtc .member ` state event
159163 update. For each joining and leaving user and for each membership update during
160164 a call (due to a SFU (single forwarding unit) change, changing devices
161165 (could even happen for screen shares if the screen share is implemented as a
@@ -178,13 +182,13 @@ Cons
178182## Security considerations
179183
180184This is another timeline event where any room participant can send a push
181- notification to others. Since this will make clients ring this has a high
182- impact on the receiver. However, since ringing has to obey the mute settings, it is
183- very easy for the targeted users to mitigate unwanted ringing . It can be very
185+ notification to others. Since this will make clients ring this has a higher
186+ effect on the receiver. Since ringing has to obey the mute settings, it is
187+ very easy for the targeted users to mitigate the "attack" . It can be very
184188much compared to spamming a room with "@room " messages.
185189
186- The default power level for ` m.call .notify ` is ` 50 ` and equivalent to the default
187- power level required for ` m.call .member ` state events.
190+ The default power level for ` m.rtc .notify ` is ` 50 ` and equivalent to the default
191+ power level required for ` m.rtc .member ` state events.
188192
189193Additional control is provided indirectly with the use of intentional mentions.
190194Setting ` "notifications":{"room":X} ` allows to choose ` X ` for the power required
@@ -194,9 +198,8 @@ level to ring the whole room.
194198
195199While this MSC is not present in the spec, clients and widgets should:
196200
197- - Use ` org.matrix.msc4075. ` in place of ` m. ` in all new identifiers of this MSC.
198- (` m.call.notify ` )
201+ - Use ` org.matrix.msc4075.call.notify ` in place of ` m.rtc.notify ` as the event type
199202
200203## Dependencies
201204
202- This MSC builds on Intentional Mentions [ MSC3952 ] ( https://github.com/matrix-org/matrix-spec-proposals/pull/3952 ) .
205+ This MSC builds on [ MSC4143: MatrixRTC ] ( https://github.com/matrix-org/matrix-spec-proposals/pull/4143 ) .
0 commit comments