Commit graph

15 commits

Author SHA1 Message Date
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 156a8a2086
Merge pull request #221 from danxuliu/fix-media-type-not-updated-after-publisher-renegotiations
Fix mediaType not updated after publisher renegotiations
2022-04-07 08:24:57 +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 81a52389aa
Stop using deprecated ioutil package. 2022-04-05 12:48:27 +02:00
Joachim Bauch 58b4beb3ba
Update etcd to v3.5.1
Requires at least Golang 1.14
2022-04-05 11:16:38 +02:00
Joachim Bauch 659730d371
Support DNS discovery for proxy server URLs.
If the hostname of a proxy server resolves to multiple IP addresses,
a connection is established to each of them.

Changes to the DNS are monitored regularly and proxy connections are
created or deleted as necessary.
2022-04-04 16:17:22 +02: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 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 42dc476033
Only log RTT of connections to proxy if larger than 500ms. 2021-11-03 14:56:25 +01:00
Joachim Bauch e09022c78d
deps: Migrate to "github.com/golang-jwt/jwt".
The previous "gopkg.in/dgrijalva/jwt-go.v3" is no longer maintained.
2021-10-11 14:02:57 +02:00
Joachim Bauch c01caa94e6
Add prometheus metrics. 2021-08-10 08:50:39 +02:00
Joachim Bauch 7bf6fa903b
Support continent mapping overrides.
This can be used for example to route all users on continent A to proxies
on continent B. Useful if no proxy exists on continent A and the global
selection chooses a non-ideal proxy.
2021-08-06 16:00:54 +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 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/mcu_proxy.go (Browse further)