Ejemplo n.º 1
0
 protected static function create($room)
 {
     //create room to next available bbb
     do {
         $bbb = new BigBlueButton();
     } while (!$bbb->isUp());
     $record = 'false';
     if ($room->recording == 1) {
         $record = 'true';
     }
     $creationParams = array('meetingId' => $room->bbb_meeting_id, 'meetingName' => $room->name, 'attendeePw' => $room->att_pass, 'moderatorPw' => $room->mod_pass, 'logoutUrl' => URL::to('/'), 'record' => $record, 'dialNumber' => '', 'voiceBridge' => '', 'webVoice' => '', 'maxParticipants' => '', 'duration' => '', 'welcomeMsg' => '');
     $itsAllGood = true;
     try {
         $result = $bbb->createMeetingWithXmlResponseArray($creationParams);
     } catch (Exception $e) {
         $itsAllGood = false;
         throw new Exception($e->getMessage() . "\n");
     }
     if ($itsAllGood == true) {
         // If it's all good, then we've interfaced with our BBB php api OK:
         if ($result == null) {
             // If we get a null response, then we're not getting any XML back from BBB.
             return false;
         } else {
             // We got an XML response, so let's see what it says:
             if ($result['returncode'] == 'SUCCESS') {
                 //store meeting to db
                 $meeting = new Meeting();
                 $meeting->room = $room->id;
                 $meeting->bbb_server = $bbb->id;
                 $meeting->save();
                 return $bbb->id;
             } else {
                 return false;
             }
         }
     }
 }