/** * Given an ID of an instance of this module, * this function will permanently delete the instance * and any data that depends on it. * * @param int $id Id of the module instance * @return boolean Success/Failure */ function bigbluebutton_delete_instance($id) { global $CFG, $DB; if (!($bigbluebutton = $DB->get_record('bigbluebutton', array('id' => $id)))) { return false; } $result = true; // // End the session associated with this instance (if it's running) // $meetingID = $bigbluebutton->meetingid; $modPW = $bigbluebutton->moderatorpass; $url = trim(trim($CFG->BigBlueButtonServerURL), '/') . '/'; $salt = trim($CFG->BigBlueButtonSecuritySalt); $getArray = BigBlueButton::endMeeting($meetingID, $modPW, $url, $salt); if (!$DB->delete_records('bigbluebutton', array('id' => $bigbluebutton->id))) { $result = false; } return $result; }
/** * Given an ID of an instance of this module, * this function will permanently delete the instance * and any data that depends on it. * * @param int $id Id of the module instance * @return boolean Success/Failure */ function bigbluebutton_delete_instance($id) { global $CFG; if (!($bigbluebutton = get_record('bigbluebutton', 'id', $id))) { return false; } $result = true; // // End the session associated with this instance (if it's running) // $meetingID = $bigbluebutton->meetingid; $modPW = $bigbluebutton->moderatorpass; $url = trim(trim($CFG->BigBlueButtonServerURL), '/') . '/'; $salt = trim($CFG->BigBlueButtonSecuritySalt); $getArray = BigBlueButton::endMeeting($meetingID, $modPW, $url, $salt); if (!delete_records('bigbluebutton', 'id', $bigbluebutton->id)) { //echo $endURL = '<a href='.BBBMeeting::endMeeting( $mToken, "mp", getBBBServerIP(), $salt ).'>'."End Meeting".'</a>'; #switch to remove the meetingname # BBBMeeting::endMeeting( $bigbluebutton->, "mp", getBBBServerIP(), $bigbluebutton->salt ); $result = false; } return $result; }
<?php require "config_db.php"; require_once 'bbb-api-php/includes/bbb-api.php'; if (!isset($_SESSION["user_name"])) { header('Location: ' . $url_login); exit; } $conn = ConnectDB(); $sql = "select personal_fname_tha, personal_lname_tha from view_user_ad where user_name = '" . $_SESSION["user_name"] . "'"; $res = mssql_query($sql); $user = mssql_fetch_array($res, MSSQL_ASSOC); mssql_close($conn); $bbb = new BigBlueButton(); $joinParams = array('meetingId' => $_GET["room_id"], 'username' => iconv('ISO-8859-11', 'UTF-8', $user["personal_fname_tha"] . " " . $user["personal_lname_tha"]), 'password' => 'mp', 'createTime' => '', 'userId' => '', 'webVoiceConf' => ''); // Get the URL to join meeting: $itsAllGood = true; try { $result = $bbb->getJoinMeetingURL($joinParams); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } if ($itsAllGood == true) { header('Location: ' . $result); }
function joinAsModerator($meetingId, $userName) { // Instatiate the BBB class: $bbb = new BigBlueButton(); /* ___________ JOIN MEETING w/ OPTIONS ______ */ /* Determine the meeting to join via meetingId and join it. */ $joinParams = array('meetingId' => $meetingId, 'username' => $userName, 'password' => 'mp', 'createTime' => '', 'userId' => '', 'webVoiceConf' => ''); // Get the URL to join meeting: $itsAllGood = true; try { $result = $bbb->getJoinMeetingURL($joinParams); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } if ($itsAllGood == true) { //Output results to see what we're getting: echo $result; } }
<?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'; // Instatiate the BBB class: $bbb = new BigBlueButton(); /* ___________ PUBLISH RECORDINGS ______ */ /* Pass a recordId and true/false to publish or unpublish a recording. */ $recordingParams = array('recordId' => '8cb2237d0679ca88db6464eac60da96345513964-1333379469215', 'publish' => 'true'); // Now do it: $itsAllGood = true; try { $result = $bbb->publishRecordingsWithXmlResponseArray($recordingParams); } 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); }
} //$modx->log(xPDO::LOG_LEVEL_ERROR,print_r($scriptProperties,true)); $include_path = $modx->getOption('bbb_core_path', null, $modx->getOption('core_path') . 'components/bbb/') . 'includes/'; $tpl = $modx->getOption('tpl', $scriptProperties, null, true); $id_meeting = $modx->getOption('id_meeting', $scriptProperties, null, true); $moderatorPw = $modx->getOption('moderatorPw', $scriptProperties, null, true); if ($meeting = $modx->getObject('Meetings', array('id_meeting' => $id_meeting))) { if ($meeting->get('moderatorPw') != $moderatorPw) { $modx->log(xPDO::LOG_LEVEL_ERROR, 'Ошибка! Указан неверный пароль модератора для встречи'); return '*'; return false; } return '#'; require_once $include_path . 'bbb-api.php'; //Подключаем api BigBlueButton $bbb_server = new BigBlueButton(); $itsAllGood = true; try { $answer = $bbb_server->getMeetingInfoWithXmlResponseArray(array('meetingId' => $id_meeting, 'password' => $moderatorPw)); } catch (Exception $e) { $modx->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage()); $itsAllGood = false; return false; } if ($itsAllGood == true) { if ($answer == null) { // Если в ответ получен null, то возможно не откликается сервер BBB $modx->log(xPDO::LOG_LEVEL_ERROR, 'Не получен никакой ответ от сервера BBB в ответ на getMeetingInfoWithXmlResponseArray, Возможно, нет соединения с сервером BBB '); return false; } else { // We got an XML response, so let's see what it says:
* Если передан третий параметр, то ссылка формируется по особому: ссылаемся на страницу id_waitpage * и дополнительными get-параметрами передаем id_meeting, id_client и logonUrl * Если же id_waitpage не передан, сниппет возвращает прямую ссылку на вход мероприятия id_meeting для контакта id_client */ 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.', '', 'getJoinMeetingUrl', __FILE__, __LINE__); } //$modx->log(xPDO::LOG_LEVEL_ERROR,print_r($scriptProperties,true)); $include_path = $modx->getOption('bbb_core_path', null, $modx->getOption('core_path') . 'components/bbb/') . 'includes/'; $id_meeting = $modx->getOption('id_meeting', $scriptProperties, null, true); $id_client = $modx->getOption('id_client', $scriptProperties, null, true); $user_type = $modx->getOption('user_type', $scriptProperties, 'attendee', true); $id_waitpage = $modx->getOption('id_waitpage', $scriptProperties, null, false); require_once $include_path . 'bbb-api.php'; //Подключаем api BigBlueButton $bbb_server = new BigBlueButton(); if ($meeting = $modx->getObject('Meetings', array('id_meeting' => $id_meeting))) { $client = $modx->getObject('Clients', array('id_client' => $id_client)); $joinParams = array('meetingId' => $meeting->get('id_meeting'), 'username' => $client->get('firstname') . ' ' . $client->get('lastname'), 'createTime' => '', 'userId' => $id_client, 'webVoiceConf' => ''); if ($user_type == 'moderator') { $joinParams['password'] = $meeting->get('moderatorPw'); } else { $joinParams['password'] = $meeting->get('attendeePw'); } $itsAllGood = true; try { $logonUrl = $bbb_server->getJoinMeetingURL($joinParams); } catch (Exception $e) { $logonUrl = ''; $modx->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage(), '', 'getJoinMeetingUrl', __FILE__, __LINE__); $itsAllGood = false;
public function getJoinMeetingURL_proxy($joinParams, $joinUrl = null) { /* NOTE: At this point, we don't use a corresponding joinMeetingWithXmlResponse here because the API doesn't respond on success, but you can still code that method if you need it. Or, you can take the URL that's returned from this method and simply send your users off to that URL in your code. USAGE: $joinParams = array( 'meetingId' => '1234', -- REQUIRED - A unique id for the meeting 'username' => 'Jane Doe', -- REQUIRED - The name that will display for the user in the meeting 'password' => 'ap', -- REQUIRED - The attendee or moderator password, depending on what's passed here 'createTime' => '', -- OPTIONAL - string. Leave blank ('') unless you set this correctly. 'userID' => '', -- OPTIONAL - string 'webVoiceConf' => '' -- OPTIONAL - string ); */ global $CFG; $this->_meetingId = $this->_requiredParam($joinParams['meetingId'], 'meetingId'); $this->_username = $this->_requiredParam($joinParams['username'], 'username'); $this->_password = $this->_requiredParam($joinParams['password'], 'password'); // Establish the basic join URL: if (!$joinUrl || !$this->TpeSettings->EnableProxyBalance) { $joinUrl = $this->_bbbServerBaseUrl . "api/join?"; } // Add parameters to the URL: //datnv if ($joinParams['userdata-roomTypeOrigin'] != 'ROOM') { // //tao lop // $creationParams['meetingId']='213076'; // $creationParams['meetingName']='213076'; // $this->getCreateMeetingUrl($creationParams); $settings = get_config('local_tpebbb'); if ($SecuritySalt === null) { $SecuritySalt = $settings->SecuritySalt; } if ($ServerBBBURL === null) { $ServerBBBURL = $settings->ServerBBBURL; } $ServerBBBURL = $CFG->NAF2; $this->_securitySalt = $SecuritySalt; $this->_bbbServerBaseUrl = $ServerBBBURL; $this->TpeSettings = $settings; $this->processConfigValue(); parent::__construct($SecuritySalt, $ServerBBBURL); $joinUrl = $this->_bbbServerBaseUrl . "api/join?"; } //end datnv $params = 'meetingID=' . urlencode($this->_meetingId) . '&fullName=' . urlencode($this->_username) . '&password='******'&userID=' . urlencode($joinParams['userId']) . '&webVoiceConf=' . urlencode($joinParams['webVoiceConf']); // Only use createTime if we really want to use it. If it's '', then don't pass it: if (isset($joinParams['createTime']) && $joinParams['createTime'] != '') { $params .= '&createTime=' . urlencode($joinParams['createTime']); } foreach ($joinParams as $key => $value) { if (strpos($key, "userdata-") !== false) { $params .= "&" . $key . "=" . urlencode($value); } } // Return the URL: return $joinUrl . $params . '&checksum=' . sha1("join" . $params . $this->_securitySalt); }
<?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'; // Instatiate the BBB class: $bbb = new BigBlueButton(); /* ___________ IS MEETING RUNNING? ______ */ /* Pass a meetingId to see if the meeting is currently running. */ $meetingId = '1234'; // Get the URL to join meeting: $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); }
?> "; } } </script> <?php } else { // // Join as Viewer, no wait check // print "<br />" . get_string('view_login_viewer', 'bigbluebutton') . "<br /><br />"; print "<center><img src='loading.gif' /></center>"; $response = BigBlueButton::createMeetingArray("", $bigbluebutton->meetingid, "", $modPW, $viewerPW, $salt, $url, $logoutURL); if (!$response) { // If the server is unreachable, then prompts the user of the necessary action error('Unable to join the meeting. Please contact your administrator.'); } if ($response['returncode'] == "FAILED") { // The meeting was not created if ($response['messageKey'] == "checksumError") { error(get_string('index_checksum_error', 'bigbluebutton')); } else { error($response['message']); } } $joinURL = BigBlueButton::joinURL($bigbluebutton->meetingid, $username, $viewerPW, $salt, $url, $userID); redirect($joinURL); } } // Finish the page print_footer($course);
$response = BigBlueButton::createMeetingArray($_REQUEST['username'], $meetingID, null, $meeting['moderatorPW'], $meeting['attendeePW'], $salt, $url, "http://bigbluebutton.org"); //Analyzes the bigbluebutton server's response if (!$response) { //If the server is unreachable $msg = 'Unable to join the meeting. Please check the url of the bigbluebutton server AND check to see if the bigbluebutton server is running.'; } else { if ($response['returncode'] == 'FAILED') { //The meeting was not created if ($response['messageKey'] == 'checksumError') { $msg = 'A checksum error occured. Make sure you entered the correct salt.'; } else { $msg = $response['message']; } } else { //The meeting was created, and the user will now be joined $bbb_joinURL = BigBlueButton::joinURL($meetingID, $_REQUEST['username'], $password, $salt, $url); ?> <script type="text/javascript"> window.location = "<?php echo $bbb_joinURL; ?> ";</script><?php return; } } } else { $msg = 'Incorrect Password'; } } else { if ($_REQUEST['action'] == 'Join') { $msg = "All fields need to be filled"; }
public function getRecordingsUrl($meetingId = null) { $bbb = new BigBlueButton($this->salt, $this->url); $recordingParams = array('meetingId' => $meetingId); $itsAllGood = true; try { $result = $bbb->getRecordingsUrl($recordingParams); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } if ($itsAllGood == true) { print_r($result); } }
$viewerList = "-"; $moderatorList = "-"; // print_object( $bigbluebutton ); if (!$bigbluebutton->visible) { // Nothing to do } else { $modPW = get_field('bigbluebutton', 'moderatorpass', 'name', $bigbluebutton->name); $attPW = get_field('bigbluebutton', 'viewerpass', 'name', $bigbluebutton->name); // print "## $modPW ##"; $joinURL = '<a href="view.php?id=' . $bigbluebutton->coursemodule . '">' . format_string($bigbluebutton->name) . '</a>'; // $status = $bigbluebutton->meetingid; //echo "XX"; // // Output Users in the meeting // $getArray = BigBlueButton::getMeetingInfoArray($bigbluebutton->meetingid, $modPW, $url, $salt); // print_object( $getArray ); if (!$getArray) { // // The server was unreachable // error(get_string('index_unable_display', 'bigbluebutton')); return; } if (isset($getArray['messageKey'])) { // // There was an error returned // if ($info['messageKey'] == "checksumError") { error(get_string('index_checksum_error', 'bigbluebutton')); return;
//print "<br />".get_string('view_login_viewer', 'livewebteaching' )."<br /><br />"; //print "<center><img src='loading.gif' /></center>"; $response = BigBlueButton::createMeetingArray("", $livewebteaching->meetingid, $welcome_text, $modPW, $viewerPW, $salt, $url, $logoutURL); if (!$response) { // If the server is unreachable, then prompts the user of the necessary action error('Unable to join the live session. Please contact your administrator.'); } if ($response['returncode'] == "FAILED") { // The meeting was not created if ($response['messageKey'] == "checksumError") { error(get_string('index_checksum_error', 'livewebteaching')); } else { error($response['message']); } } $joinURL = BigBlueButton::joinURL($livewebteaching->meetingid, $username, $viewerPW, $salt, $url, $userID); ?> <iframe src ="<?php echo $joinURL; ?> " width="100%" height="100%" style="position: absolute: bottom: 0px; border: 0px;overflow:hidden;"></iframe> <?php } } ?> </div> <div id="footer_wcr_v3"> <span style="float: right; margin-top: 15px; margin-right: 10px; font-family: 'Trebuchet MS';">Powered by <a style="color: #fff;" href="http://www.livewebteaching.com" target="_blank">LiveWebTeaching.com</a></span> </div> </body>
/** * @brief get number of meeting users * @global type $langBBBGetUsersError * @global type $langBBBConnectionError * @param type $salt * @param type $bbb_url * @param type $meeting_id * @param type $pw * @return type */ function get_meeting_users($salt,$bbb_url,$meeting_id,$pw) { global $langBBBGetUsersError, $langBBBConnectionError; // Instatiate the BBB class: $bbb = new BigBlueButton($salt,$bbb_url); $infoParams = array( 'meetingId' => $meeting_id, // REQUIRED - We have to know which meeting. 'password' => $pw, // REQUIRED - Must match moderator pass for meeting. ); // Now get meeting info and display it: $result = $bbb->getMeetingInfoWithXmlResponseArray($bbb,$bbb_url,$salt,$infoParams); // 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. echo "<div class='alert-danger'>$langBBBConnectionError</div>"; } else { // We got an XML response, so let's see what it says: if (!isset($result['messageKey'])) { } else { echo "<div class='alert alert-danger'>$langBBBGetUsersError.</div>"; exit; } } return (int)$result['participantCount']; }
$sql .= "select user_name from room_user_moderator where room_id =" . $room_id . ")"; $rs = mssql_query($sql); $moderator = array(); while ($row = mssql_fetch_array($rs, MSSQL_ASSOC)) { $moderator[] = $row["PERSONAL_FNAME_THA"] . " " . $row["PERSONAL_LNAME_THA"]; } $moderator = join(", ", $moderator); $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]-->
public function getInformation( $IDENTIFIER, $meetingID, $modPW, $URL, $SALT ) { // if the identifier is null or '', then return false if( $IDENTIFIER == "" || $IDENTIFIER == null ) { echo "You need to type in a valid value into the identifier."; return false; } // if the identifier is attendee, call getUsers else if( $IDENTIFIER == 'attendee' ) { return BigBlueButton::getUsers( $meetingID, $modPW, $URL, $SALT ); } // if the identifier is meetings, call getMeetings else if( $IDENTIFIER == 'meetings' ) { return BigBlueButton::getMeetings( $URL, $SALT ); } // return nothing else { return true; } }
function getUrl($idConference, $room_type) { $lang =& DoceboLanguage::createInstance('conference', 'lms'); $conf = new Conference_Manager(); $conference = $conf->roomInfo($idConference); $acl_manager =& Docebo::user()->getAclManager(); $username = Docebo::user()->getUserName(); $u_info = $acl_manager->getUser(getLogUserId(), false); $user_email = $u_info[ACL_INFO_EMAIL]; $query2 = "SELECT * FROM " . $this->_getRoomTable() . " WHERE idConference = '" . $idConference . "'"; $re_room = $this->_query($query2); $room = $this->nextRow($re_room); if ($room["audiovideosettings"] == 0) { $av = "audio"; } else { $av = "av"; } $exit_url = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"] . "?modname=conference&op=list"; $clientId = ""; /*$res = $this->api_join_meeting(); if ($res && $res->result) { $clientId = ""; }*/ $name = $this->getRoomName($idConference); $url = Get::sett('bbb_server', ""); $salt = Get::sett('bbb_salt', ""); $moderator_password = Get::sett('bbb_password_moderator', ""); $viewer_password = Get::sett('bbb_password_viewer', ""); $response = BigBlueButton::createMeetingArray($username, $name, null, $moderator_password, $viewer_password, $salt, $url, $returnurl); if (checkPerm('mod', true)) { $password = $moderator_password; } else { $password = $viewer_password; } if (!$response) { //If the server is unreachable $msg = 'Unable to join the meeting. Please check the url of the video conference server AND check to see if the video conference server is running.'; } else { if ($response['returncode'] == 'FAILED') { //The meeting was not created if ($response['messageKey'] == 'checksumError') { $msg = 'A checksum error occured. Make sure you entered the correct salt.'; } else { $msg = $response['message']; } } else { $_url = BigBlueButton::joinURL($name, $username, $password, $salt, $url); } } //////////////////////////////////////////////////// $url = '<a onclick="window.open(this.href, \'\', \'\');return false;" href="' . str_replace('&', '&', $_url) . '">' . $lang->def('_JOIN_CONFERENCE') . '</a>'; return $url; }
} </script> </head> <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">
<th>วันทีสิ้นสุด</th> <th>ใชัเวลา</th> <th>บันทึกการประชุม</th> <?php if ($_SESSION["role"] == "ROLE-002") { ?> <th>#</th> <?php } ?> </tr> </thead> <tbody> <?php require_once 'bbb-api-php/includes/bbb-api.php'; $bbb = new BigBlueButton(); $recordingsParams = array('meetingId' => $_GET["room_id"]); $itsAllGood = true; try { $result = $bbb->getRecordingsWithXmlResponseArray($recordingsParams); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } if ($itsAllGood == true) { if ($result == null) { echo "Failed to get any response. Maybe we can't contact the BBB server."; } else { if ($result['returncode'] == 'SUCCESS') { foreach ($result as $key => $value) { if ($value["recordId"] != null) {
$response = BigBlueButton::createMeetingArray($username,$meetingID,$bbb_welcome, $_moderatorPassword,$_attendeePassword, $salt, $url,$_logoutUrl); //Analyzes the bigbluebutton server's response if(!$response){//If the server is unreachable $msg->addError("UNABLE_TO_CONNECT_TO_BBB"); } else if( $response['returncode'] == 'FAILED' ) { //The meeting was not created if($response['messageKey'] == 'checksumError'){ $msg->addError("CHECKSUM_ERROR_BBB"); } else{ $msg = $response['message']; } } else{//"The meeting was created, and the user will now be joined " $bbb_joinURL = BigBlueButton::joinURL($meetingID,$username,"ap", $salt, $url); } $sql = "SELECT * from ".TABLE_PREFIX."bigbluebutton WHERE course_id = '$meetingID'"; $result = mysql_query($sql, $db); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_assoc($result)) { /**** * SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY are defined in include/lib/constance.lib.inc * SUBLINK_TEXT_LEN determins the maxium length of the string to be displayed on "detail view" box. *****/ $list[] = '<a href="'.$bbb_joinURL.'"'. (strlen(htmlentities_utf8($row['message'])) > SUBLINK_TEXT_LEN ? ' title="'.htmlentities_utf8($row['course_timing']).'"' : '') .' title="'.htmlentities_utf8($row['course_timing']).'">'. validate_length(htmlentities_utf8($row['message']), SUBLINK_TEXT_LEN, VALIDATE_LENGTH_FOR_DISPLAY) .'</a>';
<?php require "config_db.php"; require_once 'bbb-api-php/includes/bbb-api.php'; if (!isset($_SESSION["user_name"])) { header('Location: ' . $url_login); exit; } $bbb = new BigBlueButton(); $conn = ConnectDB(); $search = ""; if (isset($_GET["q"])) { $_GET["q"] = trim($_GET['q']); $search = " and name like '%" . iconv('UTF-8', 'ISO-8859-11', $_GET["q"]) . "%' "; } $page = (isset($_GET["page"]) and $_GET["page"] != "") ? intval($_GET["page"]) : 1; $per_page = 6; $start_ = 1; $end_ = $per_page; if ($page > 1) { $start_ = ($page - 1) * $per_page + 1; $end_ = $start_ + $per_page - 1; } if ($_SESSION["role"] == "ROLE-002") { $sql_count = "select count(*) as n from room where deleted = '0' " . $search; $sql = "select *, ROW_NUMBER() OVER(ORDER BY sticky desc, sticky_at desc, created_at desc) as row_n from room where deleted = '0' " . $search; $sql = "select * from ({$sql}) as tb where row_n between {$start_} and {$end_}"; } else { $sql_count = $sql = "select count(*) as n from room where room.id in (select distinct room_id from room_user where user_name = '" . $_SESSION["user_name"] . "') and deleted = '0' " . $search; $sql = "select *, ROW_NUMBER() OVER(ORDER BY sticky desc, sticky_at desc, created_at desc) as row_n from room where room.id in (select distinct room_id from room_user where user_name = '" . $_SESSION["user_name"] . "') and deleted = '0' " . $search; $sql = "select * from ({$sql}) as tb where row_n between {$start_} and {$end_}";
$response = BigBlueButton::createMeetingArray($username, $meetingID, null, "mp", "ap", $salt, $url, "http://bigbluebutton.org"); //Analyzes the bigbluebutton server's response if (!$response) { //If the server is unreachable $msg = 'Unable to join the meeting. Please check the url of the bigbluebutton server AND check to see if the bigbluebutton server is running.'; } else { if ($response['returncode'] == 'FAILED') { //The meeting was not created if ($response['messageKey'] == 'checksumError') { $msg = 'A checksum error occured. Make sure you entered the correct salt.'; } else { $msg = $response['message']; } } else { //The meeting was created, and the user will now be joined $bbb_joinURL = BigBlueButton::joinURL($meetingID, $username, $response['moderatorPW'], $salt, $url); ?> <script type="text/javascript"> window.location = "<?php echo $bbb_joinURL; ?> ";</script><?php return; } } } else { if ($_REQUEST['action'] == 'Join') { $msg = "All fields need to be filled"; } } include 'demo_header.php'; ?>
<?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'; // Instatiate the BBB class: $bbb = new BigBlueButton(); /* ___________ END A MEETING ______ */ /* Determine the meeting to end via meetingId and end it. */ $endParams = array('meetingId' => '1234', 'password' => 'mp'); // Get the URL to end a meeting: $itsAllGood = true; try { $result = $bbb->endMeetingWithXmlResponseArray($endParams); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } 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. echo "Failed to get any response. Maybe we can't contact the BBB server."; } else { // We got an XML response, so let's see what it says: print_r($result); if ($result['returncode'] == 'SUCCESS') {
/** * Ends a meeting */ function end() { //get the meeting $id = JRequest::getVar('id'); $query = ' SELECT * FROM #__bbb WHERE id =' . $id; $db =& JFactory::getDBO(); $db->setQuery($query); $meeting = $db->loadObject(); if (!$meeting || $meeting == null) { $msg = "This meeting no longer exists."; $this->setRedirect('index.php?option=com_bigbluebuttonconferencing', $msg); } // This is the security salt that must match the value set in the BigBlueButton server // This is the URL for the BigBlueButton server $row =& JTable::getInstance('settings', 'Table'); $row->load(1); $row->name == 'salt' ? $salt = $row->varValue : ($url = $row->varValue); $row->load(2); $row->name == 'salt' ? $salt = $row->varValue : ($url = $row->varValue); if (!$salt || $salt == '' || !$url || $url == '') { $msg = "You have to fill out the salt and url in the settings menu before you can delete a meeting."; $this->setRedirect('index.php?option=com_bigbluebuttonconferencing', $msg); return; } $response = BigBlueButton::endMeeting($meeting->meetingName . "[" . $meeting->meetingVersion . "]", $meeting->moderatorPW, $url, $salt); //Analyzes the bigbluebutton server's response if (!$response) { //If the server is unreachable, then prompts the user of the necessary action $msg = "Unable to join the meeting. Please check the url of the bigbluebutton server AND check to see if the bigbluebutton server is running."; $this->setRedirect('index.php?option=com_bigbluebuttonconferencing', $msg); } else { if ($response['returncode'] == 'FAILED') { //The meeting was not created if ($response['messageKey'] == 'checksumError') { $msg = "A checksum error occured. Make sure you entered the correct salt."; } else { $msg = $response['message']; } $this->setRedirect('index.php?option=com_bigbluebuttonconferencing', $msg); } else { //The meeting was created, and the user will now be joined $msg = $meeting->meetingName . " has been terminated."; $this->setRedirect('index.php?option=com_bigbluebuttonconferencing', $msg); } } }
<?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'; // Instatiate the BBB class: $bbb = new BigBlueButton(); /* ___________ CREATE MEETING w/ OPTIONS ______ */ /* */ $creationParams = array('meetingId' => '12345', 'meetingName' => 'Test Recorded Meeting Name', 'attendeePw' => 'ap', 'moderatorPw' => 'mp', 'welcomeMsg' => '', 'dialNumber' => '', 'voiceBridge' => '', 'webVoice' => '', 'logoutUrl' => '', 'maxParticipants' => '-1', 'record' => 'true', 'duration' => '5'); // Create the meeting and get back a response: $itsAllGood = true; try { $result = $bbb->createMeetingWithXmlResponseArray($creationParams); } catch (Exception $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; $itsAllGood = false; } 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. echo "Failed to get any response. Maybe we can't contact the BBB server."; } else { // We got an XML response, so let's see what it says: print_r($result); if ($result['returncode'] == 'SUCCESS') {
function join($params) { $meetingName = JRequest::getVar('meetingName'); $name = JRequest::getVar('display_name'); $pwd = JRequest::getVar('pwd'); $query = "SELECT * FROM #__bbb WHERE meetingName ='" . $meetingName . "'"; $db =& JFactory::getDBO(); $db->setQuery($query); $meeting = $db->loadObject(); if (!$meeting || $meeting == null) { $msg['message'] = "This meeting no longer exists."; return $msg; } if ($meeting->moderatorPW != $pwd && $meeting->attendeePW != $pwd) { $msg['message'] = "Incorrect Password."; return $msg; } // This is the security salt that must match the value set in the BigBlueButton server // This is the URL for the BigBlueButton server $query = "SELECT * FROM #__bbb_settings WHERE name = 'salt'"; $db->setQuery($query); $salt = $db->loadObject(); $query = "SELECT * FROM #__bbb_settings WHERE name = 'url'"; $db->setQuery($query); $url = $db->loadObject(); if (!$salt || $salt->varValue == '' || !$url || $url->varValue == '') { $msg['message'] = "You have to fill out the salt and url in the settings menu before you can join a meeting."; return $msg; } for (;;) { $response = BigBlueButton::createMeetingArray($name, $meeting->meetingName . "[" . $meeting->meetingVersion . "]", 'Welcome to ' . $meeting->meetingName . '.', $meeting->moderatorPW, $meeting->attendeePW, $salt->varValue, $url->varValue, JURI::base()); //Analyzes the bigbluebutton server's response if (!$response) { //If the server is unreachable, then prompts the user of the necessary action $msg['message'] = "Unable to join the meeting. Please check the url of the bigbluebutton server AND check to see if the bigbluebutton server is running."; return $msg; } else { if ($response['returncode'] == 'FAILED' && $response['messageKey'] != 'idNotUnique') { //The meeting was not created if ($response['messageKey'] == 'checksumError') { $msg['message'] = "A checksum error occured. Make sure you entered the correct salt."; } else { $msg['message'] = $response['message']; } return $msg; } else { if ($response['messageKey'] == 'idNotUnique' || $response['hasBeenForciblyEnded'] == 'true') { $meeting->meetingVersion = time(); $db->updateObject('#__bbb', $meeting, 'id', false); if ($db->getErrorNum()) { $msg['message'] = $db->getErrorMsg(); return $msg; } } else { //The meeting was created, and the user will now be joined $bbb_joinURL = BigBlueButton::joinURL($meeting->meetingName . "[" . $meeting->meetingVersion . "]", $name, $pwd, $salt->varValue, $url->varValue); if ($meeting->waitForModerator == 'yes' && $meeting->moderatorPW != $pwd && !BigBlueButton::isMeetingRunning($meeting->meetingName . "[" . $meeting->meetingVersion . "]", $url->varValue, $salt->varValue)) { $msg['message'] = "redirect"; $msg['bbb_joinURL'] = $bbb_joinURL; $msg['name'] = $name; //$msg['meetingID'] = urlencode($meeting->meetingName."[".$meeting->meetingVersion."]"); $msg['meetingID'] = BigBlueButton::isMeetingRunningURL($meeting->meetingName . "[" . $meeting->meetingVersion . "]", $url->varValue, $salt->varValue); return $msg; } ?> <script type="text/javascript"> window.location = "<?php echo $bbb_joinURL; ?> ";</script><?php return; } } } } }
<?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'; // Instatiate the BBB class: $bbb = new BigBlueButton(); /* ___________ DELETE RECORDINGS ______ */ /* Pass a recordId to delete a recording. */ $recordingParams = array('recordId' => '8cb2237d0679ca88db6464eac60da96345513964-1333379469215'); // Delete the meeting: $itsAllGood = true; try { $result = $bbb->deleteRecordingsWithXmlResponseArray($recordingParams); } 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); }
* * @copyright 2011 Victor Bautista (victor [at] sinkia [dt] com) * @package mod_livewebteaching * * This file is free software: you may copy, redistribute and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 2 of the License, or any later version. * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * This file incorporates work covered by the following copyright and permission notice: * Authors: * Fred Dixon (ffdixon [at] blindsidenetworks [dt] org) * * @copyright 2010 Blindside Networks * * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later */ require_once "../../config.php"; require_once "lib.php"; $name = $_GET['name']; $salt = trim($CFG->lwt_apikey); $url = trim(trim($CFG->lwt_server), '/') . '/'; echo BigBlueButton::getMeetingXML($name, $url, $salt);
but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Versions: 1.0 -- Initial version written by Sebastian Schneider (email : seb DOT sschneider [ a t ] g m ail DOT com) 1.1 -- Updated by Omar Shammas (email : omar DOT shammas [a t ] g m ail DOT com) */ //================================================================================ //------------------Required Libraries and Global Variables----------------------- //================================================================================ require 'bbb_api.php'; session_start(); $url_name = 'mt_bbb_url'; $salt_name = 'mt_salt'; $meetingID_name = 'meetingID'; //================================================================================ //------------------------------------Main---------------------------------------- //================================================================================ echo '<?xml version="1.0"?>' . "\r\n"; //Retrieves the bigbluebutton url, and salt from the seesion $salt_val = $_SESSION[$salt_name]; $url_val = $_SESSION[$url_name]; $meetingID = $_GET[$meetingID_name]; //Calls getMeetingXML and returns returns the result echo BigBlueButton::getMeetingXML($meetingID, $url_val, $salt_val);