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>2020-11-03 11:49:15 +0300
committerJoas Schilling <coding@schilljs.com>2020-11-26 11:46:44 +0300
commitf4d0368d1442ccfdfbe0418d0eb860da66e6fbe8 (patch)
treecaabad2a98669fb467ed7e03f35055f8baa8c875 /lib/Service
parent02aa7650cbaa20356d9eaf6a37d8984bd76b750e (diff)
Generate a PIN for users when they join a room with SIP enabled
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r--lib/Service/ParticipantService.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php
index bdf1fe5b3..89923443b 100644
--- a/lib/Service/ParticipantService.php
+++ b/lib/Service/ParticipantService.php
@@ -279,6 +279,16 @@ class ParticipantService {
return new Participant($room, $attendee, null);
}
+ public function generatePinForParticipant(Room $room, Participant $participant): void {
+ $attendee = $participant->getAttendee();
+ if ($room->getSIPEnabled() === Webinary::SIP_ENABLED
+ && $this->talkConfig->isSIPConfigured()
+ && !$attendee->getPin()) {
+ $attendee->setPin($this->generatePin());
+ $this->attendeeMapper->update($attendee);
+ }
+ }
+
public function ensureOneToOneRoomIsFilled(Room $room): void {
if ($room->getType() !== Room::ONE_TO_ONE_CALL) {
return;