Git Product home page Git Product logo

bigbluebutton-api-php's Introduction

BigBlueButton API for PHP

Home Image FOSSA Status

The official and easy to use BigBlueButton API for PHP, makes easy for developers to use BigBlueButton API for PHP 7.4+.

Packagist PHP from Travis config Downloads

Build Status Code Coverage Scrutinizer Code Quality

@bigbluebutton on Twitter Website

PHP 7.4 PHP 8.0 PHP 8.1 PHP 8.2

Installation and usage

The wiki contains all the documentation related to the PHP library. We have also written a samples to show a full install and usage example.

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub

Contributing guidelines

Code Quality 1: Style

Make sure the code style configuration is applied by running PHPCS-Fixer.

# using an alias
$ composer cs-fix

Code Quality 2: Static code analysis

PHPStan shall be used for static code analysis by running the command below:

# using an alias
$ composer code-check

# or the same w/o alias
$ ./vendor/bin/phpstan analyse

Code Quality 3: Tests

For every implemented feature add unit tests and check all is green by running the command below.

# using an alias
$ composer code-test

# or the same w/o alias
./vendor/bin/phpunit

To run a single test

# using an alias
$ composer code-test -- --filter BigBlueButtonTest::testApiVersion

# or the same w/o alias
./vendor/bin/phpunit --filter BigBlueButtonTest::testApiVersion

A code-coverage report will be created along with the tests. This report will be stored in:

./var/coverage/

In case of trouble with the creation of the code-coverage report (e.g. local environment does not fulfill requirements) the creation can be skipped with:

# using an alias
$ composer code-test -- --no-coverage

Remark:

Some test will connect to an existing BBB-server, which is specified in the .env-file. You can specify your own BBB-server by copy that file into the same folder and name it .env.local. Exchange the credentials BBB_SERVER_BASE_URL and BBB_SECRET to your server's values. Since this new file (.env.local) takes precedence over the main file (.env), you will now test with your own server.

License

FOSSA Status

bigbluebutton-api-php's People

Contributors

alfro avatar althaus avatar andrekutianski avatar botris avatar davidrojo avatar denis-b avatar digitaltimk avatar felixjacobi avatar ffdixon avatar fossabot avatar ghazitriki avatar hanazarraa avatar iamdorsa avatar jfederico avatar jibon57 avatar joisarjignesh avatar jonaslm avatar kaabi avatar marlonetiene avatar medazizhaddad avatar mehrna avatar michaelcenef avatar mmeganos avatar mmmoradi avatar rustamwin avatar samuelwei avatar sualko avatar tiagojacobs avatar xjuvi avatar yurujai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bigbluebutton-api-php's Issues

joinMeeting error

getJoinMeetingURL works great but joinMeeting throws a fatal error
php 7.3

$joinMeetingParameters = new JoinMeetingParameters('','','');
$joinMeetingParameters->setMeetingId('test');
$joinMeetingParameters->setUsername('test');
$joinMeetingParameters->setPassword('test');
$joinMeetingParameters->setJoinViaHtml5(true);
$joinMeetingParameters->setRedirect(false);

$bbb = new BigBlueButton();
$response = $bbb->joinMeeting($joinMeetingParameters);
Warning: SimpleXMLElement::__construct(): Entity: line 6: parser error : Specification mandate value for attribute async in /vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 490 
Warning: SimpleXMLElement::__construct(): in /vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 490
Warning: SimpleXMLElement::__construct(): ^ in /vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 490
Fatal error: Uncaught Exception: String could not be parsed as XML in /vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php:490 Stack trace: #0 /vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php(490): SimpleXMLElement->__construct('\nprocessXmlResponse('https://server') #2 /getjoinmeetingurl.php(20): BigBlueButton\BigBlueButton->joinMeeting(Object(BigBlueButton\Parameters\JoinMeetingParameters)) #3 {main} thrown in /vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 490

Unhandled curl error: Connection timed out after 10001 milliseconds

"message": "Unhandled curl error: Connection timed out after 10001 milliseconds",
"exception": "RuntimeException",
"file": "/var/www/vhosts/cnjxnb/httpdocs/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php",
"line": 389,
"trace": [
{
"file": "/var/www/vhosts/cnjxnb/httpdocs/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php",
"line": 102,
"function": "processXmlResponse",
"class": "BigBlueButton\BigBlueButton",
"type": "->"
},

currently unable to handle this request.

Dear all,

Sorry to bother you! I am a newbie to this. Anyway, I tried to use this bigbluebutton-api-php, however, i am running into this problem for the past couple of days. Following the instructions on github, I have created a composer project. When I use it as:

404 Not Found - Add Presentation

Hello, I Used BigBlueButton PHP API for about 1 Month and everything almost Ok
but tonight I tried to create a meeting and my website shows error
After that, I understood that in backend, API recieved 404 - Not Found Error
finnally I Commented below codes and Website work almost correctly
if (!empty($payload)) {
//curl_setopt($ch, CURLOPT_HEADER, 0);
//curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
/*curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-type: ' . $contentType,
'Content-length: ' . mb_strlen($payload),
]);*/
}
but presentasion slide not showing
can I solve this Problem?

Unhandled curl error: Could not resolve host: api

I create meeting use api. Please help me!

RuntimeException in BigBlueButton.php line 338:
Unhandled curl error: Could not resolve host: api
in BigBlueButton.php line 338
at BigBlueButton->processXmlResponse('api/create?name=BigBlueButton+API+Meeting&meetingID=bbb-meeting-uid-65&record=false&autoStartRecording=false&allowStartStopRecording=false&checksum=bb83a2a318ccd74d17d7b0bd5b7627ad4fb2a9b4', '') in BigBlueButton.php line 95
at BigBlueButton->createMeeting(object(CreateMeetingParameters)) in FrontendController.php line 31
at FrontendController->home()
at call_user_func_array(array(object(FrontendController), 'home'), array()) in Controller.php line 256
at Controller->callAction('home', array()) in ControllerDispatcher.php line 164
at ControllerDispatcher->call(object(FrontendController), object(Route), 'home') in ControllerDispatcher.php line 112
at ControllerDispatcher->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139
at Pipeline->Illuminate\Pipeline{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 114
at ControllerDispatcher->callWithinStack(object(FrontendController), object(Route), object(Request), 'home') in ControllerDispatcher.php line 69
at ControllerDispatcher->dispatch(object(Route), object(Request), 'Modules\Frontend\Http\Controllers\FrontendController', 'home') in Route.php line 203
at Route->runWithCustomDispatcher(object(Request)) in Route.php line 134
at Route->run(object(Request)) in Router.php line 708
at Router->Illuminate\Routing{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 139

api/create not found

Hi I have digitalocean install of bbb and its working on the demo. but right now i can't create using php api. i got this response from the curl request

<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
</html>

and on the server logs i got this..

2019/12/02 10:46:34 [error] 26920#26920: *139 open() "/var/www/bigbluebutton-default/api/create" failed (2: No such file or directory), client: 103.95.148.158, server: bbb.learnicus.online, request: "GET /api/create?name=BigBlueButton+API+Meeting&meetingID=bbb-meeting-uid-65&record=false&autoStartRecording=false&allowStartStopRecording=false&webcamsOnlyForModerator=false&lockSettingsDisableCam=false&lockSettingsDisableMic=false&lockSettingsDisablePrivateChat=false&lockSettingsDisablePublicChat=false&lockSettingsDisableNote=false&lockSettingsHideUserList=false&lockSettingsLockedLayout=false&lockSettingsLockOnJoin=true&lockSettingsLockOnJoinConfigurable=false&checksum=cf0a40b6bc76400ab181daf349064637c7150c6d HTTP/1.1", host: "bbb.learnicus.online"

Error: "Warning: SimpleXMLElement"

PHP:

<?php
	require_once '/home/---/public_html/vendor/autoload.php';
	
	use BigBlueButton\BigBlueButton;
	define('BBB_SERVER_BASE_URL','https://bbb.domain.com/bigbluebutton/');
	define('BBB_SECRET','J1rF2P34628tKiS5F3V4627140iq9fF4nZkVI');
	$bbb = new BigBlueButton();
	$createMeetingParams = new \BigBlueButton\Parameters\CreateMeetingParameters('bbb-meeting-uid-65', 'BigBlueButton API Meeting');
	$response = $bbb->createMeeting($createMeetingParams);
	echo "Created Meeting with ID: " . $response->getMeetingId();

Error:

Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error : Start tag expected, '<' not found in /home/---/public_html/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 424

Warning: SimpleXMLElement::__construct(): error code: 1003 in /home/---/public_html/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 424

Warning: SimpleXMLElement::__construct(): ^ in /home/---/public_html/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 424

Fatal error: Uncaught Exception: String could not be parsed as XML in /home/---/public_html/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php:424 Stack trace: #0 /home/---/public_html/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php(424): SimpleXMLElement->__construct('error code: 100...') #1 /home/---/public_html/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php(103): BigBlueButton\BigBlueButton->processXmlResponse('api/create?name...', '') #2 /home/---/public_html/test7.php(9): BigBlueButton\BigBlueButton->createMeeting(Object(BigBlueButton\Parameters\CreateMeetingParameters)) #3 {main} thrown in /home/---/public_html/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 424

What is the reason?
Thank you.

Setting up a timed interview

Hello,

Thank you for this great project!

Is it possible to determine the duration of a conversation created?
For example, it is desired to create a 60-minute interview. Redirect to custom page after 60 minutes.

Get rid of getenv / Env-Parameters???

Why would you use "getenv" to configure the BBB-Api class? Why not just passing those two parameters (secret & url) to the constructor?

Using environment variables has several drawbacks - as for example I cannot instanciate multiple objects of your API for managing different BBB Servers inside my application. Likewise, env-variables are easily available for all php scripts running in the same environment.

Set presenter for attendee per API call

Hi,

I use bigbluebutton for a lot lightningtalks. We will have many participants.
I want to have the workflow that only the one who is giving a talk gets "presenter" manually, but didn't want to search that one in a large list.

I got the idea to use a list of names and an external program to enable this option. The current API seems not be able to archieve this.

That may need "room id", "user name", "verify user in room", "get presenter status", "set presenter"

Any idea how that can be done?

regards
Reimar

creating hooks but it didn't fire any events

Hi @GhaziTriki I have created a hooks but it seems to be not working.

$hookParameter = new HooksCreateParameters("https://enw3jpw6d9p7b.x.pipedream.net");
    $hookParameter->setMeetingId($iMeetingId);
    $hookParameter->setGetRaw(true);
    $hookRes = $bbb->hooksCreate($hookParameter);
    Log::info($hookRes->getHookId());

below is the results when I try to list hook so it is registered.

BigBlueButton\Core\Hook::__set_state(array(
     'rawXml' => 
    SimpleXMLElement::__set_state(array(
       'hookID' => '2',
       'callbackURL' => $hookParameter = new HooksCreateParameters("https://enw3jpw6d9p7b.x.pipedream.net");
    $hookParameter->setMeetingId($iMeetingId);
    $hookParameter->setGetRaw(true);
    $hookRes = $bbb->hooksCreate($hookParameter);
    Log::info($hookRes->getHookId());
      SimpleXMLElement::__set_state(array(
      )),
       'meetingID' => 
      SimpleXMLElement::__set_state(array(
      )),
       'permanentHook' => 'false',
       'rawData' => '1',
    )),
     'hookId' => 2,
     'meetingId' => 'b4991f917a36b8d9c9666a8087d23f44ab0536f7-1578487391601',
     'callbackUrl' => 'https://enw3jpw6d9p7b.x.pipedream.net',
     'permanentHook' => false,
     'rawData' => false,
  )),

maybe a firewall something? or a configuration on my bbb server?

The meeting ID that you supplied did not match any existing meetings

Step by step:

  1. i create the meeting
  2. join as moderator
  3. join some users as attendees
  4. end meeting using button in HTML5 client, or using API - doesnt matter

After that i create this meeting one more time without any error
The try to join and this kind of error appears: The meeting ID that you supplied did not match any existing meetings "key":"invalidMeetingIdentifier"

Nothing like this I do not get:
This conference was already in existence and may currently be in progress.

change meetings config

After I Create Meeting...I want to dynamically change some of its config like disable desktop sharing.
based on bigbluebutton document I wrote below code which
I get default config
change it
then I set it using setConfig function ...
it successfully done and returned token which I used it to get join url...but when I go to the url and directed to the Conference nothing changed...
Screenshot_15
setConfig response
Screenshot_16

The response content must be string, object given

use BigBlueButton\BigBlueButton;
use BigBlueButton\Parameters\GetRecordingsParameters;
class BigBlueButtonController {
    function getRecordings($param = []) {
        $recordingParams = new GetRecordingsParameters();
        $bbb = new BigBlueButton();
        $response = $bbb->getRecordings($recordingParams);
        return $response;
    }
}

This is my code and I am getting error

The Response content must be a string or object implementing __toString(), "object" given.

From browser, I can see there is some problem on

 public function setContent($content)
    {
        if (null !== $content && !\is_string($content) && !is_numeric($content) && !\is_callable(array($content, '__toString'))) {
            throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', \gettype($content)));
        }
 
        $this->content = (string) $content;
 
        return $this;
    }

But I can understand, the problem is not there, so how I should debug and solve this issue.

get, set and object to array

I know this API is new , so I've been trying to follow the API by reading the source, and trying to understand how you guys want to build this. I just want to give a recommendation based on my experience of using this API so far. While this is still in its inception, I'm pretty sure some big changes are still allowed.

This API gives the output by returning XML response by breaking it down one method for each.
Why don't you just convert the object to array?

    public function getMeetingInfo($meetingID, $moderatorPW) {
        $checksum = sha1("getMeetingInfomeetingID=$meetingID&password={$moderatorPW}{$this->secret}");
        $xml = $this->bbb->processXmlResponse($this->url . "api/getMeetingInfo?meetingID=$meetingID&password=$moderatorPW&checksum=$checksum");

        return json_decode(json_encode($xml), true);
    }

That encode+decode+true magically converts the object to array in one line.

That said, if we can store the array to property, the Class itself can be shortened much, e.g.:

namespace BigBlueButton\Core;

/**
 * Class Meeting
 * @package BigBlueButton\Core
 */
class Meeting
{
    /**
     * @var array
     */
    private $meeting;

    /**
     * Meeting constructor.
     * @param $xml \SimpleXMLElement
     */
    public function __construct($xml)
    {
        $this->meeting = json_decode(json_encode($xml), true);
    }

    /**
     * @return mixed
     */
    public function get($key)
    {
        /**
         * @todo: switch-case to convert string to boolean or int
         */
        return $this->meeting[$key];
    }
}

This also brings the same idea for set, eg:

namespace BigBlueButton\Parameters;

/**
 * Class CreateMeetingParameters.
 */
class CreateMeetingParameters extends BaseParameters
{
    /**
     * @var array
     */
    private $meeting = array();

    /**
     * @var array
     */
    private $meta = array();

    /**
     * CreateMeetingParameters constructor.
     *
     * @param $meetingId
     * @param $meetingName
     */
    public function __construct($meetingId, $meetingName)
    {
        $this->meetingId   = $meetingId;
        $this->meetingName = $meetingName;
    }

    /**
     * @param string $key
     *
     * @return mixed
     */
    public function get($key)
    {
        return $this->meeting[$key];
    }

    /**
     * @param string $key
     * @param mixed  $val
     *
     * @return CreateMeetingParameters
     */
    public function set($key, $val = '')
    {
        $this->meeting[$key] = $val;

        return $this;
    }


    /**
     * @return string
     */
    public function getMeta($key)
    {
        return $this->meta[$key];
    }

    /**
     * @param string $key
     * @param string $value
     *
     * @return CreateMeetingParameters
     */
    public function setMeta($key, $value)
    {
        /**
         * Remove prefix to assure the standard
         */
        $key = preg_replace('/^meta_/', '', $key);
        $this->meta[$key] = $value;

        return $this;
    }

    /**
     * @return string
     */
    public function getHTTPQuery()
    {
        $queries = $this->meeting;
        if (!empty($this->meta)) {
            foreach ($this->meta as $k => $v) {
                /**
                 * Append prefix to apply the standard
                 */
                $queries['meta_' . strtolower($k)] = $v;
            }
        }

        return $this->buildHTTPQuery($queries);
    }
}

By doing so, you don't have to deal with the typo/different property's name between the API and the response, eg: creationTime vs createTime.

Less work (even for developer), bulletproof API.

401 Session xxyyzz not found

I've set up my Working BBB about two weeks ago and a second one integrated in Moodle. Now I try to code my own little Joining-Tool for my custom requirements.
Used the "Full Usage Sample" to code my first example and direct join works well but with setRedirect(false) the URL with the sessionToken doesn't work: "401, not allowed, Session xxyyzz not found"

My Code (with modifyed URLs and Secret):
error_reporting(E_ALL);
ini_set('display_errors', 1);

$Username = "MyName";
$meetingId = "SuperMeeting1234";
$meetingName = "Welcome Meeting!";

$usertype="moderator"; # moderator/attendee

$passwords = array('moderator' => 'MyHiSecModPW', # Moderator-Passwort
'attendee' => 'MyHiSecAtPw'); # Teilnehmer-Passwort

putenv("BBB_SECRET=SessionKeyFromMyBBBServer");
putenv("BBB_SERVER_BASE_URL=https://bbb.myserver.com/bigbluebutton/");

require_once 'bbb-api/vendor/autoload.php';

use BigBlueButton\BigBlueButton;
use BigBlueButton\Parameters\CreateMeetingParameters;
use BigBlueButton\Parameters\JoinMeetingParameters;

// Init BigBlueButton API
$bbb = new BigBlueButton();

// Create the meeting
$createParams = new CreateMeetingParameters($meetingId, $meetingName);
$createParams = $createParams->setModeratorPassword($passwords['moderator'])
->setAttendeePassword($passwords['attendee']);
$bbb->createMeeting($createParams);

// Send a join meeting request
$joinParams = new JoinMeetingParameters($meetingId, $Username, $passwords[$usertype]);

// Ask for immediate redirection
// $joinParams->setRedirect(true);

// echo $bbb->getJoinMeetingURL($joinParams);

// Let the prorgrammer do the redirection later
$joinParams->setRedirect(false);
$joinResponse = $bbb->joinMeeting($joinParams);
// Prepare the server URL
$bbbServerUrl = "https://bbb.myserver.com";

echo '<br>Join-Link: <a target="_blank" href="'.$bbbServerUrl . '/html5client/join?sessionToken=' . $joinResponse->getSessionToken() . '">LinkiWinki</a>';

How to make checksum?

Hi everybody!

I'm trying to create meeting with Laravel. And have problem with checksum, who can write here a small instruction how to make request to create meeting with Laravel?

How to check if URL / Secret are right?

Thank you for that very clear API!
I am in the process of developing a BBB management tool for a CMS and with the methods I am currently applying, if the user entered a wrong SECRET in the configurations, they will only receive an unspecific XML error on the attempt to create a meeting.

I would like to have a way of confirming the correctness of the URL/SECRET combination and I thought that the ApiVersionCheck call would do so, but it works when only the URL is working.

Which function would you use for the checkup of URL/SECRET if there are no meetings running on the server?

Thank you for suggestions!

Node no longer exists when i call $meeting->getAttendees()

A PHP Error was encountered

Severity: Warning

Message: BigBlueButton\Core\Attendee::__construct(): Node no longer exists

Filename: Core/Attendee.php

Line Number: 83


code:

  $args = new GetMeetingInfoParameters($online_meeting->id,$online_meeting->moderator_password);
  $info = $bbb->getMeetingInfo($args);
    if($info->success()) {
      $meeting = $info->getMeeting();
      return (object)[
        'meetingId' => $meeting->getMeetingId(),
        'attendees' => $meeting->getAttendees()
      ];
  }

$info->getRawXml();

SimpleXMLElement Object
(
    [returncode] => SUCCESS
    [meetingName] => 55
    [meetingID] => f1de5900-8019-11ea-ab74-f1d4e0b38afa
    [internalMeetingID] => c913f715fa34eda7c0d61dd382d5bbbf12ec67fd-1587065969604
    [createTime] => 1587065969604
    [createDate] => Thu Apr 16 19:39:29 UTC 2020
    [voiceBridge] => 76257
    [dialNumber] => 613-555-1234
    [attendeePW] => f1de5902-8019-11ea-ab74-f1d4e0b38afa
    [moderatorPW] => f1de5901-8019-11ea-ab74-f1d4e0b38afa
    [running] => true
    [duration] => 320
    [hasUserJoined] => true
    [recording] => true
    [hasBeenForciblyEnded] => false
    [startTime] => 1587065969617
    [endTime] => 0
    [participantCount] => 2
    [listenerCount] => 0
    [voiceParticipantCount] => 0
    [videoCount] => 0
    [maxUsers] => 200
    [moderatorCount] => 1
    [attendees] => SimpleXMLElement Object
        (
            [attendee] => Array
                (
                    [0] => SimpleXMLElement Object
                        (
                            [userID] => 12991
                            [fullName] => Umut ÇELİK
                            [role] => MODERATOR
                            [isPresenter] => true
                            [isListeningOnly] => false
                            [hasJoinedVoice] => false
                            [hasVideo] => false
                            [clientType] => HTML5
                        )

                    [1] => SimpleXMLElement Object
                        (
                            [userID] => 12991
                            [fullName] => Umut ÇELİK
                            [role] => VIEWER
                            [isPresenter] => false
                            [isListeningOnly] => false
                            [hasJoinedVoice] => false
                            [hasVideo] => false
                            [clientType] => HTML5
                        )

                )

        )

    [metadata] => SimpleXMLElement Object
        (
            [bbb-recording-ready-url] => https://app.magistum.com/api/v1/webhook/bbb/hookname/RecordingReadyCallback
            [endcallbackurl] => https://app.magistum.com/api/v1/webhook/bbb/hookname/EndCallback
        )

    [isBreakout] => false
)

Instance of BBB used on test has wrong version

Hi @GhaziTriki

I was trying to fix test errors. See: #68

But when i'm trying to fix errors on statusCode responses I see that the instance of BBB that is used on test has a wrong version [1] ( testAPIVersion is broken, expected 2.0.0 and returned 0.9 )

Now, I dont know if its better to fix these test errors or if you can upgrade BBB instance using on test.

Feel free to close the issue if I'm wrong.

Thank you in advance!

[1] https://test-install.blindsidenetworks.com/bigbluebutton/api/

Failed to join (setRedirect = false)

Hello! I want to get right sessionToken to use it manualy. Code, I used:

$joinMeetingParams = new JoinMeetingParameters($m['meetingID'], $name, $pass);
if ($_POST['type'] == 'html5'){
    $joinMeetingParams->setJoinViaHtml5(true);
}
$joinMeetingParams->setRedirect(false);
$url = $bbb->getJoinMeetingURL($joinMeetingParams);
$joinMeetingResponse = $bbb->joinMeeting($joinMeetingParams);
var_dump($url,$joinMeetingResponse);

$url I got is
https://server/bigbluebutton/api/join?meetingID=356a192b7913b04c54574d18c28d46e6395428ab_8f9329121a2844579d346a7f5660372114b08ccf&fullName=Михаил&password=123456&redirect=false&joinViaHtml5=true&checksum=9bd0e52bb2d1cbce9f9ef508365ce80d361ac3b4
$joinMeetingResponse I got is:

BigBlueButton\Responses\JoinMeetingResponse Object
(
    [rawXml:protected] => SimpleXMLElement Object
        (
            [returncode] => SUCCESS
            [messageKey] => successfullyJoined
            [message] => You have joined successfully.
            [meeting_id] => fe17f66b402b8c178785ebc96fe2fb6e96b17b7a-1543763121613
            [user_id] => w_gxprjs9w5sdg
            [auth_token] => nrmw2bkmxxgo
            [session_token] => ljbp2qalayrpgs3p
        )

)

When i want to open manualy
https://server/bigbluebutton/api/enter?sessionToken=ljbp2qalayrpgs3p I got

{"response":{"returncode":"FAILED","message":"Could not find conference.","logoutURL":"https://server"}}

BUT WHEN i copy - paste $url to browser I see response like $joinMeetingResponse:

<response>
<returncode>SUCCESS</returncode>
<messageKey>successfullyJoined</messageKey>
<message>You have joined successfully.</message>
<meeting_id>
fe17f66b402b8c178785ebc96fe2fb6e96b17b7a-1543763121613
</meeting_id>
<user_id>w_d3oxc7tvmrqs</user_id>
<auth_token>8ekeftauoftf</auth_token>
<session_token>e09c8uqeq3lhsdbk</session_token>
</response>

Then i used token e09c8uqeq3lhsdbk and it works!
https://server/bigbluebutton/api/enter?sessionToken=e09c8uqeq3lhsdbk

{"response":{"returncode":"SUCCESS","fullname":"Михаил","confname":"Конференция \"Нейросети\"","meetingID":"fe17f66b402b8c178785ebc96fe2fb6e96b17b7a-1543763457759","externMeetingID":"356a192b7913b04c54574d18c28d46e6395428ab_8f9329121a2844579d346a7f5660372114b08ccf","externUserID":"w_6cepjew2ta42","internalUserID":"w_6cepjew2ta42","authToken":"byinyph7uahw","role":"MODERATOR","guest":false,"conference":"fe17f66b402b8c178785ebc96fe2fb6e96b17b7a-1543763457759","room":"fe17f66b402b8c178785ebc96fe2fb6e96b17b7a-1543763457759","voicebridge":"05635","dialnumber":"613-555-1234","webvoiceconf":"05635","mode":"LIVE","record":"false","isBreakout":false,"logoutTimer":0,"allowStartStopRecording":false,"welcome":"<br>Welcome to <b>Конференция \"Нейросети\"<\u002fb>!<br><br>For help on using BigBlueButton see these (short) <a href=\"event:http://www.bigbluebutton.org/content/videos\"><u>tutorial videos<\u002fu><\u002fa>.<br><br>To join the audio bridge click the phone button.  Use a headset to avoid causing background noise for others.<br><br><br>This server is running <a href=\"http://docs.bigbluebutton.org/\" target=\"_blank\"><u>BigBlueButton<\u002fu><\u002fa>.","customLogoURL":"","customCopyright":"","muteOnStart":false,"logoutUrl":"http://bbb.loc/conferences.html","defaultLayout":"NOLAYOUT","avatarURL":"https://server/client/avatar.png","customdata":[],"metadata":[{"html5autoswaplayout":"true"},{"html5autosharewebcam":"true"},{"html5hidepresentation":"true"}]}}

Where can be problem?

url_encode

Hello
There is a mistake on line 450 in the file CreateMeetingParameters in the method getPresentationsAsXML
there is a urlencode I know this function is use for special caracters but on the server side there is no urldecode and you can't upload file because you have a message : Malformed URL in BBB log.
If you remove the urlencode everything work fine

Thanks :-)
Fabrice

Fatal error: Uncaught RuntimeException: Unhandled curl error: Could not resolve host

Hi, I have this same problem in setting up the meeting.

Fatal error: Uncaught RuntimeException: Unhandled curl error: Could not resolve host: api in /var/www/html/bbb-api/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php:388 Stack trace: #0 /var/www/html/bbb-api/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php(101): BigBlueButton\BigBlueButton->processXmlResponse('api/create?name...', '') #1 /var/www/html/bbb-api/create-meeting.php(29): BigBlueButton\BigBlueButton->createMeeting(Object(BigBlueButton\Parameters\CreateMeetingParameters)) #2 {main} thrown in /var/www/html/bbb-api/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 388

Comment in getRecordingsWithXmlResponseArray() of the class BigBlueButton

Hi!
I think that there is a problem concerning the comment on the method getRecordingsWithXmlResponseArray() of the class BigBlueButton. Indeed, it said that it requires an array
"/* USAGE:
$recordingParams = array(
'meetingId' => '1234', -- OPTIONAL - comma separate if multiple ids
);"
However the method expects an input "$recordingParams" of type "GetRecordingsParameters" because the method "getHTTPQuery()" of the latter class is called in the line 203.
Sincerly yours

Querying attendees of meeting throws warning

Hi,

I noticed that querying attendees of a meeting throws the following warning:

Warning: BigBlueButton\Core\Attendee::__construct(): Node no longer exists

I used the following code to query the participants of the meeting (simplified and generalized):

         // $bigBlueButton is an instance of \BigBlueButton\BigBlueButton
         $response = $bigBlueButton->getMeetings();
        $serverMeetings = $response->getMeetings();
        
        foreach ($serverMeetings as $serverMeeting) {
            foreach ($serverMeeting->getAttendees() as $attendee) {
                $attendees[] = $attendee->getFullName();
            }
        }

The warning seems to be thrown whenever at least one attendee is in the meeting.

If I remove the following block from the BigBlueButton\Core\Attendee constructor, everything works fine:

        foreach ($xml->customdata->children() as $data) {
            $this->customData[$data->getName()] = $data->__toString();
        }

Tested PHP versions: 7.3 and 7.4.

Getting response code FAILED for getMeetingInfo

I am trying to use credentials from api-mate and trying to create metting in localhost using Laravel framework, I am getting FAILED as response code for getMeetingInfo and meeting ID for createMeeting can you give some idea how I should proceed?

It is actually returning 404 error, that is what I got when I dumped $data in processXmlResponse() .

Wrong code in example

The line

$response = $bbb->createMeeting(createMeetingParams);

must be

$response = $bbb->createMeeting($createMeetingParams);

setConfigXML returns 500 Internal Server Error

I'm trying to use setConfigXML API, but it returns 500 Internal Server Error.

<!DOCTYPE html>
<!--[if lt IE 7 ]>
<html lang="en" class="no-js ie6">
    <![endif]-->
    <!--[if IE 7 ]>
    <html lang="en" class="no-js ie7">
        <![endif]-->
        <!--[if IE 8 ]>
        <html lang="en" class="no-js ie8">
            <![endif]-->
            <!--[if IE 9 ]>
            <html lang="en" class="no-js ie9">
                <![endif]-->
                <!--[if (gt IE 9)|!(IE)]>
                <!-->
                <html lang="en" class="no-js">
                    <!--
                    <![endif]-->
                    <head>
                        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
                        <title>Error</title>
                        <meta name="viewport" content="width=device-width, initial-scale=1.0">
                        <link rel="shortcut icon" href="/bigbluebutton/static/images/favicon.ico" type="image/x-icon">
                        <link rel="apple-touch-icon" href="/bigbluebutton/static/images/apple-touch-icon.png">
                        <link rel="apple-touch-icon" sizes="114x114" href="/bigbluebutton/static/images/apple-touch-icon-retina.png">
                        <link rel="stylesheet" href="/bigbluebutton/static/css/main.css" type="text/css">
                        <link rel="stylesheet" href="/bigbluebutton/static/css/mobile.css" type="text/css">
                        <meta name="layout" content="main">




                    </head>
                    <body>
                        <div id="grailsLogo" role="banner">
                            <a href="http://grails.org">
                                <img src="/bigbluebutton/static/images/grails_logo.png" alt="Grails"/>
                            </a>
                        </div>
                        <ul class="errors">
                            <li>An error has occurred</li>

                        </ul>
                        <div class="footer" role="contentinfo"></div>
                        <div id="spinner" class="spinner" style="display:none;">Loading&hellip;</div>
                        <script src="/bigbluebutton/static/js/application.js" type="text/javascript" ></script>


                    </body>
                </html>

What I've set were:

  1. set the URL up: meetingID=...&configXML=...&checksum=...
  2. content-type to application/x-www-form-urlencoded
  3. post field body as same as the URL (http_build_query($postFields)).

Is there something I missed?
Thanks ahead!

Use of foreach to iterate over a simple Object in GetMeetingInfoResponse

Hi!
I'am a new user of your project. I think that there is a mistake in the line 69 of the file GetMeetingInfoResponse: foreach ($this->rawXml->attendees->attendee as $attendeeXml) {
I guess that you meant $this->rawXml->attendees because it is a traversable object.
Besides at the line 68 $this->attendess = [];, there is not such property in the class GetMeetingInfoResponse and it is never used. I suppose that it is simply a spelling mistake and that you meant $this->attendees[].
Sincerely yours

Join Failed

I tried

$meInfo2 = new \BigBlueButton\Parameters\JoinMeetingParameters($meetId, '***','***');
$meInfo2->setRedirect(true);
$meInfo2->setJoinViaHtml5(true);
$new =$bbb->joinMeeting($meInfo2);

I received

PHP Fatal error:  Uncaught Exception: String could not be parsed as XML in /home/igor/PhpstormProjects/testesbbb/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php:392
Stack trace:
#0 /home/igor/PhpstormProjects/testesbbb/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php(392): SimpleXMLElement->__construct('')
#1 /home/igor/PhpstormProjects/testesbbb/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php(165): BigBlueButton\BigBlueButton->processXmlResponse('http://192.168....')
#2 /home/igor/PhpstormProjects/testesbbb/index.php(44): BigBlueButton\BigBlueButton->joinMeeting(Object(BigBlueButton\Parameters\JoinMeetingParameters))
#3 {main}
  thrown in /home/igor/PhpstormProjects/testesbbb/vendor/bigbluebutton/bigbluebutton-api-php/src/BigBlueButton.php on line 392

But I have
https://3v4l.org/V4L68

The method getJoinMeetinURL works fine.

My php version: 7.2
OS: ubuntu 18.04
BBB on docker demo
bigbluebutton-api-php: ~2.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.