Commit Graph

40 Commits

Author SHA1 Message Date
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 #227 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 #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 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
Joachim Bauch 21f3f506d1
Send more responses through the session to handle disconnected / resuming clients. 2021-06-04 15:40:43 +02:00
Joachim Bauch 52c1514978
Always use auth userid in ping requests.
Fixes issue introduced in 3a2adffab6 where some
ping requests were not evaluated correctly if a userid was given in the room
session data.
2021-05-19 16:24:15 +02:00
Joachim Bauch c8e4bfe007
Fix various issues found by golangci-lint. 2021-04-26 17:25:52 +02:00
Joachim Bauch 1ceb806c20
Support defining maximum bandwidths at diferent levels.
- Individually for each backend.
- For the proxy client (i.e. signaling server using cluster of proxies).
- For the proxy server / MCU.

The smallest bandwidth configured will be used, e.g. if a backend has a
larger limit than the MCU assigned for the stream, the limit of the MCU
server will be used.
2021-04-23 09:18:05 +02:00
Joachim Bauch 3a2adffab6
Get userid from room session data if present. 2021-04-22 14:18:35 +02:00
Joachim Bauch 047e6655a1
Remove unnecessary assignments. 2021-04-21 14:12:11 +02:00
Joachim Bauch 9b0c4fab00
Update nats.go to 1.10.0 2021-04-13 16:47:28 +02:00
Joachim Bauch 8ba2e0ad64
Switch dependency tracking to Go modules.
With that bump minimum required version to Go 1.13.
2021-04-09 16:15:00 +02:00
Renamed from src/signaling/clientsession.go (Browse further)