Commit Graph

374 Commits

Author SHA1 Message Date
shishir gowda
78343b233f Minor fixes
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-11-02 19:55:17 +01:00
shishir gowda
a6c6bd5399 datastream support
Signed-off-by: shishir gowda <shishir@livekit.io>
2022-11-02 16:00:33 +01:00
Benjamin Pracht
9a45b59414 Use ingress specific grants (#1125) 2022-10-26 21:37:36 -07:00
David Colburn
7223d9c132 web egress (#1126) 2022-10-26 13:43:56 -07:00
Mathew Kamkar
26fe910e88 Generated CLI Flags (#1112) 2022-10-25 22:24:08 -07:00
Raja Subramanian
82c2ec8273 Remove named returns from room service. (#1124) 2022-10-26 10:24:13 +05:30
Raja Subramanian
4344af6fd3 Some misc changes (#1107)
- ticker.Stop always
- clean up timer func (if they are added) on participant close
- sequencer test enhancement to add a real packet after a pdding packet
2022-10-20 11:11:45 +05:30
David Colburn
dff5379b78 remove record check on CreateRoom (#1096) 2022-10-17 11:25:20 -07:00
cnderrauber
759e3bb1f2 Refine nat 1to1 mapping setting (#1094)
Now only set mapping when user_external_ip enabled or node_ip is
explicitly set. If multiple local address resolved to same external
ip, only the first one will be mapped to external, avoid candidate
conflict between different clients.
2022-10-17 16:11:52 +08:00
David Zhao
4161768530 Log Service API requests (#1091) 2022-10-17 00:16:54 -07:00
Samuel Humeau
00ec859dd1 Add default handler to 404 (#1088) 2022-10-16 10:30:34 -07:00
David Colburn
78386c4669 Update protocol (#1075)
* update protocol

* auto egress ensure unique filename

* fix tests
2022-10-10 10:38:46 -07:00
David Zhao
1019faa0e6 Cleanup pass through logging (#1073)
* added filtering for noisy pion logs
* demoted some logs to debug
* using consistent trackID / participant / publisher / subscriber terminology
* removed ice candidate log lines, deferring to combined log
2022-10-06 23:48:37 -07:00
Benjamin Pracht
c3120679e6 Make sure CreateIngress returns an empty state (#1069) 2022-10-04 19:23:09 -07:00
Benjamin Pracht
8cf0872ec1 Adopt updated ingress RPC API (#1068) 2022-10-03 11:31:55 -07:00
cnderrauber
716f27c435 Close UDPMux when exit (#1064)
* Close UDPMux when exit

* fix test failed
2022-10-01 09:03:58 +08:00
Raja Subramanian
33f5dbc501 Make strict mode a param (#1054)
So, a wrapping config (like cloud) can skip the strict mode check.
2022-09-29 13:07:32 +05:30
Benjamin Pracht
932af81f34 Update strored version of an active ingress if no ingress server responds (#1031)
This allows deleting and updating an ingress even if the ingress server that was handling it died. It does however mean that if the ingress responds again later, its state will be inconsistent. To somewhat make this less likely, also keep trying contacting the ingress for 1 min in the background.

Also fixing a race where an active deleted Ingress would get recreated on delete because of the update triggered by the ingress session shutdown
2022-09-26 11:16:27 -07:00
David Zhao
5e1912e44c Enable TCP/TURN fallback by default (#1033) 2022-09-22 23:58:07 -07:00
David Colburn
b97d59b8db consolidate room internal (#1030)
* consolidate room internal

* create room internal map

* pipelined room read

* check error

* fix pipelined reads

* clean up after test
2022-09-22 15:59:27 -07:00
David Colburn
803046b882 Auto egress (#1011)
* auto egress

* fix room service test

* reuse StartTrackEgress

* add timestamp

* update prefixed filename explicitly

* update protocol

* clean up telemetry

* fix telemetry tests

* separate room internal storage

* auto participant egress

* remove custom template url

* fix internal key

* use map for stats workers

* remove sync.Map

* remove participant composite
2022-09-21 12:04:19 -07:00
David Zhao
feb47812e7 Allow CORS responses to be cached to allow faster initial connection (#1027) 2022-09-20 23:56:24 -07:00
David Zhao
99cb021e85 Increase max wait for media node to respond. (#1026)
In extreme cases, media nodes could take more than 5s to spin up the
session. Increasing this timeout to 10s reduces the number of disconnections
due to edge cases.
2022-09-20 23:38:58 -07:00
Raja Subramanian
60297b24fd Use UnixMilli (#1009)
* Use UnixMilli

* enhance comment
2022-09-15 19:17:24 +05:30
Raja Subramanian
07c43e0972 Supervisor beginnings (#1005)
* Remove VP9 from media engine set up.

* Remove vp9 from config sample

* Supervisor beginnings

Eventual goal is to have a reconciler which moves state from
actual -> desired. First step along the way is to observe/monitor.
The first step even in that is an initial implementation to get
feedback on the direction.

This PR is a start in that direction
- Concept of a supervisor at local participant level
- This supervisor will be responsible for periodically monitor
  actual vs desired (this is the one which will eventually trigger
  other things to reconcile, but for now it just logs on error)
- A new interface `OperationMonitor` which requires two methods
  o Check() returns an error based on actual vs desired state.
  o IsIdle() returns bool. Returns true if the monitor is idle.
- The supervisor maintains a list of monitors and does periodic check.

In the above framework, starting with list of
subscriptions/unsubscriptions. There is a new module
`SubscriptionMonitor` which checks subscription transitions.
A subscription transition is queued on subscribe/unsubscribe.
The transition can be satisfied when a subscribedTrack is added OR
removed. Error condition is when a transition is not satisfied for
10 seconds. Idle is when the transition queue is empty and
subscribedTrack is nil, i. e. the last transition would have been
unsubscribe and subscribed track removed (unsubscribe satisfied).

The idea is individual monitors can check on different things.
Some more things that I am thinking about are
- PublishedTrackMonitor - started when an add track happens,
  satisfied when OnTrack happens, error if `OnTrack` does not
  fire for a while and track is not muted, idle when there is
  nothing pending.
- PublishedTrackStreamingMonitor - to ensure that a published track
  is receiving media at the server (accounting for dynacast, mute, etc)
- SubscribedTrackStreamingMonitor - to ensure down track is sending
  data unless muted.

* Remove debug

* Protect against early casting errors

* Adding PublicationMonitor
2022-09-15 11:16:37 +05:30
Benjamin Pracht
b0eead22b5 Allow specifying a different RTMP url domain for each ingress (#994) 2022-09-12 14:03:15 -07:00
David Zhao
7e3155dcd6 ForceTCP only for supported clients (#997)
* ForceTCP only for supported clients

Revert back to standard if forceRelay with TLS fails
Don't force TLS unless it's configured

* fix lint
2022-09-09 18:14:36 -07:00
David Zhao
5cfd21c1ef Fix inaccurate participant count due to storing old data (#992) 2022-09-07 18:33:28 -07:00
cnderrauber
441053b7fa add participant id when client reconnect (#988) 2022-09-07 15:56:56 +08:00
Benjamin Pracht
aaeba74402 Import ErrIngressOutOfDate from protocol (#987) 2022-09-06 16:05:17 -07:00
David Zhao
da2525e973 for some reasons this wasn't generated before committed. (#974) 2022-08-31 21:35:51 -07:00
Benjamin Pracht
d8edb9b2e7 Adopt Ingress RPC interface changes (#972) 2022-08-31 14:14:40 -07:00
cnderrauber
c401ca58af turn packet and bytes stats used for telemetry and load control (#969)
* stats for turn

* add connections stats

* stats for standalone turn server only

* wire update
2022-08-31 11:00:27 +08:00
David Zhao
aa4f713d1e Document tcp fallback (#961)
* Updated docs around TCP fallback

* changed allowFallback to a pointer
2022-08-27 14:59:01 -07:00
Raja Subramanian
781bd74098 443 for TLS (#956)
* Use 443 for TURN TLS

* Explicit disable when TLS is not set
2022-08-25 09:05:44 +05:30
cnderrauber
31d3d5e8b9 ignore udp turn when force tls (#952) 2022-08-24 20:45:48 +05:30
cnderrauber
1350400c3a fallback to turn over tls when tcp short connection happen (#950)
* fallback to tls when tcp failed

* go mod

* magefile
2022-08-24 20:42:56 +08:00
cnderrauber
f365481dde unify resume/restart in single/multi node mode (#946) 2022-08-23 18:22:44 +08:00
cnderrauber
0b42a8f2c6 loop variable captured (#945) 2022-08-23 14:27:21 +08:00
cnderrauber
a118d21af0 add red codec for opus (#938)
* opus/red codec

* panic

* forward red track to nonred subscriber

* config

* clean code

* solve comments
2022-08-22 12:32:27 +08:00
David Zhao
b8bda3f14b Separate calls to Telemetry vs Prometheus room lifecycle (#935)
* Separate calls to Telemetry vs Prometheus room lifecycle

* remove unused import
2022-08-20 20:22:16 -07:00
cnderrauber
770076febf fix resume/restart with single node mode (#930)
* fix resume/restart with single node mode

* clean comment
2022-08-18 12:46:18 +08:00
David Zhao
d9059f4f3b Do not accept websocket connection if response not received (#923)
When the instance handling the signal request did not respond to the
initial connection, we will fail the connection attempt instead of
having it hang forever.
2022-08-16 19:57:41 -07:00
David Zhao
1d199d1efa Populate network field when set by clients (#919) 2022-08-15 23:28:15 -07:00
David Zhao
f09885825e Return ServerInfo to clients on join (#904)
* checkpoint

* Return ServerInfo in join response

* also include node information

* less verbose quality score

* update go modules
2022-08-10 17:04:17 -07:00
Raja Subramanian
49cf15cdca Fix filtering candidates (#901)
* Filter candidate after setting description

* comment

* Fix filtering candidates

- For offer/answer from remote, do filtering before setting remote
  description so that Pion does not see filtered candidates
- For offer/answer originating from server, do filtering after setting
  local description (comments in code) so that remote side does not
  see filtered candidates.
- Make logging a little consistent and use right context.

* Comment

* TCP fallback config and UT (broken now)

* log SDP only when preferring TCP

* Remove TCP fallback test attempt
2022-08-10 10:42:46 +05:30
Benjamin Pracht
67d3f21122 Only update an IngressInfo if the StartedAt field is newer or equal to the one currently in storage (#897)
This is meant to ensure that we will not overwrite the state of an ingress that already reconnected to a different server on failure or timeout
2022-08-09 19:07:56 -07:00
David Zhao
ab1ccae0c7 Respond to signal ping / pong (#871)
* Respond to signal ping / pong

* Pass back 1 for pong for now, we don't need the timestamp

* update protocol
2022-08-05 09:24:47 -07:00
Raja Subramanian
c75090a0fe Use a TTL of 1 hour for ICE config cache (#873) 2022-08-05 17:31:28 +05:30
Raja Subramanian
3f16018b62 Cache ICE config in room manager. (#872)
* Cache ICE config in room manager.

* mage generate

* Read ICE config within lock
2022-08-05 12:49:19 +05:30