Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-04-29 10:13:45 +0300
committerJoas Schilling <coding@schilljs.com>2022-05-03 10:38:35 +0300
commitec82ac391ae823f00b24d2fc0f16fac85529a849 (patch)
treefd86f7953a2397fe49895946949e800118dcedc9
parent5441b9c5459ee3425eded896dcfd2edf6e0d9d05 (diff)
Add endpoint for the HPB to create guests
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--appinfo/routes/routesRoomController.php2
-rw-r--r--lib/Controller/RoomController.php24
2 files changed, 26 insertions, 0 deletions
diff --git a/appinfo/routes/routesRoomController.php b/appinfo/routes/routesRoomController.php
index e065a39bc..5867d6be5 100644
--- a/appinfo/routes/routesRoomController.php
+++ b/appinfo/routes/routesRoomController.php
@@ -92,6 +92,8 @@ return [
['name' => 'Room#getParticipantByDialInPin', 'url' => '/api/{apiVersion}/room/{token}/pin/{pin}', 'verb' => 'GET', 'requirements' => array_merge($requirementsWithToken, [
'pin' => '^\d{7,32}$',
])],
+ /** @see \OCA\Talk\Controller\RoomController::createGuestByDialIn() */
+ ['name' => 'Room#createGuestByDialIn', 'url' => '/api/{apiVersion}/room/{token}/open-dial-in', 'verb' => 'POST', 'requirements' => $requirementsWithToken],
/** @see \OCA\Talk\Controller\RoomController::setNotificationLevel() */
['name' => 'Room#setNotificationLevel', 'url' => '/api/{apiVersion}/room/{token}/notify', 'verb' => 'POST', 'requirements' => $requirementsWithToken],
/** @see \OCA\Talk\Controller\RoomController::setNotificationCalls() */
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index ec1cb189c..fd11f8ad9 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -1422,6 +1422,30 @@ class RoomController extends AEnvironmentAwareController {
/**
* @PublicPage
+ * @RequireRoom
+ *
+ * @return DataResponse
+ */
+ public function createGuestByDialIn(): DataResponse {
+ try {
+ if (!$this->validateSIPBridgeRequest($this->room->getToken())) {
+ return new DataResponse([], Http::STATUS_UNAUTHORIZED);
+ }
+ } catch (UnauthorizedException $e) {
+ return new DataResponse([], Http::STATUS_UNAUTHORIZED);
+ }
+
+ if ($this->room->getSIPEnabled() !== Webinary::SIP_ENABLED_NO_PIN) {
+ return new DataResponse([], Http::STATUS_BAD_REQUEST);
+ }
+
+ $participant = $this->participantService->joinRoomAsNewGuest($this->roomService, $this->room, '', true);
+
+ return new DataResponse($this->formatRoom($this->room, $participant));
+ }
+
+ /**
+ * @PublicPage
* @UseSession
*
* @param string $token