Commit Graph

2164 Commits

Author SHA1 Message Date
Raja Subramanian
affcd1ffdb Support updating local track features when pending. (#2863) 2024-07-15 23:51:39 +05:30
cnderrauber
5e1b18dab3 Add option to disable ice lite (#2862)
Some sfu's ice agent implementation has problem
to establish ice connection with lite ice agent,
add option to let client to disble it in server side.
2024-07-15 15:11:46 +08:00
Raja Subramanian
faa66d1138 Make sender report pass through an option. (#2861)
Enabled by default.

Also, tweak the long term propagation delay a bit. The first propagation
delay itself was too high and the long term initialized with a high
value. Prevent that and also ensure large negtaives do not have an
effect by using a lower bound of 0. Lower bound of 0 is okay as the main
purpose is to track sustained high positive values.
2024-07-15 11:27:31 +05:30
cnderrauber
a995c71f84 Fallback to primary encoding if redundant block overflow (#2858)
* Fallback to primary encoding if redundant block overflow

* revert mtu change
2024-07-12 16:39:54 +08:00
Raja Subramanian
09e3aef859 Check size limits on metadata and name set from client. (#2850)
* Send error response when update metadata fails.

Keeping it simple for the first implementation.
- Send error response only if request_id != 0
- Two kinds of errors notified
  o does not have permissions - NOT_ALLOWED
  o attributes exceeds size limits -  INVALID_ARGUMENT

* Check size limits on metadata and name set from client.

Added a name length limit also.

* check name length in service update participant path also

* limit check in limit config

* update protocol

* longer keys
2024-07-12 09:57:17 +05:30
Benjamin Pracht
6c1d5e8699 Do not create room in UpdateRoomMetadata (#2854) 2024-07-11 17:50:30 -07:00
Benjamin Pracht
a1f8e879cd Allow specifying room configuration in token (#2853) 2024-07-10 20:48:19 -07:00
Raja Subramanian
b8847cd8e9 Send error response when update metadata fails. (#2849)
Keeping it simple for the first implementation.
- Send error response only if request_id != 0
- Two kinds of errors notified
  o does not have permissions - NOT_ALLOWED
  o attributes exceeds size limits -  INVALID_ARGUMENT
2024-07-10 23:26:44 +05:30
Denys Smirnov
40d7a8add0 Always forward DTMF data messages. (#2848) 2024-07-10 00:29:49 +03:00
cnderrauber
deee816d0a Forward correct payload type for mixed up red/primary payload (#2847)
* Forward correct payload type for mixed up red/primary payload

* empty line

* log field & test case
2024-07-09 23:04:47 +08:00
Raja Subramanian
27f6794e77 Check sender report against media path. (#2843)
Seeing cases (mostly across relay) of large first packet time adjustment
getting ignored. From data, it looks like the first packet is extremely
delayed (some times of the order of minutes) which does not make sense.

Adding some checks against media path, i. e. compare RTP timestamp from
sender report against expected RTP timestamp based on media path
arrivals and log deviations more than 5 seconds.

Another puzzling case. Trying to understand more.

Also, refactoring SetRtcpSenderReportData() function as it was getting
unwieldy.
2024-07-09 09:20:27 +05:30
cnderrauber
4e9ab46091 use correct payload type for red primary encoding (#2845) 2024-07-09 10:30:05 +08:00
Benjamin Pracht
fb7eb3450e Update agents service to updated protocol (#2837)
- Deprecate namespace field
- Restore former semantic of starting a job for each registered namespace, for a given Agent Name
- Add agentName field
- Use "dispatcher" naming convention
2024-07-08 17:09:11 -07:00
Raja Subramanian
acbd4ea104 Handle cases of long mute/rollover of time stamp. (#2842)
* Handle cases of long mute/rollover of time stamp.

There are cases where the track is muted for long enough for timestamp
roll over to happen. There are no packets in that window (typically
there should be black frames (for video) or silence (for audio)). But,
maybe the pause based implementation of mute is causing this.

Anyhow, use time since last packet to gauge how much roll over should
have happened and use that to update time stamp. There will be really
edge cases where this could also fail (for e. g. packet time is affected
by propagation delay, so it could theoretically happen that mute/unmute
+ packet reception could happen exactly around that rollover point and
  miscalculate, but should be rare).

As this happen per packet on receive side, changing time to `UnixNano()`
to make it more efficient to check this.

* spelling

* tests

* test util

* tests
2024-07-08 11:07:20 +05:30
Raja Subramanian
39c59d913d Do not warn on padding (#2839) 2024-07-07 12:30:54 +05:30
Raja Subramanian
2bcfcbc354 Log mime and subscriberID for downtrack and descendents (#2838) 2024-07-06 23:15:23 +05:30
cnderrauber
70fbba2844 Add track subscribed notification to publisher (#2834)
* Add track subscribed notification to publisher

* update go mod
2024-07-05 21:57:03 +08:00
Raja Subramanian
bfb7db2d91 RTP packet validity check. (#2833)
Adding some checks before packet is forwarded to check for anomalies.
Will remove after a round of debug.
2024-07-04 12:42:25 +05:30
cnderrauber
7a5c90dc01 log non-trickle candidate in details (#2832)
* log non-trickle candidate in details

* fix test
2024-07-03 14:16:58 +08:00
Paul Wells
e511464d3d add handler interface to receive agent worker updates (#2830)
* add handler interface to receive agent worker updates

* cleanup
2024-07-02 13:11:08 -07:00
Raja Subramanian
b4134edf40 Log rtp stats state on large jumps. (#2829)
Forgot to include in receiver.
2024-07-01 11:51:05 +05:30
Raja Subramanian
57980fcc36 fix logging ignored key (#2826) 2024-06-28 10:34:41 +05:30
Benjamin Pracht
32a4d03c9e Implement Agents protocol addition (#2786) 2024-06-27 19:20:52 -07:00
Denys Smirnov
6815d85c01 Broadcast attributes update. (#2825) 2024-06-27 17:39:05 +03:00
holzgeist
6523c9c099 Feat add prometheus auth (#2252)
* feat: add support for basic auth on prometheus

* fix: properly name middleware generator

* refactor: move all prometheus configs into common object

* chore: add suggestions from review

add back old config switch and print warning if it is used

* fix: undo accidental change

* fix: rebase/merge issue
2024-06-27 02:13:51 -07:00
Raja Subramanian
fa88fbf028 Revert "Revert "use pending lock, no need for participant lock (#2793)" (#2818)" (#2820)
This reverts commit 6d9529431f.
2024-06-26 13:05:27 +05:30
Raja Subramanian
6d9529431f Revert "use pending lock, no need for participant lock (#2793)" (#2818)
This reverts commit f92e7e3db8.
2024-06-26 11:26:50 +05:30
Raja Subramanian
fa490dd510 Log rtp stats more consistently. (#2816)
* Log rtp stats more consistently.

Thank you Paul for the logging tip.
Also update deps.

* remove duplicate logging field

* nil check
2024-06-25 14:55:42 +05:30
Raja Subramanian
6bb48dd6f1 Do not log duplicate on large negative on send side (#2815) 2024-06-24 12:51:35 +05:30
Denys Smirnov
4388618e9a Update protocol. Use SIP grants. (#2808) 2024-06-23 21:54:28 +03:00
Raja Subramanian
cdb5f3ed68 Log more around unexpected cases (#2813)
- too many padding packets
- also fix cse of snapshot not getting any packets
2024-06-23 00:33:56 +05:30
Raja Subramanian
091eab556d Update mediatransportutil (#2812) 2024-06-22 11:32:28 +05:30
David Zhao
7a774cc82a Support for participant attributes (#2806)
* Support for participant attributes

* move metadata setters to LocalParticipant

* address feedback

* forward error

* update go mod

* update attributes first
2024-06-19 23:14:19 -07:00
Raja Subramanian
d4e50b633f Do not log warns on duplicate. (#2807)
With RTX, some clients use very old packets for probing. Check for
duplicate before logging warning about old packet/negative sequence
number jump.

Also, double the history so that duplicate tracking is better. Adds
about 1/2 KB per RTP stream.
2024-06-20 10:52:12 +05:30
Lukas Herman
8a229fda9d add participant session duration metric (#2801) 2024-06-17 17:52:08 -04:00
Denys Smirnov
74c7b93170 Support new SIP Trunk API. Improve Redis tests. (#2799) 2024-06-17 21:49:51 +03:00
Raja Subramanian
ef838e4fa2 Indicate if track is expectd to be resumed in onClose callback. (#2800)
That is the main change. Changed variable name to `isExpectedToResume`
everywhere to be consistent.

Planning to use the callback value in relays to determine if the down
track should be closed or switched to a different up track.
2024-06-17 23:51:00 +05:30
Raja Subramanian
5d969ba35b remove some debug (#2797) 2024-06-17 12:57:04 +05:30
Paul Wells
2bc101d323 use request context for LaunchJob api request (#2796)
* use request context for LaunchJob api request

* one more
2024-06-16 21:16:29 -07:00
Raja Subramanian
f92e7e3db8 use pending lock, no need for participant lock (#2793) 2024-06-15 20:44:50 +05:30
Paul Wells
58e365847b add test helper for config yaml tags (#2791)
* add test helper for config yaml tags

* deps

* cleanup

* cleanup
2024-06-13 23:22:39 -07:00
David Zhao
ecf1175832 Generate and send uuid with analytics (#2790)
* Generate and send uuid with analytics

* go mod
2024-06-13 23:00:50 -07:00
Raja Subramanian
ea60368100 Do not error out on invalid packet. (#2789)
Remove the return when encountering invalid packet.
Also, log more sparesely.
Proper error returns from util so that we can selectively drop packets
based on error type, for example SSRC mismatches are okay type of thing.
2024-06-14 11:10:57 +05:30
Théo Monnom
5def48bad9 fix agent jobs not launching when using the CreateRoom API (#2784) 2024-06-13 00:00:02 +02:00
David Colburn
29614cd4a1 clean up egress launcher (#2779) 2024-06-10 16:11:11 -07:00
Raja Subramanian
129ba62d61 Validate RTP packets. (#2778)
* Validate RTP packets.

Check version, payload type (if available) and SSRC (if available)
and drop bad packets. And let repair mechanisms take effect for those
packets.

* address data race reported by test

* fix an unlock and test packets
2024-06-10 15:43:59 +05:30
Raja Subramanian
a31f59b689 Log first time adjustment total. (#2776)
* Log first time adjustment total.

Seeing cases where the first time is 400ms+ before start time.
Possible it is getting that much adjustment, but would be good to see
how much total adjustment happens.

* log propagation delay
2024-06-09 23:07:01 +05:30
Raja Subramanian
38d213ed10 Do not compare payload type before bind (#2775) 2024-06-09 01:03:38 +05:30
Raja Subramanian
b58db82254 Log invalid RTP packet (#2774) 2024-06-08 10:36:05 +05:30
Raja Subramanian
cee3fdb25e Better lock for sender report TS offset. (#2771)
* Better lock for sender report TS offset.

It is possible that a resume has happened and new time stamp offset
calculated. But, a sender report from publisher comes with a time stamp
prior to the time stamp which was used for offset calculation. Using
that sender report in the forwarding path causes jumps.

Example
- Track forwarding, let us tsOffset = `a`
- Unmute/layer switch - one of those events happens, a new tsOffset will
  be calculated, let us say that offset is `b` and it is based on
  incoming time stmap of `c`.
- A sender report from publisher could arrive with timestamp = `d`.
  o If `d` >= `c`,  the offset `b` is correct and can be applied.
  o But, it is possible that `d` < `c`, in that case, offset `a` should
    be used and not `b`.

To address this, keep track of incoming extended timestamp at switch
point and accept incoming sender reports which have a timestamp >=
switch point timestamp.

* clean up

* log more details on invalid layer
2024-06-07 23:56:10 +05:30