You are here

function bbb_init_meeting in BigBlueButton 7

Same name and namespace in other branches
  1. 6 bbb.module \bbb_init_meeting()

Init meeting

3 calls to bbb_init_meeting()
bbb_create_meeting in ./bbb.module
Create meeting
bbb_store_meeting in ./bbb.module
Store meeting
bbb_update_meeting in ./bbb.module
Update meeting

File

./bbb.module, line 611
Big Blue Button - Enables universities and colleges to deliver a high-quality learning experience.

Code

function bbb_init_meeting($node = NULL, $params = array()) {
  $welcome = variable_get('bbb_content_type_welcome_' . $node->type, '');
  $dialNumber = variable_get('bbb_content_type_dialNumber_' . $node->type, '');
  $moderatorPW = variable_get('bbb_content_type_moderatorPW_' . $node->type, '');
  $attendeePW = variable_get('bbb_content_type_attendeePW_' . $node->type, '');
  $logoutURL = variable_get('bbb_content_type_logoutURL_' . $node->type, '');
  $default_rec = variable_get('bbb_content_type_record_' . $node->type, '');
  if (isset($node->bbb)) {
    $record = (array) $node->bbb;
    $record = empty($record['record']) ? $default_rec : 1;
  }
  $settings = array(
    'nid' => $node->nid,
    'name' => $node->title,
    'meetingID' => bbb_create_meeting_id($node->nid),
    'attendeePW' => !empty($attendeePW) ? $attendeePW : user_password(),
    'moderatorPW' => !empty($moderatorPW) ? $moderatorPW : user_password(),
    'welcome' => !empty($welcome) ? $welcome : t('Welcome to @title', array(
      '@title' => $node->title,
    )),
    'dialNumber' => $dialNumber ? $dialNumber : NULL,
    // TODO: This is limited to 90000 voice bridges and may
    // collide sooner, as rand() may return x twice in a row
    'voiceBridge' => rand(10000, 99999),
    'logoutURL' => $logoutURL,
    //TODO: make absolute, as soon as supported
    'record' => $record,
    'initialized' => 0,
    'created' => time(),
  );
  $params = (array) $params;
  $params = array_merge($params, $settings);
  return $params;
}