Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save GhaziTriki/df76251ae3af29e5ef1f4fd5281bc38d to your computer and use it in GitHub Desktop.
Save GhaziTriki/df76251ae3af29e5ef1f4fd5281bc38d to your computer and use it in GitHub Desktop.
<?php
require_once './vendor/autoload.php';
use BigBlueButton\BigBlueButton;
use BigBlueButton\Parameters\CreateMeetingParameters;
use BigBlueButton\Parameters\JoinMeetingParameters;
// Define meetings names
$meetings = array('mc' => 'Molecular Chemistry',
'it' => 'Information Theory',
'pm' => 'Project Management');
$passwords = array('moderator' => 'mPass',
'attendee' => 'aPass');
// Init BigBlueButton API
$bbb = new BigBlueButton();
$meetingId = $HTTP_POST_VARS['meeting'];
// Create the meeting
$createParams = new CreateMeetingParameters($meetingId, $meetings[$meetingId]);
$createParams = $createParams->setModeratorPassword($passwords['moderator'])
->setAttendeePassword($passwords['attendee']);
$bbb->createMeeting($createParams);
// Send a join meeting request
$joinParams = new JoinMeetingParameters($meetingId, $HTTP_POST_VARS['username'], $passwords[$HTTP_POST_VARS['role']]);
$joinParams->setRedirect(true);
// Join the meeting by redirecting the user to the generated URL
$url = $bbb->getJoinMeetingURL($joinParams);
header('Status: 301 Moved Permanently', false, 301);
header('Location:' . $bbb->getJoinMeetingURL($joinParams));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment