public function isMeetingRunning($meetingId = 1) { $bbb = new BigBlueButton($this->salt, $this->url); $itsAllGood = true; try { $result = $bbb->isMeetingRunningWithXmlResponseArray($meetingId); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } if ($itsAllGood == true) { return $result['running']; } }
function isMeetingRunning($meetingId, $USER) { $bbb = new BigBlueButton(); $itsAllGood = true; if ($meetingId == null) { // O chat é individual $meetingId = $USER->firstname; } try { $result = $bbb->isMeetingRunningWithXmlResponseArray($meetingId); } catch (Exception $e) { echo false; $itsAllGood = false; } if ($itsAllGood == true) { echo $result['running']; } }
<body id="joinifrunning" onload=""> <div id="main"> <h1>Attempting to Join...</h1> <?php /* _____ PHP Big Blue Button API Usage ______ * by Peter Mentzer peter@petermentzerdesign.com * Use, modify and distribute however you like. */ // Require the bbb-api file: require_once '../includes/bbb-api.php'; $bbb = new BigBlueButton(); $meetingId = '1234'; $itsAllGood = true; try { $result = $bbb->isMeetingRunningWithXmlResponseArray($meetingId); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } if ($itsAllGood == true) { //Output results to see what we're getting: //print_r($result); $status = $result['running']; //echo "<p style='color:red;'>".$status."</p>"; $holdMessage = ' <div id="status"> <p>Your meeting has not yet started. Waiting for a moderator to start the meeting...</p> <img src="../assets/ajax-loader.gif" alt="...contacting server..." /> <p>You will be connected as soon as the meeting starts.</p> </div>
$sql = "select user_name from room_user_moderator where room_id = " . $room_id; $rs = mssql_query($sql); $room_user_moderator = array(); while ($row = mssql_fetch_array($rs, MSSQL_ASSOC)) { $room_user_moderator[] = $row["user_name"]; } mssql_close($conn); // BigBlueButton $bbb = new BigBlueButton(); $infoParams = array('meetingId' => $room_id, 'password' => 'mp'); $room_status = false; $result = $bbb->getMeetingInfoWithXmlResponseArray($infoParams); if (!isset($result['messageKey'])) { $room_status = true; } $room_is_running = $bbb->isMeetingRunningWithXmlResponseArray($room_id); ?> <!DOCTYPE html> <!-- Template Name: Clip-One - Responsive Admin Template build with Twitter Bootstrap 3.x Version: 1.3 Author: ClipTheme --> <!--[if IE 8]><html class="ie8 no-js" lang="en"><![endif]--> <!--[if IE 9]><html class="ie9 no-js" lang="en"><![endif]--> <!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]--> <!-- start: HEAD --> <head> <title>ห้องประชุมเสมือน</title> <!-- start: META --> <meta charset="utf-8" /> <!--[if IE]><meta http-equiv='X-UA-Compatible' content="IE=edge,IE=9,IE=8,chrome=1" /><![endif]--> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
function bbb_session_running($meeting_id) { $res = Database::get()->querySingle("SELECT running_at FROM bbb_session WHERE meeting_id = ?s",$meeting_id); if (!isset($res->running_at)) { return false; } $running_server = $res->running_at; if (Database::get()->querySingle("SELECT count(*) as count FROM bbb_servers WHERE id=?d AND enabled='true'", $running_server)->count == 0) { //it means that the server is disabled so session must be recreated return false; } $res = Database::get()->querySingle("SELECT * FROM bbb_servers WHERE id=?d", $running_server); $salt = $res->server_key; $bbb_url = $res->api_url; if (!isset($salt) || !isset($bbb_url)) { return false; } // Instatiate the BBB class: $bbb = new BigBlueButton($salt,$bbb_url); // Get the URL to join meeting: $itsAllGood = true; try {$result = $bbb->isMeetingRunningWithXmlResponseArray($meeting_id);} catch (Exception $e) { //echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; return $itsAllGood; } if ((string) $result['running'] == 'false') { return false; } else { return true; } }
//$modx->log(xPDO::LOG_LEVEL_ERROR,'message from waitMeeting'); if (!($bbb = $modx->getService('bbb', 'bbb', $modx->getOption('bbb_core_path', null, $modx->getOption('core_path') . 'components/bbb/') . 'model/bbb/'))) { $modx->log(xPDO::LOG_LEVEL_ERROR, 'Ошибка! Не удается проинициализировать bbb.', '', 'waitMeeting', __FILE__, __LINE__); } $include_path = $modx->getOption('bbb_core_path', null, $modx->getOption('core_path') . 'components/bbb/') . 'includes/'; $ajaxloader_path = MODX_ASSETS_URL . 'components/bbb/'; require_once $include_path . 'bbb-api.php'; //Подключаем api BigBlueButton $bbb_server = new BigBlueButton(); $id_meeting = $modx->getOption('id_meeting', $_GET, ''); $id_client = $modx->getOption('id_client', $_GET, ''); $logonUrl = $modx->getOption('logonUrl', $_GET, ''); $itsAllGood = true; try { $result = $bbb_server->isMeetingRunningWithXmlResponseArray($id_meeting); } catch (Exception $e) { //echo 'Возникла ошибка: ', $e->getMessage(), "\n"; $modx->log(xPDO::LOG_LEVEL_ERROR, 'Ошибка! ' . $e->getMessage(), '', 'waitMeeting', __FILE__, __LINE__); $itsAllGood = false; } if ($itsAllGood == true) { $status = $result['running']; $holdMessage = ' <div id="status"> <p>Ваше мероприятие еще не началось. Пожалуйста, подождите пока ведущий начнет встречу...</p> <i class="fa fa-spinner fa-pulse fa-3x fa-fw margin-bottom"></i> <p>Вы автоматически войдете на мероприятие, как только оно начнется.</p> </div> '; // The meeting is not running yet so hold your horses:
<?php require_once 'bbb-api-php/includes/bbb-api.php'; $bbb = new BigBlueButton(); $room_is_running = $bbb->isMeetingRunningWithXmlResponseArray($_GET["room_id"]); $infoParams = array('meetingId' => $_GET["room_id"], 'password' => 'mp'); $room_status = 'false'; $result = $bbb->getMeetingInfoWithXmlResponseArray($infoParams); if (!isset($result['messageKey'])) { $room_status = 'true'; } echo '{"running":' . $room_is_running['running'] . ', "room_status": ' . $room_status . '}';