|
|
|
|
@ -13,11 +13,18 @@ $roomTable = Database::get_main_table('plugin_bbb_room'); |
|
|
|
|
$applyAllUrls = 'true' === $plugin->get('plugin_bbb_multiple_urls_cron_apply_to_all'); |
|
|
|
|
|
|
|
|
|
$bbb = new bbb(); |
|
|
|
|
if ($bbb->pluginEnabled) { |
|
|
|
|
$activeSessions = $bbb->getActiveSessions($applyAllUrls); |
|
|
|
|
|
|
|
|
|
if (!empty($activeSessions)) { |
|
|
|
|
foreach ($activeSessions as $value) { |
|
|
|
|
if (!$bbb->pluginEnabled) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$activeSessions = $bbb->getActiveSessions($applyAllUrls); |
|
|
|
|
|
|
|
|
|
if (empty($activeSessions)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
foreach ($activeSessions as $value) { |
|
|
|
|
$meetingId = $value['id']; |
|
|
|
|
$courseCode = null; |
|
|
|
|
$courseInfo = api_get_course_info_by_id($value['c_id']); |
|
|
|
|
@ -42,9 +49,16 @@ if ($bbb->pluginEnabled) { |
|
|
|
|
$meetingBBB = $bbb->getMeetingInfo($params); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!empty($meetingBBB)) { |
|
|
|
|
if (isset($meetingBBB['returncode'])) { |
|
|
|
|
if (empty($meetingBBB)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!isset($meetingBBB['returncode'])) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$action = (string) $meetingBBB['returncode']; |
|
|
|
|
|
|
|
|
|
switch ($action) { |
|
|
|
|
case 'FAILED': |
|
|
|
|
$bbb->endMeeting($value['id'], $courseCode); |
|
|
|
|
@ -96,8 +110,4 @@ if ($bbb->pluginEnabled) { |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|