Example #1
0
 public function join($id)
 {
     $room = Room::findOrFail($id);
     $access = roomController::checkAccess($room);
     if (!$access) {
         throw new Exception('Unauthorized');
     } else {
         if ($access == 1) {
             $pass = $room->mod_pass;
         } else {
             $pass = $room->att_pass;
         }
     }
     //check if meeting running and create if needed
     $bbb_id = bbbController::running($room);
     if (!$bbb_id) {
         $bbb_id = bbbController::create($room);
     }
     $user = Auth::user();
     //join meeting
     $bbb = new BigBlueButton($bbb_id);
     $params = array('meetingId' => $room->bbb_meeting_id, 'username' => $user->mail, 'userId' => '', 'webVoiceConf' => '', 'password' => $pass);
     try {
         $result = $bbb->getJoinMeetingURL($params);
     } catch (Exception $e) {
         throw new Exception($e->getMessage() . "\n");
     }
     return redirect($result);
 }