diff options
author | Joas Schilling <coding@schilljs.com> | 2022-04-29 10:13:45 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-05-03 10:38:35 +0300 |
commit | ec82ac391ae823f00b24d2fc0f16fac85529a849 (patch) | |
tree | fd86f7953a2397fe49895946949e800118dcedc9 /lib | |
parent | 5441b9c5459ee3425eded896dcfd2edf6e0d9d05 (diff) |
Add endpoint for the HPB to create guests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/RoomController.php | 24 |
1 files changed, 24 insertions, 0 deletions
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 |