hi,

first off all, good work on this module, i really appreciate it.

the new bbb version is out and there are some changes to the api, especially checksum calculation and meetingtokens have changed. when can we expect the drupal module to include these changes?

regards benjamin

Comments

norio’s picture

The only file that needs to change is api.bbb.inc. I've made the necessary changes. This is not a patch but I don't have time to work on a patch as I'm busy finishing up a project so I'm just posting the modified source. The changes are very basic.

NB: The only thing this fixes is the checksum generation. There are other changes to api.bbb.inc that should be made but this is good enough for my needs for now so it's all I've done. If I do more, I'll post it here.
PS: To spot the changes, look at the definition of bbb_api_generate_querystring() and where it's been called. That's it. Very simple.


/**
 * @file
 * BigBlueButton - Enables universities and colleges to deliver a high-quality
 * learning experience.
 *
 * @author
 * Stefan Auditor <stefan.auditor@erdfisch.de>
 */

/**
 * Create Meeting (create)
 *
 * @param ARRAY $params
 *   Associative array of additional url parameters. Components:
 *   - name: STRING (REQUIRED) A name for the meeting.
 *   - meetingID: STRING A meeting ID that can be used to identify this meeting
 *     by the third party application. This is optional, and if not supplied,
 *     BBB will generate a meeting token that can be used to identify the
 *     meeting.
 *   - attendeePW: STRING The password that will be required for attendees to
 *     join the meeting. This is optional, and if not supplied, BBB will assign
 *     a random password.
 *   - moderatorPW: STRING The password that will be required for moderators to
 *     join the meeting or for certain administrative actions (i.e. ending a
 *     meeting). This is optional, and if not supplied, BBB will assign a
 *     random password.
 *   - welcome: STRING A welcome message that gets displayed on the chat window
 *     when the participant joins. You can include keywords (%%CONFNAME%%,
 *     %%DIALNUM%%, %%CONFNUM%%) which will be substituted automatically. You
 *     can set a default welcome message on bigbluebutton.properties
 *   - dialNumber: STRING The dial access number that participants can call in
 *     using regular phone. You can set a default dial number on
 *     bigbluebutton.properties
 *   - logoutURL: STRING The URL that the BigBlueButton client will go to after
 *     users click the OK button on the 'You have been logged out message'.
 *     This overrides, the value for bigbluebutton.web.loggedOutUrl if defined
 *     in bigbluebutton.properties
 * @return OBJECT or FALSE
 *   - meetingToken: STRING The internal meeting token assigned by the API for
 *     this meeting. It can be used by subsequent calls for joining or
 *     otherwise modifying a meeting's status.
 *   - meetingID: STRING The meeting ID supplied by the third party app, or
 *     null if none was supplied. If can be used in conjunction with a password
 *     in subsequent calls for joining or otherwise modifying a meeting's
 *     status.
 *   - attendeePW: STRING The password that will be required for attendees to
 *     join the meeting. If you did not supply one, BBB will assign a random
 *     password.
 *   - moderatorPW: STRING The password that will be required for moderators to
 *     join the meeting or for certain administrative actions (i.e. ending a
 *     meeting). If you did not supply one, BBB will assign a random password.
 *
 * @see http://code.google.com/p/bigbluebutton/wiki/API#Create_Meeting_(create)
 */
function bbb_api_create($params = array()) {
  $query_string = bbb_api_generate_querystring($params, 'create');
  $request = BIGBLUEBUTTON_BASE_URL . BIGBLUEBUTTON_CREATE_URL . '?' . $query_string;
  $xml = @simplexml_load_file($request);
  $response = bbb_api_parse_response($xml);

  if ($response->returncode == 'SUCCESS') {
    unset($response->returncode);
    return $response;
  }
  else {
    watchdog('bigbluebutton', '%message', array('%message' => $response->message), WATCHDOG_ERROR);
    return FALSE;
  }
}

/**
 * Join Meeting (join)
 *
 * @param ARRAY $params
 *   Associative array of additional url parameters. Components:
 *   - fullName: STRING (REQUIRED) The full name that is to be used to identify
 *     this user to other conference attendees.
 *   - meetingToken: The internal meeting token assigned by the API for this
 *     meeting when it was created. Note that either the meetingToken or the
 *     meetingID along with one of the passwords must be passed into this call
 *     in order to determine which meeting to find.
 *   - meetingID: STRING If you specified a meeting ID when calling create,
 *     then you can use either the generated meeting token or your specified
 *     meeting ID to find meetings. This parameter takes your meeting ID.
 *   - password: STRING The password that this attendee is using. If the
 *     moderator password is supplied, he will be given moderator status (and
 *     the same for attendee password, etc)
 *   - redirectImmediately: BOOLEAN If this is passed as true, then BBB will
 *     not return a URL for you to redirect the user to, but will instead treat
 *     this as an entry URL and will immediately set up the client session and
 *     redirect the user into the conference.
 *     Values can be either a 1 (one) or a 0 (zero), indicating true or false
 *     respectively. Defaults to false.
 * @return STRING
 *   The URL that the user can be sent to in order to join the meeting. When
 *   they go to this URL, BBB will setup their client session and redirect them
 *   into the conference.
 */
function bbb_api_join($params) {
  $query_string = bbb_api_generate_querystring($params, 'join');
  return BIGBLUEBUTTON_BASE_URL . BIGBLUEBUTTON_JOIN_URL . '?' . $query_string;
}

/**
 * Is meeting running (isMeetingRunning)
 *
 * This call enables you to simply check on whether or not a meeting is running
 * by looking it up with either the token or your ID.
 *
 * @param ARRAY $params
 *   Associative array of additional url parameters. Components:
 *   - meetingToken: STRING The internal meeting token assigned by the API for
 *     this meeting when it was created.
 *   - meetingID: STRING If you specified a meeting ID when calling create,
 *     then you can use either the generated meeting token or your specified
 *     meeting ID to find meetings. This parameter takes your meeting ID.
 * @return BOOLEAN
 *   A string of either “true” or “false” that signals whether a meeting with
 *   this ID or token is currently running.
 */
function bbb_api_isMeetingRunning($params) {
  $query_string = bbb_api_generate_querystring($params, 'isMeetingRunning');
  $request = BIGBLUEBUTTON_BASE_URL . BIGBLUEBUTTON_IS_MEETING_RUNNING_URL . '?' . $query_string;
  $xml = @simplexml_load_file($request);
  $response = bbb_api_parse_response($xml);

  if ($response->returncode == 'SUCCESS') {
    return drupal_strtoupper($response->running) == 'TRUE' ? TRUE : FALSE;
  }
  else {
    watchdog('bigbluebutton', '%message', array('%message' => $response->message), WATCHDOG_ERROR);
    return FALSE;
  }
}

/**
 * End Meeting (endMeeting)
 *
 * Use this to forcibly end a meeting and kick all participants out of the
 * meeting.
 *
 * @param ARRAY $params
 *   Associative array of additional url parameters. Components:
 *   - meetingToken: STRING The internal meeting token assigned by the API for
 *     this meeting when it was created. Note that either the meetingToken or
 *     the meetingID along with one of the passwords must be passed into this
 *     call in order to determine which meeting to find.
 *   - meetingID: STRING If you specified a meeting ID when calling create,
 *     then you can use either the generated meeting token or your specified
 *     meeting ID to find meetings. This parameter takes your meeting ID.
 *   - password: STRING The moderator password for this meeting. You can not
 *     end a meeting using the attendee password.
 *  @return BOOLEAN
 *    A string of either “true” or “false” that signals whether the meeting was
 *    successfully ended.
 */
// TODO: this call is not yet implemented.
function bbb_api_endMeeting($params) {
  $query_string = bbb_api_generate_querystring($params, 'endMeeting');
  $request = BIGBLUEBUTTON_BASE_URL . BIGBLUEBUTTON_END_MEETING_URL . '?' . $query_string;
  $xml = @simplexml_load_file($request);
  $response = bbb_api_parse_response($xml);

  if ($response->returncode == 'SUCCESS') {
    unset($response->returncode);
    return $response;
  }
  else {
    watchdog('bigbluebutton', '%message', array('%message' => $response->message), WATCHDOG_ERROR);
    return FALSE;
  }
}

/**
 * Get Meeting Info (getMeetingInfo)
 *
 * This call will return all of a meeting's information, including the list of
 * attendees as well as start and end times.
 *
 * @param ARRY $params
 *   Associative array of additional url parameters. Components:
 *   - meetingToken: STRING The internal meeting token assigned by the API for
 *     this meeting when it was created. Note that either the meetingToken or
 *     the meetingID along with one of the passwords must be passed into this
 *     call in order to determine which meeting to find.
 *   - meetingID: STRING If you specified a meeting ID when calling create,
 *     then you can use either the generated meeting token or your specified
 *     meeting ID to find meetings. This parameter takes your meeting ID.
 *   - password: STRING (REQUIRED) The moderator password for this meeting. You
 *     can not get the meeting information using the attendee password.
 * @return OBJECT or FALSE
 */
// TODO: this call is not yet implemented.
function bbb_api_getMeetingInfo($params) {
  $query_string = bbb_api_generate_querystring($params, 'getMeetingInfo');
  $request = BIGBLUEBUTTON_BASE_URL . BIGBLUEBUTTON_GET_MEETING_INFO_URL . '?' . $query_string;
  $xml = @simplexml_load_file($request);
  $response = bbb_api_parse_response($xml);

  if ($response->returncode == 'SUCCESS') {
    unset($response->returncode);
    return $response;
  }
  else {
    watchdog('bigbluebutton', '%message', array('%message' => $response->message), WATCHDOG_ERROR);
    return FALSE;
  }
}

/* Helper functions */

/**
 * Generate a signed query string
 */
function bbb_api_generate_querystring($params = array(), $call = '') {
  $query = array();
  // URL encoding the parameters
  foreach ($params as $key => $value) {
    $query[] = $key . '=' . drupal_urlencode(trim($value));
  }
  // Putting it together
  $query_string = implode('&', $query);
  // Adding the checksum to query string and return
  $query_string = $query_string . '&checksum=' . sha1($call . $query_string . BIGBLUEBUTTON_SECURITY_SALT);
  return $query_string;
}

/**
 * Parse xml response
 *
 * @param XML
 * @return OBJECT
 */
function bbb_api_parse_response($xml) {
  //TODO: Refactor
  $response = new StdClass;
  if ($xml) {
    foreach ($xml as $element => $node) {
      $response->$element = (string) $node;
    }
  }
  return $response;
}
christiaan_’s picture

Thank you very much for this. I updated to BBB 0.7 and applied you patch/fix on Drupal BigBlueButton 6.x-1.0-beta1 - everything works perfectly for me.

DieterWeb’s picture

i cant get it to work. first of all, i dont see any logical changes besides in the generate_query_string function, but they were there already in my version, i just had to set the "$salty" param to 2 by default. but, what i dont get is, which version of the module are you referring to here? my constants are named totally different, where yours are "BIGBLUEBUTTON_BASE_URL", my is named "BBB_API_BASE_URL". even some functions are name differently, so im a little irretated which version you're using. i installed the stable version, but recently downloaded the dev-version via drush.

after that realisation, i tried manually to change the api file, but had no luck with that. if i try to start a conference, i only see the login of the bbb demo app, with the warning that this app is deprecated.

any help would be greatly appreciated.

*edit*

here is an example url which gets called:

http://bbb.example.com/bigbluebutton/join/login?meetingID=666&checksum=3...

jvieille’s picture

I first try with the dev and succeded to pass the connexion test in the admin settings, but couldn't do more.
The url of my server was simply its IP address http://THE.SRV.IP.ADR/

I have bbb 0.7, so I tried to apply this patch without success
Then I realized that the patch was against the beta 2 and tried again.

The simple IP address did not get through anymore

http://THE.SRV.IP.ADR/bigbluebutton/ pass the connexion test from the drupal module settings,
When hit directly this url leads to a bbb login page with the mention:
"NOTE: We are deprecating this web interface in favor of the API. This will be removed in the next release."

http://THE.SRV.IP.ADR/bigbluebutton/api does not pass the connexion test.
When hit directly this url leads to a white page telling "SUCCESS0.7"

the url that is formed to start a meeting is http://www.drupalwebsite.tld./node/xx/meeting/://
which is certainly not correct.

I noticed that the BIGBLUEBUTTON_BASE_URL variable assumes that the api address is http://something.tld/bigbluebutton, not http://something.tld/bigbluebutton/api as the calls to api are all prefixed /api
However, the admin settings test the connexion against BIGBLUEBUTTON_BASE_URL, so whithout the needed "/api" part.
But even setting the correct base url (whithout "/api") that fails in test, bbb does not work at all.

Finally, I made a new trail using the dev version which seems to already have some work done for 0.7
I changed the file manually to fit the indicated changes.
Result: I could get a server response using the http://THE.SRV.IP.ADR/bigbluebutton/api/ setting
However, the connexion fails "The connection could not be established correctly. The server response was: You did not pass the checksum security check."
the url to start a meeting is still http://www.drupalwebsite.tld./node/xx/meeting/://

Entering the same parameters in Chrome succeeded

jvieille’s picture

Found something in page.bbb.inc (bbb-6.x-dev)

this function has to be modified as follow - then the test passes correctly

function bbb_test_connection($base_url, $security_salt) {
  $params = array('random' => user_password());
//  $query_string = bbb_api_generate_querystring(BBB_API_GET_MEETINGS, $params, FALSE);
  $query_string = bbb_api_generate_querystring(BBB_API_GET_MEETINGS, $params, 0);
  
//  $query_string = $query_string . '&checksum=' . sha1($query_string . $security_salt);
  $query_string = $query_string . '&checksum=' . sha1(BBB_API_GET_MEETINGS . $query_string . $security_salt);

  $request = $base_url . BBB_API_GET_MEETINGS . '?' . $query_string;

  bbb_api_debug($request);
 
  $xml = @simplexml_load_file($request);
  $response = bbb_api_parse_response($xml);
  bbb_api_debug($response);
  if ($response->returncode == 'SUCCESS') {
    drupal_set_message(t('The connection has been established succesfully. Please save your configuration now.'));
    
  }
  else {
    drupal_set_message(t('The connection could not be established correctly. The server response was: %message.', array('%message' => ($response->message ? $response->message : t('No response')))), 'error');
    watchdog('big blue button', '%message', array('%message' => $response->message), WATCHDOG_ERROR);
    return FALSE;
  }
}

Still no way to start a meeeting

jvieille’s picture

Priority: Normal » Critical

Are there any progress on this?
Marking critical as BBB is now 0.7 for those who install it.

The small change indicated above works for succeed at configuring the connexion in admin/settings, but Moderat or Start meeting does not work

Thanks

jvieille’s picture

I finally succeeded at getting the thing working.

- uninstalled the dev version
- installed the patched beta version
- the url is http://something.tld/bigbluebutton/api

I created a couple of issues from my early tests

This is a great achievement, keep up with the good work!

jvieille’s picture

Is there any plan to polish this module?
Not usable at the present time

Thanks again, this module will be a killer in Drupal!

Alexander Matveev’s picture

Have 6.x-1.0-beta1 and BBB 0.7,

getting:

<response>
<returncode>FAILED</returncode>
<messageKey>checksumError</messageKey>
<message>You did not pass the checksum security check</message>
</response>

Subscribing.

jvieille’s picture

any update?
Recall: many annoying issues certainly linked to this:
http://drupal.org/node/876088
http://drupal.org/node/876078
http://drupal.org/node/876072
http://drupal.org/node/876054
http://drupal.org/node/810070

We would be glad to have a fully workable module using bbb 0.7
Note: bbb 0.71 is approaching

Thanks again for having integrating this gem in Drupal

jvieille’s picture

Attached an update from Fred Dixon at BBB
In the API section, he mentions something that might relate to some noted issues:

"The current behavior when end is call is that users can't immediately join the meeting for an hour (this is configurable; see API docs for more information). The logic is that if a calling application ends a meeting, then the BigBlueButton server will reject users rejoining.

If the logic should be "the meeting has ended but you want users to immediately re-join", then the third-party application could call end and then change the meetingID associated with the meeting in its database. Subsequent create/join request by the user would then create a new meeting for joining."

jvieille’s picture

Any update on this?
Thanks

Chipie’s picture

subscribe

Chipie’s picture

Title: bbb 0.7 is out, some changes to the api needed » patch for bbb v0.7
StatusFileSize
new2.81 KB

Here is a patch for the drupal bbb modul 6.x-1.0-beta1 for the BigBlueButton V 0.7 based on the work of norio.

jvieille’s picture

Title: patch for bbb v0.7 » Port to bbb 0.7 needs to be finished
Category: feature » bug

Thanks for the patch;
However, the patched module simply does not work with bbb 0.7, too many issues remaining. It applies to the old beta1 so we seem to miss the corrections from the last dev.
It would be great if the maintainer or someone capable had a look at this to have a workable module.
BBB is really a great project, Drupal has definitely to follow it

Thanks again for bringing this in Drupal

sanduhrs’s picture

Title: Port to bbb 0.7 needs to be finished » API update for BBB v0.7
Category: bug » task
Priority: Critical » Normal
Status: Active » Needs work

I'll be happy to work on this as soon I have time, that will actually take a few more weeks, sorry for that.
If you manage to create a working patch [1] in the meantime and someone is able to review and test it, I'll be happy to commit it.

Btw, please don't misuse the issue attributes.
This is a task, not a bug. This has priority normal unless the published release code breaks your site.

[1] http://drupal.org/patch/create

jvieille’s picture

Thanks a lot for taking care
I won"t change again the issue attributes, but BBB is currently unusable, though I recognize that it does not blow the server out.
It seems that the current dev is cleaner than the beta1 version, it might be the right start?

I think that if BBB was actually working, it would deserve much more attention and could attract sponsors to help improving it.
I would be glad to raise some funding if I can sell something to a for profit company, but I am currently only involved in volunteer organizations...

Chipie’s picture

Subscribing.

Chipie’s picture

We want to use bbb in one of our projects. I would like to submit a patch, but I'm not sure, which version I should use for the development. Why is the "Test Connection"-Button or the screen size settings missing at the modul setting page of the current HEAD version? They were included in the beta1. Did you remove these settings?

eme’s picture

Subscribing

jvieille’s picture

#14: Could you also include the fixes in #5?

Thanks

sanduhrs’s picture

Assigned: Unassigned » sanduhrs
Status: Needs work » Fixed

Please checkout the latest dev version. The suggestions from #5 and #14 are incorporated there.

jhezsie20’s picture

Hi guys, can you help me?

I can't get it to work, or am I missing something?

Currently using the latest dev version (9/22) and BBB 0.7

Here's the problem:

1. On BBB settings, Test Connection displays:

"The connection could not be established correctly. The server response was: You did not pass the checksum security check."

Note: URL set to http://mybbb.server.com/bigbluebutton/api/ and inputted the correct security salt.

2. When starting the created meeting, this error appears:
-
FAILED
checksumError
You did not pass the checksum security check

Take note that using the beta1 release together with the patch by norio works perfectly (except for the audio and logout issue).

Hope you can help me :)

thanks,
jessie

sanduhrs’s picture

Did you run the update.php ?

jhezsie20’s picture

Hi Sir sanduhrs,

I did not run the update.php since I've tried this to a newly setup drupal server and installed the BBB latest dev module and start from there. Should I run the update.php even if this is the case?

thanks,
jessie

sanduhrs’s picture

Status: Fixed » Active

No, in that case, you don't need to.
I just commited a few more changes, please try the latest dev version when they got packaged.

eme’s picture

I updated, and it worked fine, just one error :
user warning: Can't DROP 'voiceBridge'; check that column/key exists query: ALTER TABLE bbb_meetings DROP voiceBridge in /var/www/includes/database.mysql-common.inc on line 322.

jhezsie20’s picture

Hi sanduhrs,

Thanks for the update, its working now. Cheers!

I've just noticed something, the terminate function terminates the room permanently and you cannot login anymore. I thought, terminating a room only means force-ending of a room session but you can still use or login to that room the next time. Another thing, how can I properly use the logout URL function? Inputting the URL of my drupal homepage does nothing. Does it have a format to follow?

Thanks a lot sir! This project is great!

regards,
jessie

sanduhrs’s picture

Well, the API documentation says:

End Meeting (end):
Use this to forcibly end a meeting and kick all participants out of the meeting.

http://code.google.com/p/bigbluebutton/wiki/API#End_Meeting_(end)

A few lines further up in the "What's_New" section it says:

Issue 247 - After a meeting has ended (either forcibly or after all participants have voluntarily left), a meeting only stays in memory for 60 minutes. After that it will no longer be returned from the getMeetings call, and you will not be able to call getMeetingInfo, etc, for that meeting. The number of minutes that it remains in memory is configurable. You can modify /var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties and change (or add) the line "beans.dynamicConferenceService.minutesElapsedBeforeMeetingExpiration=60". If you add it, it should be added just before or after the line where your security salt is configured

http://code.google.com/p/bigbluebutton/wiki/API#What's_New

So, if you configure your bbb server to something like minutesElapsedBeforeMeetingExpiration=0, it'll probably work es you'd expect.

I will have tp recheck the logoutURL function but it seems, that only relative URLs are possible by design.

jvieille’s picture

I changed the BBB setting as indicated in #29
However, the "Meeting settings" in the node meeting says
"The following settings maybe changed until the meeting first starts"

and actually everything is greyed out and an attempt to "moderate" the meeting lead to a blak screen indicating
"FAILEDinvalidPasswordYou either did not supply a password or the password supplied is neither the attendee or moderator password for this conference."

How can we reset a terminated meeting in order to make it usable again?

Thanks

jvieille’s picture

Status: Active » Fixed

I think this issue is closed. The new dev works reasonably well with bbb0.7

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drtrueblue’s picture

Status: Closed (fixed) » Needs review

With the beta version, I was getting a checksum error. After changing to the dev version I got the same error as eme posted...

"user warning: Can't DROP 'voiceBridge'; check that column/key exists query: ALTER TABLE bbb_meetings DROP voiceBridge..."

The application so far works, but perhaps the issue should not yet be closed?

islevegan’s picture

Title: API update for BBB v0.7 » Two servers, one with LAMP, the other for BBB...
Category: task » support
Status: Needs review » Active

Both servers are physically separated in a significant way.

The LAMP server is a linode at a data center in California, with lots of bandwidth but not that much memory, only 512, which works for LAMP but not BBB.

I recently gained access to a dual processor 1.6 ghz Dell server with 2GB of ram and an ethernet connection in Waikiki, Honolulu, Hawaii. I have 32 bit Ubuntu 10.10 server running there and Debian Lenny (5) running at the California virtual server.

Can I have BBB in Hawaii accessed via Drupal from California?

Mahalo for making this module available!

Aloha.

verbosity’s picture

Title: Two servers, one with LAMP, the other for BBB... » API update for BBB v0.7

Please don't change the title of this thread,
its a useful thread on its own, you should have started a new thread with your question.

that being said, there should be no reason your servers couldn't talk nicely.

sanduhrs’s picture

Status: Active » Fixed

#33 is a non-issue.
closing.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nagrgk’s picture

Hi Alexander Matveev,

Have you got the answer for this ??

Please suggest me as I have same problem here and stuck in the middle

nagaraja kharvi

nagrgk’s picture

Hi Alexander Matveev,

Have you got the answer for this ??

Please suggest me as I have same problem here and stuck in the middle

nagaraja kharvi

nagrgk’s picture

Hi All,

I am getting following message on test connection. pls somebody help?

The connection could not be established correctly. The server response was: No response.

nagaraja kahavi