From 0f4c1682f5a7c64bb02700d0ef1886b733765a6a Mon Sep 17 00:00:00 2001 From: Thierry Kauffmann Date: Wed, 9 Mar 2022 16:58:35 +0100 Subject: [PATCH] feat: add support for analytics callback url fix #194 --- README.md | 19 ++++++++++--------- lib/BigBlueButton/API.php | 7 +++++++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 8e017bc..ee22e50 100644 --- a/README.md +++ b/README.md @@ -69,15 +69,16 @@ used configuration keys in the list below. Please beware that there will be no check if those values are correct. Therefore this is not the recommended way. The syntax to set all settings is `occ config:app:set bbb KEY --value "VALUE"`. -Key | Description ---------------------- | ------------------------------------------------------------------------------------ -`app.navigation` | Set to `true` to show navigation entry -`app.navigation.name` | Defines the navigation label. Default "BigBlueButton". -`api.url` | URL to your BBB server. Should start with `https://` -`api.secret` | Secret of your BBB server -`app.shortener` | Value of your shortener service. Should start with `https://` and contain `{token}`. -`avatar.path` | Absolute path to an optional avatar cache directory. -`avatar.url` | URL which serves `avatar.path` to be used as avatar cache. +Key | Description +--------------------------------- | ------------------------------------------------------------------------------------ +`app.navigation` | Set to `true` to show navigation entry +`app.navigation.name` | Defines the navigation label. Default "BigBlueButton". +`api.url` | URL to your BBB server. Should start with `https://` +`api.secret` | Secret of your BBB server +`api.meta_analytics-callback-url` | URL which gets called after meetings ends to generate statistics. See [bbb-analytics](https://github.com/betagouv/bbb-analytics). +`app.shortener` | Value of your shortener service. Should start with `https://` and contain `{token}`. +`avatar.path` | Absolute path to an optional avatar cache directory. +`avatar.url` | URL which serves `avatar.path` to be used as avatar cache. ### Avatar cache (v2.2+) The generation of avatars puts a high load on your Nextcloud instance, since the diff --git a/lib/BigBlueButton/API.php b/lib/BigBlueButton/API.php index ade4139..1e56b6e 100644 --- a/lib/BigBlueButton/API.php +++ b/lib/BigBlueButton/API.php @@ -175,6 +175,13 @@ class API { $createMeetingParams->addMeta('bbb-origin', \method_exists($this->defaults, 'getProductName') ? $this->defaults->getProductName() : 'Nextcloud'); $createMeetingParams->addMeta('bbb-origin-server-name', $this->request->getServerHost()); + $analyticsCallbackUrl = $this->config->getAppValue('bbb', 'api.meta_analytics-callback-url'); + if (!empty($analyticsCallbackUrl)) { + // For more details: https://github.com/bigbluebutton/bigbluebutton/blob/develop/record-and-playback/core/scripts/post_events/post_events_analytics_callback.rb + $createMeetingParams->addMeta('analytics-callback-url', $analyticsCallbackUrl); + $createMeetingParams->setMeetingKeepEvents(true); + } + $mac = $this->crypto->calculateHMAC($room->uid); $endMeetingUrl = $this->urlGenerator->linkToRouteAbsolute('bbb.hook.meetingEnded', ['token' => $room->uid, 'mac' => $mac]);