Commit Graph
684 Commits
Author SHA1 Message Date
cnderrauber 5dd6858acf Don't wait rtp packet to fire track (#3246)
* Don't wait rtp packet to fire track

Create track from sdp instead of first rtp packet,
it is consistent with the browser behavior and
will accelerate the track publication.

* fix test
2024-12-13 15:06:14 +08:00
Denys Smirnov dc6fe3aae5 Support SIP list filters. (#3240) 2024-12-09 22:57:47 +02:00
Raja Subramanian 8bb29c3a7b Fixes from probe controller refactor (#3222)
* Fixes from probe controller refactor

* fmt

* static check
2024-11-30 13:34:01 +05:30
cnderrauber 54f9f7de51 upgrade to pion/webrtc v4 (#3213) 2024-11-28 16:05:38 +08:00
Paul Wells 29c7906250 skip http request logging when the client aborts the request (#3195)
* skip http request logging when the client aborts the request

* cleanup
2024-11-22 00:42:49 -08:00
Raja Subramanian 9f25603213 One shot signalling mode (#3188)
* WIP

* comment

* Verify method on LocalParticipant

* cleanup

* clean up

* pass in one-shot-mode to StartSession

* null message source and sink

* feedback and also remove check in ParticipantImpl for one-shot-mode-filtering as a null sink can be used for that
2024-11-21 09:33:28 +05:30
Paul Wells 73fbc6b8bb convert psprc error to http code in rtc service failure response (#3187) 2024-11-19 19:45:00 -08:00
Paul Wells 9e4dae7107 add per message deflate to signal ws (#3174) 2024-11-14 00:35:30 -08:00
Denys Smirnov 55d084fd18 Annotate SIP errors with Twirp codes. (#3161) 2024-11-07 17:00:57 +02:00
Paul Wells 09f140afa8 auto create rooms during create agent dispatch api request (#3158) 2024-11-05 16:15:05 -08:00
Raja Subramanian 365e63230d Some misc clean up. (#3156)
* Some misc clean up.

- Have been seeing counterfeiter warnings about efficiency for a while
  with go:generate declaration multiple times in the same package.
  Address that: https://github.com/maxbrunsfeld/counterfeiter?tab=readme-ov-file#step-2b---add-counterfeitergenerate-directives
- A bit more readability on parameters passed to `sendLeave`

* spacing

* revert some deletes as the complaint was in analytics service only

* Declare in package only once.

Although the warning is about go:generate multiple times when directly
giving the interface to generate, have `go:generate` multiple times in a
package even with `-generate` ends up generating once per invocation.
Once per package is enough to run the generation just once.
2024-11-04 11:26:41 +05:30
Raja Subramanian 49b75e94a6 Consolidate operations on LocalNode. (#3140) 2024-10-25 18:57:23 +05:30
Paul Wells b0d3d65f18 update events package (#3126)
* update events package

* deps
2024-10-21 23:44:00 -07:00
David ZhaoandPaul Wells dd7cd7eafc Handle room configuration that's set in the grant itself (#3120)
* Handle room configuration that's set in the grant itself

* ensure refresh token contains updates

* deps

* dep

---------

Co-authored-by: Paul Wells <paulwe@gmail.com>
2024-10-21 23:31:12 -07:00
Benjamin Pracht d751f209d5 Allow requesting a dialtone during call transfer (#3122) 2024-10-21 21:05:31 -07:00
Raja Subramanian 40b10af960 Use monotonic time util. (#3112)
Thank you @paulwe for doing this. I was promising to do this for a
while, but just like other times, empty promises :-(
2024-10-17 10:49:24 +05:30
Ben Cherry 19c5ed6343 Parse python, cpp, unity-web, node sdks in clientinfo (#3110) 2024-10-16 20:18:44 -07:00
Denys Smirnov 50b4d6605e Type safe IP checks for SIP Trunks. (#3108) 2024-10-16 17:48:55 +03:00
Raja Subramanian 8221471b67 Protocol update to get more precise protoproxy timing (#3107)
* Protocol update to get more precise protoproxy timing

* really update protocol
2024-10-16 18:43:09 +05:30
David Zhao 33098337fc Support for attributes in initial agent token (#3097) 2024-10-14 22:45:10 -07:00
David Zhao c41913225d Log fields in SIP service (#3096) 2024-10-14 16:00:15 -07:00
David ZhaoandPaul Wells 2d6aa049c9 Improve agent job assignment logging (#3090)
* Improve agent job assignment logging

* add more agent logging

---------

Co-authored-by: Paul Wells <paulwe@gmail.com>
2024-10-13 00:56:51 -07:00
Paul Wells 00ac004604 use AgentDispatch in internal request (#3074)
* use AgentDispatch in internal request

* deps

* deps

* deps
2024-10-08 01:25:00 -07:00
Paul Wells 3261560098 api for agent worker job count (#3068)
* api for agent worker job count

* cleanup

* temp deps

* temp deps

* deps
2024-10-05 05:13:52 -07:00
Raja Subramanian 2491ee7c7c Make lite version of RTPStatsReceiver called RTPStatsReceiverLite. (#3065)
* Make lite version of RTPStatsReceiver called RTPStatsReceiverLite.

Refactor around that.

Will probably make some more flavors to have lighter versions still.

* update deps

* use MarshalLogArray

* use util
2024-10-05 10:50:25 +05:30
Paul Wells 8befc8224a use canonical room log field name (#3054) 2024-09-27 16:52:34 -07:00
Raja Subramanian 45f23f6fc4 Update protocol to get lower case check for kind and source. (#3048)
Also, log kind in starting RTC session and store a clone always in
participants.
2024-09-26 15:45:42 +05:30
Paul Wells 096157e706 clean up worker jobs in handler when job ends (#3042) 2024-09-25 03:04:01 -07:00
holzgeist 9b277803c6 fix: copy attributes to refresh token (#3036)
otherwise they will be missing on a full reconnect
2024-09-23 08:31:21 -07:00
Paul Wells d26ade0076 add helpers for partiicpant reconnect and version (#3034) 2024-09-22 23:37:35 -07:00
Paul Wells 5e3b3ee3c1 return copy of job state when starting job (#3035) 2024-09-22 23:37:06 -07:00
Benjamin Pracht 22c36ef423 Implement SIP TransferParticipant API (#3026) 2024-09-20 12:16:15 -07:00
Paul Wells 61179d5624 simplify agent registration (#3018)
* simplify agent registration

* testutils

* deps

* fix

* gen

* cleanup

* lower job load
2024-09-19 05:58:30 -07:00
Raja Subramanian 7df6f86693 Initial plumbing for metrics. (#2950)
* Initial plumbing for metrics.

This implements
- metrics received from participant.
- callback to room.
- room distributes it to all other participants (excluding the sending
  participant).
- other participants forward to client.
- counting metrics bytes in data channel stats

TODO:
  - recording/processing/batching
  - should recording/processing/batching happen on publisher side or
    subscriber side?
  - should metrics be echoed back to publisher?
  - grants to publish/subscribe metrics.

* mage generate

* clear OnMetrics on close

* - CanSubscribeMetrics permission.
- Echo back to sender.

* update deps

* No destination identities for metrics

* WIP

* use normalized timestamp for server injected timestamps

* compile

* debug log metrics batch

* correct comment

* add baseTime to wire

* protocol dep

* Scope metrics forwarding to only participants that a participant is
subscribed to.

Also remove the participant_metrics.go file as it was not doing anything
useful.

* update comment

* utils.ErrorIsOneOf

* couple of more utils.CloneProto
2024-09-19 11:42:31 +05:30
Paul Wells 4deaac2f3f replace proto.Clone calls (#3024)
* replace proto.Clone calls

* deps

* tests
2024-09-18 22:47:33 -07:00
Paul Wells 1436a1f186 driveby cleanup (#3017)
* driveby cleanup

* test
2024-09-18 00:45:55 -07:00
Denys Smirnov 47a9969f44 Pass project to CreateSIPParticipantRequest. (#3006) 2024-09-16 20:09:33 +03:00
Denys Smirnov 0e68404f2c Support passing SIP headers. (#2993) 2024-09-13 11:06:38 +03:00
Paul Wells 70b84871fe compute agent service affinity from available capacity (#2995) 2024-09-10 18:12:09 -07:00
Paul Wells b63192a376 add config for signal retry (#2989) 2024-09-08 19:53:19 -07:00
David Zhao 50576b503e Handle trailing slashes in URL (#2988)
When a user includes a trailing slash in LIVEKIT_URL, it would produce
double slashes in the path, i.e. `https://myhost.livekit.cloud//twirp/RoomService.ListRooms`

Currently the server will send a 302 MOVED response, causing Twirp requests to fail.

We now remove the double slash in front within the middleware.
2024-09-07 11:30:24 -07:00
Raja Subramanian bec7453a1f Recreate stats worker on resume if needed. (#2982)
* Ref count the stats worker.

NOTE: Don't liek this much, but wanted to open this get some 👀 on
this and get feedback.

There are two entities, one for counting signal bytes and another for
media stats. They both send `ParticipantJoined` and `ParticipantLeft`
event.

In the case of a participant resume, as the old web socket
connection is closed, that triggers a signal stats counter close. That
would call `ParticipantLeft` and that would close the stats worker.

The closed stats worker got reaped in `FlushStats` after three minutes.

So, all events after that did not have a worker and hence went
unreported including missing participant_left webhook because it relied
on checking if a participant was ever connected and that needed to check
the worker state.

Using a ref count to keep track of join/leaves. And not close the worker
until ref count goes down to 0.

* create a stats worker on resume

* revert incorrect changes

* transfer connected state

* transfer connected state when creating worker

* resolve participant on a resume
2024-09-06 23:58:03 +05:30
Mathew Kamkar 730fe51642 exponential backoff when calling CreateRoom (#2977)
* exponential backoff when calling CreateRoom

* dz+bb review: check ctx cancellation, remove retry max

* bb review: fix loop condition

* raja review: use timer, bring back max tries
2024-09-04 23:18:31 -07:00
David Zhao 91cb4369ef Standardize twirp hooks during server init (#2959) 2024-08-26 00:53:13 -07:00
David Colburn 0fdfe2f5a0 refactor sip create participant (#2949) 2024-08-21 17:13:26 -04:00
Denys Smirnov 7ad6d97b1b Propagate SIP attributes from a Dispatch Rule. (#2943) 2024-08-19 18:09:37 +03:00
Paul Wells dabbb298c5 mark explicit create paths (#2935) 2024-08-13 22:00:39 -07:00
Paul Wells c371929535 add roommanager service (#2931)
* add roommanager service

* cleanup

* deps

* timeout

* cleanup

* cleanup

* config

* cleanup
2024-08-13 11:00:41 -07:00
Benjamin Pracht 64057c3e4d Implement AgentDispatch service (#2919)
This allows listing, adding and deleting agent dispatches on an existing room. Requests go to a new AgentDispatchService, which sends them over RPC to the rtc.Room via the RoomManager. The rtc.Room then does agent job management using RPCs to the agent service.
2024-08-08 22:31:23 +02:00
Dan McFaul 489f73f0a4 distribute load to agents probabilistically, inversely proportionate to load (#2902)
* select the least loaded agent worker for job dispatch

* update to load balance using inverse load

* remove unused file

* adding unit tests for worker job distribution
2024-08-07 21:05:47 -06:00