74 Commits

Author SHA1 Message Date
6af6d5c9f7 fix(email): Treat email guests like normal guests in some cases
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-10-23 06:11:34 +02:00
956a1ab00f chore(php): Auto-fixes of coding standards
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-08-23 16:36:50 +02:00
cc648fd2eb fix: Provide actor type and id of participants in signaling messages
When the Nextcloud server notifies the signaling server about updates in
the participants it provides a list of properties about each participant
that will be relayed to the clients in the "participants->update"
signaling messages. When federated users were added to the participants
whose properties were relayed the "userId", which until then was set
only for regular users, was set too to the actor id for federated
participants. However, this approach was lacking, as it was not possible
for clients to really know from the "userId" property if the participant
was federated or not or, in a more general way, its actor type.

Due to that the "userId" is again set only for regular users for
backwards compatibility, and the "actorType" and "actorId" properties
are added to the data of each participant included in the
"participants->update" signaling message.

For consistency, "actorType" and "actorId" is also set in the equivalent
message of the internal signaling server.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2024-08-01 13:33:47 +02:00
f91bdfa38a fix: Include federated users in participants update notifications
The federated users are now included in the "inCall" and "participants"
notfications sent from the Nextcloud server to the signaling server, so
their data is also included in the "participants->update" events sent
from the signaling server to the clients. Otherwise the clients would
not be notified when the properties of a federated user change, not even
for their own participant.

Note that the "participants->update" is also received by federated
clients when the default permissions of the room change, even if the
default permissions themselves are not propagated to the federated room,
as the change in the default permissions also cause a change in the
participant permissions.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2024-07-25 23:32:39 +02:00
7056338610 fix: Notify "roomlist" updates to federated users
When a participant is invited or disinvited to a conversation, or a
session is removed, the affected user receives a "roomlist" message with
type "invite" or "disinvite", while the rest of users in the
conversation receive a "roomlist" message with type "update" and a
"participant-list: refresh" property. Now both federated users and local
users receive the "roomlist" update.

Local users are also notified with a "roomlist" update when the
properties of the room change. However, in that case the signaling
server of federated users will be notified by the federated Nextcloud
server when the property changes are propagated to it, so there is no
need to notify federated users from the remote Nextcloud server in that
case.

Note, however, that independently of the users explicitly notified with
the "userids" parameter (which can include inactive participants) that
receive the "roomlist" message, the signaling server automatically
notifies all active participants in a conversation when it is modified,
so active federated users will receive a "room" message with the updated
properties (which may never be reflected in the proxy conversation, as
some properties are not propagated to the federated conversations).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2024-07-24 15:54:23 +02:00
a6aa9f6c62 Merge pull request #12198 from nextcloud/bugfix/noid/make-alluserids-more-reliable
fix(signaling): Make alluserids more reliable for testing
2024-04-29 11:46:32 +02:00
1ccbf67da2 chore: Run SPDX convertor
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-04-26 13:02:15 +02:00
14b4c4477c fix(signaling): Make alluserids more reliable for testing
Signed-off-by: Joas Schilling <coding@schilljs.com>
2024-04-24 09:01:15 +02:00
d1d63112a1 fix(CS): Remove redundant PHPDoc tags
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-12-11 14:40:45 +01:00
592916c735 fix(CS): Migrate more strpos() calls to str_* functions
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-12-11 13:01:51 +01:00
d1a8c278b7 fix(events): Migrate external signaling events to typed ones
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-11-07 16:21:53 +01:00
5e06dce59c Handle dial-out exceptions
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-30 14:23:03 +01:00
5116d663bb Fix sipbridge returning a license error
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-30 14:23:03 +01:00
0ce12161c3 fix(sip-dialout): Validate the HPB response
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-23 15:47:57 +02:00
6509ddae85 feat(sip-dialout): Add dial-out request
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-10-23 15:47:56 +02:00
3ce5c7bdaa Use PHP8's constructor property promotion
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2023-07-11 11:32:21 +03:30
d1086c962d Add displayName when sending a participant update message
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
2023-06-10 18:23:55 +02:00
c1970caef4 chore(CS): Unify construct() calls
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-04-13 14:28:41 +02:00
f3ff4a8820 automated: Apply CS fix
Signed-off-by: Joas Schilling <coding@schilljs.com>
2023-04-13 13:17:49 +02:00
62fd48d1a7 Send signaling message when starting or stopping breakout rooms
When the breakout room status changes a "switchto" message is sent to
all the active sessions in either the parent or the breakout rooms
(depending on whether they are being started or stopped) with the token
of the room that they have to switch to.

When the breakout rooms are started the message is sent only to non
moderators, as moderators do not have a single breakout room assigned.
On the other hand, when the breakout rooms are stopped the message is
also sent to all moderators (who are in a breakout room and not already
in the parent room), as all participants need to switch to the parent
room.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2023-01-31 05:00:53 +01:00
3c2c09eb93 Fix backend url from CLI
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-05-31 13:00:27 +02:00
03b26ba740 Use "all: true" for end meeting for everyone case
This is needed to prevent issues with the request body size:

POST https:\/\/192.168.178.101:18443\/api\/v1\/room\/3097975620`
resulted in a `413 Request Entity Too Large` response:\nRequest entity
too large

Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-05-17 12:16:03 +02:00
ed0d575135 Also retry on connect exception
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-05-16 11:28:38 +02:00
a8aec629b4 Retry sending signaling messages up to 3 times
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-05-13 15:52:02 +02:00
44104b9ab6 Fix type handling
Signed-off-by: Joas Schilling <coding@schilljs.com>
2022-04-07 09:03:12 +02:00
c07251f0c6 Use PHP7.4 property typehinting where possible
Signed-off-by: Vitor Mattos <vitor@php.rio>
2022-04-06 12:43:03 -03:00
f95553c1c0 Fix permissions not honoured if updated right before joining a call
When the local participant joins a call the sent media is based on the
last fetched permissions. However, once the call is joined the sent
media is based on the participant permissions updates notified by the
signaling messages.

When the HPB is used the "participantPermissions" property of the
"participants->update" signaling messages is used. Those messages are
sent when the permissions are modified and also when a participant joins
a call, but in this last case it did not include the expected property.

Due to this, if the permissions of the local participant were updated
right before the participant joined the call and the participant data
was not fetched again yet the previous permissions would be used. If the
message sent when the permissions were updated was received before
actually joining the call then it would be ignored, and although the
message sent due to joining the call would be processed the WebUI would
not notice the permission change, as the message did not provide them.

To solve that now the "participants->update" message sent when joining a
call also includes the permissions. This way, even if the previous
permissions are initially used when joining the call as soon as the
signaling message sent due to joining the call is received the WebUI
will adjust the sent media to the new permissions.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-03-14 03:11:34 +01:00
4d2ecfcd96 Show an admin error when the HPB is incompatible
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-11-03 16:07:37 +01:00
118a6d2ded Split publishing media into audio and video after clarifying with the HPB
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-07 18:18:31 +02:00
1b13f80cc1 Allow to remove all permissions without falling back to the next level
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-07 18:18:30 +02:00
390ae657a1 Introduce different layers for permissions
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-07 18:18:30 +02:00
d2967ce0cf Rename and extend constants and methods for the new permissions
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-10-07 18:18:29 +02:00
de76d1a7a3 Also have sending requests marked as hpb
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-06-22 17:42:10 +02:00
4009de75a2 Include "publishingPermissions" in participant messages of signaling
This will allow the clients to react to "publishingPermissions" changes
directly from the signaling messages, without needing to fetch again the
participants (although they may need to fetch them again nevertheless
for UI updates).

The internal signaling server also needs to listen to changes on the
property to be able to know when to send the message (the external
signaling server already listened to the changes to be able to update
the permission flags internally).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-06-11 09:07:30 +02:00
7631251c99 Grant permissions in the HPB based on publishing permissions
When a participant does not have publishing permissions the HPB will
block signaling messages related to establishing a connection, like
sending the candidates. This would prevent participants using clients
not supporting yet the publishing permissions (and thus still trying to
publish even if they are not allowed to) from sending media in a call.

Unfortunately the lack of permissions only prevents the connection from
being established. If a participant is already sending media revoking
the publishing permissions will not cause the connection to be stopped
by the HPB.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-06-11 09:07:29 +02:00
723d47f648 Fix session selection in signaling code
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-08 11:56:18 +01:00
4031c182df Prepare selecting the correct session in case there are multiple
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-03-08 11:56:17 +01:00
adc5996e87 First check for session because we don't do something otherwise anyway
Signed-off-by: Joas Schilling <coding@schilljs.com>
2021-02-24 10:26:37 +01:00
deb2494193 Send Nextcloud session id too when a participant joins a call
When the internal signaling server is used the Nextcloud session id and
the signaling session id are the same. However, if the external
signaling server is used they are different.

Signaling messages for participants in calls (like joining the call,
muting and so on) are identified only by their signaling session id, so
when the external signaling server is used it was not possible to
associate participants in calls with the participant information
provided by the Nextcloud server.

However, when a participant joins a call her client notifies the
Nextcloud server (either directly or, in the case of SIP clients,
through the signaling server). The Nextcloud server then notifies the
signaling server which, in turn, notifies all the clients. When
Nextcloud notifies the signaling server the participant is identified
with the Nextcloud session id, and the signaling server then replaces
that with the signaling session id before relaying the message to the
clients.

Due to this when a participant joins (or leaves) a call now the
Nextcloud session id is sent too in an extra property. This property is
not adjusted by the external signaling server, so the clients receive
both the signaling session id and the Nextcloud session id and thus are
able to map them.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2021-01-14 13:47:40 +01:00
f52aa0cf47 Notify external signaling server when description changes
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2020-12-08 13:00:12 +01:00
459858a695 Introduce constants for the actor types
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-11-26 09:46:43 +01:00
397ceac625 Fix casing of IURLGenerator to fix DI
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-11-13 09:06:49 +01:00
d24e523269 Fix the unit tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-30 10:38:51 +01:00
3c61bd4749 Move more functions to the services
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-30 10:38:50 +01:00
6c20e595e5 Move Room::getParticipantUserIds() to participant service
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-10-30 10:38:09 +01:00
b6829acbaa Move to Psr\Log\LoggerInterface
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-08-03 13:38:45 +02:00
d694192795 Pass base URL of Nextcloud to signaling server in backend requests.
Signed-off-by: Joachim Bauch <bauch@struktur.de>
2020-07-31 16:59:57 +02:00
a7cf861387 Always allow local HPBs
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-07-29 10:27:42 +02:00
84d42604e6 Run cs:fix
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-05-12 15:04:42 +02:00
eda9d44a85 Send the backend message to the correct backend server for now
Signed-off-by: Joas Schilling <coding@schilljs.com>
2020-05-12 10:40:20 +02:00