diff --git a/README.md b/README.md index 9f1319c78..fc1d5cb2e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ LiveKit is an open source project that provides scalable, multi-user conferencin - Built for production - JWT authentication and [server APIs](https://docs.livekit.io/guides/server-api) - Robust networking & connectivity, over UDP & TCP - Easy to deploy - pure Go & single binary -- Advanced features - speaker detection, simulcasting, selective subscription, moderation APIs. +- Advanced features - speaker detection, simulcast, selective subscription, moderation APIs, and webhooks. ## Documentation & Guides diff --git a/go.mod b/go.mod index 7057e0bec..e9f326672 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/google/wire v0.5.0 github.com/gorilla/websocket v1.4.2 github.com/jxskiss/base62 v0.0.0-20191017122030-4f11678b909b - github.com/livekit/protocol v0.7.0 + github.com/livekit/protocol v0.7.1 github.com/magefile/mage v1.11.0 github.com/maxbrunsfeld/counterfeiter/v6 v6.3.0 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index 8f62128dd..b3c5c4284 100644 --- a/go.sum +++ b/go.sum @@ -239,6 +239,8 @@ github.com/livekit/ion-sfu v1.20.6 h1:vA98RfuW3sSidV1rfK+/szGWgHFgki4Q4pomxsJS0i github.com/livekit/ion-sfu v1.20.6/go.mod h1:dEdOG4KSqIftr5HxxqciNKBIdu0v3OD0ZYL7A3J09KA= github.com/livekit/protocol v0.7.0 h1:p1HjTwlFdWalJAHs0zDFXy3Nyou0z+WqD9bernAoGT0= github.com/livekit/protocol v0.7.0/go.mod h1:Vk04t1uIJa+U2L5SeANEmDl6ebjc9tKVi4kk3CpqW74= +github.com/livekit/protocol v0.7.1 h1:KO6n7SYrwJfnHekX0GrFY1BfC+fCXYHa5yIQ099rgsU= +github.com/livekit/protocol v0.7.1/go.mod h1:Vk04t1uIJa+U2L5SeANEmDl6ebjc9tKVi4kk3CpqW74= github.com/lucsky/cuid v1.0.2 h1:z4XlExeoderxoPj2/dxKOyPxe9RCOu7yNq9/XWxIUMQ= github.com/lucsky/cuid v1.0.2/go.mod h1:QaaJqckboimOmhRSJXSx/+IT+VTfxfPGSo/6mfgUfmE= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= diff --git a/pkg/service/roommanager.go b/pkg/service/roommanager.go index 736e2eb8a..25fbc9ec2 100644 --- a/pkg/service/roommanager.go +++ b/pkg/service/roommanager.go @@ -348,8 +348,8 @@ func (r *RoomManager) getOrCreateRoom(roomName string) (*rtc.Room, error) { } r.notifyEvent(&livekit.WebhookEvent{ - Type: webhook.EventRoomFinished, - Room: room.Room, + Event: webhook.EventRoomFinished, + Room: room.Room, }) // print stats @@ -374,8 +374,8 @@ func (r *RoomManager) getOrCreateRoom(roomName string) (*rtc.Room, error) { r.lock.Unlock() r.notifyEvent(&livekit.WebhookEvent{ - Type: webhook.EventRoomStarted, - Room: room.Room, + Event: webhook.EventRoomStarted, + Room: room.Room, }) return room, nil @@ -393,7 +393,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici _ = participant.Close() r.notifyEvent(&livekit.WebhookEvent{ - Type: webhook.EventParticipantLeft, + Event: webhook.EventParticipantLeft, Room: room.Room, Participant: participant.ToProto(), }) @@ -401,7 +401,7 @@ func (r *RoomManager) rtcSessionWorker(room *rtc.Room, participant types.Partici defer rtc.Recover() r.notifyEvent(&livekit.WebhookEvent{ - Type: webhook.EventParticipantJoined, + Event: webhook.EventParticipantJoined, Room: room.Room, Participant: participant.ToProto(), }) @@ -580,7 +580,7 @@ func (r *RoomManager) notifyEvent(event *livekit.WebhookEvent) { r.webhookPool.Submit(func() { if err := r.notifier.Notify(event); err != nil { - logger.Warnw("could not notify webhook", err, "event", event.Type) + logger.Warnw("could not notify webhook", err, "event", event.Event) } }) } diff --git a/test/webhook_test.go b/test/webhook_test.go index 4d75b0b9a..1632285db 100644 --- a/test/webhook_test.go +++ b/test/webhook_test.go @@ -156,7 +156,7 @@ func (s *webookTestServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { } s.lock.Lock() - s.events[event.Type] = &event + s.events[event.Event] = &event s.lock.Unlock() }