Commit graph

70 commits

Author SHA1 Message Date
Joachim Bauch 54c4f1847a
Gracefully shut down signaling server on SIGUSR1.
This will wait for all non-internal sessions to be removed / expired
but stop accepting new connections.
2024-04-23 12:25:33 +02:00
Joachim Bauch 602452fa25
Support resuming sessions that exist on a different Hub in the cluster. 2024-04-23 11:52:43 +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 a68454ceec
Reuse backoff waiting code for errors during GeoIP update. 2024-02-27 16:15:42 +01:00
Joachim Bauch 7d09c71ab9
Strongly type "StreamType". 2024-02-27 15:20:14 +01:00
Joachim Bauch e61845b086
Move common option list parsing code to own function. 2023-12-07 13:33:54 +01:00
Joachim Bauch 0f83392e2d
Skip options from default section when parsing "geoip-overrides". 2023-12-07 12:14:52 +01:00
Joachim Bauch c72c821687
Check backend when searching for session to use for dialout. 2023-10-31 08:33:46 +01:00
Joachim Bauch c134883138
Switch to atomic types from Go 1.19 2023-10-30 09:32:46 +01:00
Joachim Bauch 3a7b4c48dc
Pass along dialout status through transient data. 2023-10-26 09:53:58 +02:00
Joachim Bauch e1273a3c52
Keep list of possible dialout sessions. 2023-10-26 09:53:58 +02:00
Joachim Bauch d1544dcb2c
Implement message handler for dialout support. 2023-10-26 09:53:57 +02:00
Joachim Bauch b006903a56
Support passing TTL when setting transient data from clients. 2023-10-12 11:07:11 +02:00
Joachim Bauch 35135433c2
Return response if session tries to join room again. 2023-09-05 15:43:46 +02:00
Joachim Bauch e9140178f9
Use GeoIP overrides if no GeoIP database is configured. 2023-08-07 11:41:51 +02:00
Joachim Bauch d49d3704fa
Use interface for client callbacks. 2023-02-22 08:34:17 +01:00
Joachim Bauch 8353cbbb0f
Migrate to closer helper class. 2023-02-22 08:34:15 +01:00
Joachim Bauch 2f6e2ba87c
Allow internal clients to set / change the "inCall" flags. 2023-02-20 13:25:37 +01:00
Joachim Bauch cbb6d9ca53
Update capabilities if no hello v2 token key is found in cache.
This is necessary to detect updated Talk setups where the signaling server
might have cached capabilities without the v2 token key but the clients
are trying to connect with a hello v2 token. Fetch updated capabilities in
such cases (but throttle to about one invalidation per minute).
2022-08-04 08:55:21 +02:00
Joachim Bauch 184c941f8a
Support plain Ed25519 key as returned by Nextcloud / PHP. 2022-08-03 16:33:48 +02:00
Joachim Bauch 156bc360ff
Add hello version "2.0" that authenticates connections using a JWT. 2022-08-03 16:33:45 +02:00
Joachim Bauch deaa17acc5
Implement per-backend session limit for clusters. 2022-07-13 11:52:20 +02:00
Joachim Bauch e101e74672
Fix sending messages to virtual sessions on different servers. 2022-07-12 11:54:41 +02:00
Joachim Bauch 95d5e50705
Disconnect sessions with the same room session id synchronously.
Previously there was a difference in the events being received by other
sessions for the clustered case compared to the single-server case.
Now the events / ordering are the same for both cases.
2022-07-11 10:39:06 +02:00
Joachim Bauch 66e502dc9b
Fix handling of "unshareScreen" messages and add test.
Also update tests for "requestoffer" / "sendoffer".
2022-07-08 17:09:22 +02:00
Joachim Bauch 608415c3ff
Track anonymous sessions not in rooms instead of clients.
Otherwise it would be possible for clients to reconnect to reset their
timer to join a room.
2022-07-08 15:52:32 +02:00
Joachim Bauch 545bce0082
Fix and add test for clustered disconnect of duplicate room ids. 2022-07-08 14:57:29 +02:00
Joachim Bauch d3f8876d25
Merge pull request #281 from strukturag/refactor-async-events
Clustering support
2022-07-07 16:24:15 +02:00
Joachim Bauch f7db8a38e1
Send initial "welcome" message when clients connect.
This can be used to detect server features before performing the
actual "hello" handshake.
2022-07-07 09:57:10 +02:00
Joachim Bauch 24eab34da7
Allow configuring backends through etcd. 2022-06-30 11:35:36 +02:00
Joachim Bauch 20cc51c2fe
grpc: Automatically detect if a target is the current server itself.
This allows configuring the same list of targets for all instances without
having to setup the "own" address differently for each server.
2022-06-30 11:35:35 +02:00
Joachim Bauch dcb5be956c
Implement "sendoffer" for remote sessions. 2022-06-30 11:35:33 +02:00
Joachim Bauch 36710c8aa9
Improve detection of decodable sessions that were created on a different server. 2022-06-30 11:35:32 +02:00
Joachim Bauch a0d3af14e0
Add initial clustering support. 2022-06-30 11:35:28 +02:00
Joachim Bauch ece2903413
Trigger "joined" events through async messages. 2022-06-24 13:37:37 +02:00
Joachim Bauch 0115c97946
Refactor asynchronous events to central location. 2022-06-24 13:37:35 +02:00
Joachim Bauch 800ece1d90
Support combining ping requests of different rooms on the same backend. 2022-05-17 16:38:16 +02:00
Joachim Bauch c0f56ff81a
Merge pull request #239 from strukturag/toggle-audio-video
Support toggling audio/video in subscribed streams.
2022-05-10 11:39:10 +02:00
Joachim Bauch ec7bc6874e
Remove redundant check for "nil" (fixes linter error). 2022-05-10 10:52:19 +02:00
Daniel Calviño Sánchez 3f7ebc8ef9 Fix "signaling_server_messages_total" stat not being incremented
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-05-03 13:56:35 +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 5f97794691
Send directly to local session with disconnected client.
Before it was using NATS to deliver the message to the session.
2022-04-11 16:53:47 +02:00
Joachim Bauch 97f2a1d5f0
Add special events to update "incall" flags of all sessions. 2022-03-23 09:15:22 +01:00
Joachim Bauch 8fd9c688b6
Merge pull request #195 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 cd93db60a4 Introduce feature flag for SDP updates
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2022-02-25 07:47:30 +01:00
Joachim Bauch fca30af201
Add API for transient room data. 2022-02-16 12:30:39 +01:00
Joachim Bauch 76ad24ca62
Include room session id in "joined" events.
This helps with matching signaling sessions with sessions in Talk.
2021-12-17 16:02:22 +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 a05acc9cb4
Include available features in header of backend requests to Nextcloud.
The header "X-Spreed-Signaling-Features" will contain a comma-separated list
of feature flags.
2021-11-03 15:24:27 +01:00