Permalink
Browse files

Merge pull request #33 from jfederico/master

Added php library contributed by Peter Mentzer
  • Loading branch information...
2 parents 3aada13 + 485155b commit 6077496df741b4b99c2d199f31a9441d9f3dc386 @ritzalam ritzalam committed Apr 5, 2012
Showing with 1,476 additions and 0 deletions.
  1. +2 −0 labs/{bbb-api-php/Read Me.txt → bbb-api-php-legacy/README}
  2. 0 labs/{bbb-api-php → bbb-api-php-legacy}/bbb_api.php
  3. 0 labs/{bbb-api-php → bbb-api-php-legacy}/bbb_api_conf.php
  4. 0 labs/{bbb-api-php → bbb-api-php-legacy}/check.php
  5. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo1.php
  6. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo2.php
  7. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo3.php
  8. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo4.js
  9. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo4.php
  10. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo4_helper.php
  11. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo5.php
  12. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo_footer.php
  13. 0 labs/{bbb-api-php → bbb-api-php-legacy}/demo_header.php
  14. 0 labs/{bbb-api-php → bbb-api-php-legacy}/heartbeat.js
  15. 0 labs/{bbb-api-php → bbb-api-php-legacy}/jquery.js
  16. 0 labs/{bbb-api-php → bbb-api-php-legacy}/jquery.xml2json.js
  17. 0 labs/{bbb-api-php → bbb-api-php-legacy}/md5.js
  18. BIN labs/{bbb-api-php → bbb-api-php-legacy}/polling.gif
  19. +8 −0 labs/bbb-api-php/README
  20. BIN labs/bbb-api-php/assets/ajax-loader.gif
  21. +18 −0 labs/bbb-api-php/css/main.css
  22. +61 −0 labs/bbb-api-php/examples/createMeeting.php
  23. +61 −0 labs/bbb-api-php/examples/createRecordedMeeting.php
  24. +43 −0 labs/bbb-api-php/examples/deleteRecordings.php
  25. +50 −0 labs/bbb-api-php/examples/endMeeting.php
  26. +40 −0 labs/bbb-api-php/examples/getJoinMeetingUrlAttendee.php
  27. +40 −0 labs/bbb-api-php/examples/getJoinMeetingUrlModerator.php
  28. +40 −0 labs/bbb-api-php/examples/getJoinMeetingUrlModeratorRecord.php
  29. +51 −0 labs/bbb-api-php/examples/getMeetingInfo.php
  30. +53 −0 labs/bbb-api-php/examples/getMeetings.php
  31. +50 −0 labs/bbb-api-php/examples/getRecordings.php
  32. +33 −0 labs/bbb-api-php/examples/isMeetingRunning.php
  33. +89 −0 labs/bbb-api-php/examples/joinIfRunning.php
  34. +44 −0 labs/bbb-api-php/examples/publishRecordings.php
  35. +577 −0 labs/bbb-api-php/includes/bbb-api.php
  36. +9 −0 labs/bbb-api-php/includes/config.php
  37. +207 −0 labs/bbb-api-php/index.php
@@ -1,3 +1,5 @@
+Legacy library to integrate php web applications with BigBlueButton 0.71a
+
***Getting Started***
You must modify the url and salt in bbb_api_conf.php to that of your bigbluebutton server.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
View
@@ -0,0 +1,8 @@
+Library to integrate php web applications with BigBlueButton 0.8
+
+Contributed by:
+ Peter Mentzer.
+Original version available at:
+ https://github.com/petermentzer/bbb-api-php
+
+Stick the entire /bbb-api-php directory somewhere that you can host php web files. Then browse to the index page for configuration and usage instructions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,18 @@
+body {font-family:Arial,Helvetica,sans-serif;}
+dl dt {font-weight:bold;margin-bottom:10px;}
+dl dd {margin-bottom:20px;}
+p {color:#666;}
+ul {margin-left:30px;padding-left:0;list-style-type:none;}
+li {margin-bottom:5px;}
+a {color:#3678c1;}
+h3 {border-bottom:1px solid #666;padding-bottom:5px;margin-top:30px;}
+
+#main {width:960px;margin: 0 auto;}
+#status {background-color:#fff;border: solid 1px #ccc;padding:20px;text-align:center;}
+#TOC {float:right;margin-left:20px;margin-bottom:20px;padding:0px;padding-left:0;border:1px solid #ccc;width:300px;}
+#tocheader {background-color:#666;color:white;padding:10px;font-weight:bold;}
+
+.method {padding-left:20px;background-color:#d7ffd9;border:1px solid #97e59b;margin-top:0px;}
+.methodname {font-weight:bold;color:#000;}
+.example {padding-left:40px;padding-right:40px; background-color:#fff;border:1px solid #ccc;}
+.code {background-color:#eee;padding:20px;border:1px solid #ccc;}
@@ -0,0 +1,61 @@
+<?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' => '1234', // REQUIRED
+ 'meetingName' => 'Test Meeting Name', // REQUIRED
+ 'attendeePw' => 'ap', // Match this value in getJoinMeetingURL() to join as attendee.
+ 'moderatorPw' => 'mp', // Match this value in getJoinMeetingURL() to join as moderator.
+ 'welcomeMsg' => '', // ''= use default. Change to customize.
+ 'dialNumber' => '', // The main number to call into. Optional.
+ 'voiceBridge' => '', // PIN to join voice. Optional.
+ 'webVoice' => '', // Alphanumeric to join voice. Optional.
+ 'logoutUrl' => '', // Default in bigbluebutton.properties. Optional.
+ 'maxParticipants' => '-1', // Optional. -1 = unlimitted. Not supported in BBB. [number]
+ 'record' => 'false', // New. 'true' will tell BBB to record the meeting.
+ 'duration' => '0', // Default = 0 which means no set duration in minutes. [number]
+ //'meta_category' => '', // Use to pass additional info to BBB server. See API docs.
+);
+
+// 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') {
+ // Then do stuff ...
+ echo "<p>Meeting succesfullly created.</p>";
+ }
+ else {
+ echo "<p>Meeting creation failed.</p>";
+ }
+ }
+}
+
+?>
@@ -0,0 +1,61 @@
+<?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', // REQUIRED
+ 'meetingName' => 'Test Recorded Meeting Name', // REQUIRED
+ 'attendeePw' => 'ap', // Match this value in getJoinMeetingURL() to join as attendee.
+ 'moderatorPw' => 'mp', // Match this value in getJoinMeetingURL() to join as moderator.
+ 'welcomeMsg' => '', // ''= use default. Change to customize.
+ 'dialNumber' => '', // The main number to call into. Optional.
+ 'voiceBridge' => '', // PIN to join voice. Optional.
+ 'webVoice' => '', // Alphanumeric to join voice. Optional.
+ 'logoutUrl' => '', // Default in bigbluebutton.properties. Optional.
+ 'maxParticipants' => '-1', // Optional. -1 = unlimitted. Not supported in BBB. [number]
+ 'record' => 'true', // New. 'true' will tell BBB to record the meeting.
+ 'duration' => '5', // Default = 0 which means no set duration in minutes. [number]
+ //'meta_category' => '', // Use to pass additional info to BBB server. See API docs.
+);
+
+// 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') {
+ // Then do stuff ...
+ echo "<p>Meeting succesfullly created.</p>";
+ }
+ else {
+ echo "<p>Meeting creation failed.</p>";
+ }
+ }
+}
+
+?>
@@ -0,0 +1,43 @@
+<?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(
+ /*
+ * NOTE: Set the recordId below to a valid id after you have created a recorded meeting,
+ * and received back a real recordID back from your BBB server using the
+ * getRecordingsWithXmlResponseArray method.
+ */
+
+ // REQUIRED - We have to know which recording:
+ '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);
+}
+?>
@@ -0,0 +1,50 @@
+<?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', // REQUIRED - We have to know which meeting to end.
+ 'password' => 'mp', // REQUIRED - Must match moderator pass for meeting.
+
+);
+
+// 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') {
+ // Then do stuff ...
+ echo "<p>Meeting succesfullly ended.</p>";
+ }
+ else {
+ echo "<p>Failed to end meeting.</p>";
+ }
+ }
+ }
+?>
@@ -0,0 +1,40 @@
+<?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();
+
+/* ___________ JOIN MEETING w/ OPTIONS ______ */
+/* Determine the meeting to join via meetingId and join it.
+*/
+
+$joinParams = array(
+ 'meetingId' => '1234', // REQUIRED - We have to know which meeting to join.
+ 'username' => 'Test Attendee', // REQUIRED - The user display name that will show in the BBB meeting.
+ 'password' => 'ap', // REQUIRED - Must match either attendee or moderator pass for meeting.
+ 'createTime' => '', // OPTIONAL - string
+ 'userId' => '', // OPTIONAL - string
+ 'webVoiceConf' => '' // OPTIONAL - string
+);
+
+// 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:
+ print_r($result);
+}
+?>
@@ -0,0 +1,40 @@
+<?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();
+
+/* ___________ JOIN MEETING w/ OPTIONS ______ */
+/* Determine the meeting to join via meetingId and join it.
+*/
+
+$joinParams = array(
+ 'meetingId' => '1234', // REQUIRED - We have to know which meeting to join.
+ 'username' => 'Test Moderator', // REQUIRED - The user display name that will show in the BBB meeting.
+ 'password' => 'mp', // REQUIRED - Must match either attendee or moderator pass for meeting.
+ 'createTime' => '', // OPTIONAL - string
+ 'userId' => '', // OPTIONAL - string
+ 'webVoiceConf' => '' // OPTIONAL - string
+);
+
+// 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:
+ print_r($result);
+}
+?>
@@ -0,0 +1,40 @@
+<?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();
+
+/* ___________ JOIN MEETING w/ OPTIONS ______ */
+/* Determine the meeting to join via meetingId and join it.
+*/
+
+$joinParams = array(
+ 'meetingId' => '12345', // REQUIRED - We have to know which meeting to join.
+ 'username' => 'Test Moderator', // REQUIRED - The user display name that will show in the BBB meeting.
+ 'password' => 'mp', // REQUIRED - Must match either attendee or moderator pass for meeting.
+ 'createTime' => '', // OPTIONAL - string
+ 'userId' => '', // OPTIONAL - string
+ 'webVoiceConf' => '' // OPTIONAL - string
+);
+
+// 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:
+ print_r($result);
+}
+?>
Oops, something went wrong.

0 comments on commit 6077496

Please sign in to comment.