0
0
Fork 0
mirror of https://github.com/strukturag/nextcloud-spreed-signaling.git synced 2025-04-11 14:21:18 +00:00
Commit graph

58 commits

Author SHA1 Message Date
Joachim Bauch
a261d6b37d
Support recipient "call". 2024-11-06 10:12:46 +01:00
Joachim Bauch
a487afc909
Support passing codec parameters when creating publishers. 2024-11-04 13:35:03 +01:00
Joachim Bauch
7f03ffff55
Include actor information in room join/leave events for fed. sessions. 2024-08-29 16:00:08 +02:00
Joachim Bauch
825cab1de9
Add helper method to get parsed userdata from a session. 2024-08-29 15:26:13 +02:00
Joachim Bauch
b233651db0
Prefix room session id for sessions that get federated.
This allows using a single signaling server with two Nextcloud instances
during development.
2024-08-29 14:27:21 +02:00
Joachim Bauch
bfefcfea47
Send ping requests to local instance for federated sessions. 2024-08-28 11:46:57 +02:00
Joachim Bauch
a256789f20
Support reconnecting the internal federated connection. 2024-08-06 09:13:22 +02:00
Joachim Bauch
0451cea5db
Fix missing events if federated session leaves and joins again. 2024-08-06 09:13:18 +02:00
Joachim Bauch
6243ef1f0b
Make sure response to federated room leave contains id from request. 2024-08-06 09:13:17 +02:00
Joachim Bauch
c442a72905
Start implementing federation. 2024-08-06 09:13:13 +02:00
Joachim Bauch
63c42dd84c
First draft of remote subscriber streams. 2024-05-21 09:29:15 +02:00
Joachim Bauch
fe0a002adf
Merge pull request from strukturag/rawmessage-pointer
Don't use unnecessary pointer to "json.RawMessage".
2024-05-21 09:27:31 +02:00
Joachim Bauch
dff78d0101
Fix lock order inversion when leaving room / publishing room sessions.
Deadlock could happen between

1 @ 0x44038e 0x451898 0x45186f 0x46f325 0x489f3d 0xbb7b76 0xbb7b45 0xc1fe52 0xc190f7 0x473461
0x46f324	sync.runtime_SemacquireMutex+0x24							/usr/lib/go-1.21/src/runtime/sema.go:77
0x489f3c	sync.(*Mutex).lockSlow+0x15c								/usr/lib/go-1.21/src/sync/mutex.go:171
0xbb7b75	sync.(*Mutex).Lock+0x55									/usr/lib/go-1.21/src/sync/mutex.go:90
0xbb7b44	github.com/strukturag/nextcloud-spreed-signaling.(*ClientSession).RoomSessionId+0x24	/build/nextcloud-spreed-signaling-1.2.3/clientsession.go:157
0xc1fe51	github.com/strukturag/nextcloud-spreed-signaling.(*Room).publishActiveSessions+0x231	/build/nextcloud-spreed-signaling-1.2.3/room.go:925
0xc190f6	github.com/strukturag/nextcloud-spreed-signaling.(*Room).run+0x36			/build/nextcloud-spreed-signaling-1.2.3/room.go:179

(which locks "mu" in the room and then "mu" in the client session) and

1 @ 0x44038e 0x451898 0x45186f 0x46f3e5 0x48b44a 0xc1ba76 0xbba37e 0xbe2aab 0xbdf8e5 0xbee0f8 0xbb6134 0x473461
0x46f3e4	sync.runtime_SemacquireRWMutex+0x24							/usr/lib/go-1.21/src/runtime/sema.go:87
0x48b449	sync.(*RWMutex).Lock+0x69								/usr/lib/go-1.21/src/sync/rwmutex.go:152
0xc1ba75	github.com/strukturag/nextcloud-spreed-signaling.(*Room).RemoveSession+0x35		/build/nextcloud-spreed-signaling-1.2.3/room.go:440
0xbba37d	github.com/strukturag/nextcloud-spreed-signaling.(*ClientSession).LeaveRoom+0xdd	/build/nextcloud-spreed-signaling-1.2.3/clientsession.go:489
0xbe2aaa	github.com/strukturag/nextcloud-spreed-signaling.(*Hub).processRoom+0x6a		/build/nextcloud-spreed-signaling-1.2.3/hub.go:1268
0xbdf8e4	github.com/strukturag/nextcloud-spreed-signaling.(*Hub).processMessage+0x984		/build/nextcloud-spreed-signaling-1.2.3/hub.go:909
0xbee0f7	github.com/strukturag/nextcloud-spreed-signaling.(*Hub).OnMessageReceived+0x17		/build/nextcloud-spreed-signaling-1.2.3/hub.go:2427
0xbb6133	github.com/strukturag/nextcloud-spreed-signaling.(*Client).processMessages+0x53		/build/nextcloud-spreed-signaling-1.2.3/client.go:347

(which locks "mu" in the client session and then "mu" in the room).
2024-05-21 09:09:10 +02:00
Joachim Bauch
4b76a49355
Don't use unnecessary pointer to "json.RawMessage".
The slice is a pointer already.
2024-05-16 20:58:42 +02:00
Joachim Bauch
bad52af35a
Validate received SDP earlier. 2024-05-16 10:04:57 +02:00
Joachim Bauch
0ee976d377
Add Context to clients / sessions.
The Context will be closed when the client disconnects / the session is removed,
so any pending requests can be cancelled.
2024-05-16 09:07:59 +02:00
Joachim Bauch
2468443572
Add "HandlerClient" interface to support custom implementations. 2024-04-23 11:03:30 +02:00
Joachim Bauch
2e6cf7f86b
Don't keep expiration timestamp in each session.
Reduces memory size per session and make hub lock usage consistent.
2024-04-22 15:07:48 +02:00
Joachim Bauch
7d09c71ab9
Strongly type "StreamType". 2024-02-27 15:20:14 +01:00
Joachim Bauch
43b5243463
Move common flags code to own struct. 2023-10-30 10:13:17 +01:00
Joachim Bauch
c134883138
Switch to atomic types from Go 1.19 2023-10-30 09:32:46 +01:00
Joachim Bauch
d1544dcb2c
Implement message handler for dialout support. 2023-10-26 09:53:57 +02:00
Joachim Bauch
35135433c2
Return response if session tries to join room again. 2023-09-05 15:43:46 +02:00
Joachim Bauch
6da48e31b5
Add missing lock for "roomSessionId" to avoid potential races. 2023-06-15 11:22:26 +02:00
Joachim Bauch
2fdd346766
Include times in log when message is ignored. 2023-06-12 10:47:52 +02:00
Joachim Bauch
3ed2a0e4cd
Filter out duplicate "join" events.
Due to the asynchronous events, a session might received a "Joined" event
for the same (other) session twice, so filter these out on a per-session
level.
2023-06-12 10:19:00 +02:00
Joachim Bauch
20228b176f
Migrate to channel waiter helper class. 2023-02-22 08:34:16 +01:00
Joachim Bauch
2f6e2ba87c
Allow internal clients to set / change the "inCall" flags. 2023-02-20 13:25:37 +01:00
Joachim Bauch
960cb0ea3c
Use "defer" to re-acquire released lock. 2022-08-30 11:47:38 +02:00
Joachim Bauch
e54fcf9559
Update to github.com/pion/sdp v3.0.5 2022-07-27 16:18:45 +02:00
Joachim Bauch
6173a350a1
Add method to get virtual sessions of a client session. 2022-07-12 11:11:52 +02:00
Joachim Bauch
75e5013dd8
Create copy of filtered messages.
Otherwise it can happen that the modified message is reused and sent to
another session.
2022-07-08 09:49:32 +02:00
Joachim Bauch
dcb5be956c
Implement "sendoffer" for remote sessions. 2022-06-30 11:35:33 +02:00
Joachim Bauch
a0d3af14e0
Add initial clustering support. 2022-06-30 11:35:28 +02:00
Joachim Bauch
0115c97946
Refactor asynchronous events to central location. 2022-06-24 13:37:35 +02:00
Joachim Bauch
078768f9c8
Fix check for async room messages received while not joined to a room. 2022-06-14 16:38:29 +02:00
Joachim Bauch
f8f2adb0e2
Merge pull request from strukturag/hide-displaynames
Add "permission" for sessions that may not receive display names.
2022-04-27 16:19:23 +02:00
Daniel Calviño Sánchez
27989752bf Remove "update" parameter in favour of "sid"
The "update" parameter was used to know if an offer should be treated by
the clients as a renegotiation or a new connection. However, since the
introduction of "sid" this is implicitly known (if the "sid" matches an
existing connection then it is an update, otherwise it is a new
connection), so that specific parameter is no longer needed.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-27 11:14:59 +02:00
Daniel Calviño Sánchez
3636e69dba Add specific ID for connections
A new ID is introduced for publishers and subscribers to be able to
identify different connections in the same session. While it was
possible to do that from the Janus handles this ID is meant to be shared
with the clients and set by the peer sending the offer, so it is set by
the client for publishers and by the signaling server for subscribers
(in which case the Janus handle is used).

This will make possible to know without any ambiguity if an offer/answer
belongs to an already existing connection or not. This can be used, for
example, to know if an offer represents an update or a new connection,
or to discard unneeded messages that might be sent in some corner cases
by the clients.

The ID name is "sid" for consistency with the property name used by the
internal signaling server of Talk.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-27 11:14:59 +02:00
Joachim Bauch
39cc523477
Add "permission" for sessions that may not receive display names.
By default, the "join" events contain the whole userdata as received
from the "auth" response. This might include a "displayname" field
containing the display name of the associated user.

For privacy reasons in certain scenarios, some attendees should not
be able to know which other users are connected to a room, therefore
the "displayname" should be hidden for them. By default, no filtering
occurrs.
2022-04-26 14:47:01 +02:00
Daniel Calviño Sánchez
b9d671ab2f Fix mediaType not updated after publisher renegotiations
The "mediaTypes" attribute is checked to know if a publisher needs to be
closed when the permissions are updated. However, that attribute was set
only when the publisher was initially created; due to this if a
publisher then used a renegotiation to add media not included in the
original offer the publisher would not be closed if the publishing
permission for that media was later revoked.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-04-07 02:50:57 +02:00
Joachim Bauch
8fd9c688b6
Merge pull request from danxuliu/send-updated-offers-to-subscribers-after-publisher-renegotiations
Send updated offers to subscribers after publisher renegotiations
2022-02-25 09:16:10 +01:00
Daniel Calviño Sánchez
020cbaf49d Send updated offers to subscribers after publisher renegotiations
When a publisher has a connection the publisher can update the
connection (for example, to add a video track to an audio only
connection) by sending an updated offer to Janus. Janus detects that,
adjusts the connection and then sends back an answer. Once the publisher
connection is updated Janus starts a renegotiation for the subscribers
and generates the offers to be sent to them.

The signaling server did not handle the event, so the offers were not
sent and the subscriber connections were not updated. Now the offers are
sent as needed, which makes possible for the renegotiation to be
completed by the clients.

In this case the "offer" message will also include an "update" parameter
so clients can differentiate between offers to create new connections or
update the existing one.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-02-25 07:47:17 +01:00
Joachim Bauch
614c5f6e21
Fix issues reported by revive. 2022-02-11 12:09:42 +01:00
Joachim Bauch
ffd8a30f61
Clients can provide the maximum publishing bandwidth in offer requests.
This will still be capped to any backend / proxy / Janus limits.
2022-01-10 15:14:56 +01:00
Joachim Bauch
707b125730
Check individual audio/video permissions on change.
If a client publishes audio/video and no longer has the video permission,
the whole publisher will be closed. Previously this was only checking
the generic "media" permission.
2021-11-08 12:08:14 +01:00
Joachim Bauch
70b37364d3
Support separate permissions for publishing audio / video.
Clients with permission "publish-media" can publish any audio/video. Other
clients need to have "publish-audio" and/or "publish-video" to publish the
corresponding media types. For this the SDP in the offer is parsed to check
what will be sent.
2021-11-03 15:24:25 +01:00
Joachim Bauch
ed1c834a29
Stop publishers if session is no longer allowed to publish. 2021-08-05 12:15:26 +02:00
Joachim Bauch
7618bc683c
Ignore room NATS messages that were sent before the room was joined.
Can happen mostly during tests (e.g. TestClientTakeoverRoomSession)
where the new client could receive the "leave" event that was sent
before it joined the room (but got delivered after joining).
2021-06-08 09:20:18 +02:00
Joachim Bauch
2f4414561e
No need to include trailing newline in log messages. 2021-06-04 16:42:17 +02:00