PHP API FOR recording ! please help

548 views
Skip to first unread message

Abas roshan

unread,
Sep 15, 2012, 12:04:49 PM9/15/12
to bigblueb...@googlegroups.com
hi my freind
more than a week
i use new php api for recording
everything work great but not about recording
this is inside php file
i send all parameter for recording but nothing happend


<?php
session_start();
if(@$_SESSION['username'])
{
?>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="../css/main.css">
<script type="text/javascript" charset="utf-8">

</script>
</head>

<body id="joinifrunning" onLoad="">
<div id="main">
<?php
/* _____ PHP Big Blue Button API Usage ______
* by Peter Mentzer pe...@petermentzerdesign.com
* Use, modify and distribute however you like.
*/

// Require the bbb-api file:
require('bbb_api.php');
require('bbb_api_conf.php');
include_once('./inc/public_class_inc.php');
$con = @connect_database($HOST_NAME,$MYSQL_USERNAME,$MYSQL_PASSWORD,$DATABASE_NAME);
$bbb = new BigBlueButton();






$room = $_GET['room'];
$mp1 ="123456".$room; $ap1 = "567890".$room;
$rname = $_GET['rname'];
$user = $_GET['user'];
$isadmin = $_GET['isadmin'];
if($isadmin == "moderate")
$mp = $user;
else
$ap = $user;
$record = $_GET['record'];

if(intval($record) == 1)
    $record = "true";
else
    $record = "false";
//$meetings[$joinData[0]] = array('meetingID' => "$room", 'moderatorPW' => "$mp", 'attendeePW' =>"$ap");

try {$result = $bbb->isMeetingRunningWithXmlResponseArray("$room");}
catch (Exception $e) {
//echo 'Caught exception1: ', $e->getMessage(), "\n";
$itsAllGood = false;
}

if($result['running']=="false")
{

$creationParams = array(
'meetingId' => $room, // REQUIRED
'meetingName' => "$rname", // REQUIRED
'attendeePw' => "$ap1", // Match this value in getJoinMeetingURL() to join as attendee.
'moderatorPw' => "$mp1", // Match this value in getJoinMeetingURL() to join as moderator.
'welcomeMsg' => '', // ''= use default. Change to customize.
'dialNumber' => '', // The main number to call into. Optional.
'voiceBridge' => '', // PIN to join voice. Optional.
'webVoice' => '', // Alphanumeric to join voice. Optional.
'logoutUrl' => '', // Default in bigbluebutton.properties. Optional.
'maxParticipants' => '-1', // Optional. -1 = unlimitted. Not supported in BBB. [number]
'record' => "$record", // New. 'true' will tell BBB to record the meeting.
'duration' => '0' // Default = 0 which means no set duration in minutes. [number]
//'meta_category' => '', // Use to pass additional info to BBB server. See API docs.
);

// Create the meeting and get back a response:
$itsAllGood = true;
try {$result = $bbb->createMeetingWithXmlResponseArray($creationParams);}
catch (Exception $e) {
//echo 'Caught exception2: ', $e->getMessage(), "\n";
$itsAllGood = false;
}

if ($itsAllGood == true) {
// If it's all good, then we've interfaced with our BBB php api OK:
if ($result == null) {
// If we get a null response, then we're not getting any XML back from BBB.
//echo "Failed to get any response. Maybe we can't contact the BBB server.";
}
else {
// We got an XML response, so let's see what it says:
//print_r($result);
if ($result['returncode'] == 'SUCCESS') {
// Then do stuff ...
//echo "<p>Meeting succesfullly created.</p>";
//////////////////////////////////////////////////////////////
$creationParams = array(
    'meetingId' => "$room",                 // REQUIRED
    'meetingName' => "$rname", // REQUIRED
    'attendeePw' => "$ap1", // Match this value in getJoinMeetingURL() to join as attendee.
    'moderatorPw' => "$mp1",
    'welcomeMsg' => '', // ''= use default. Change to customize.
'dialNumber' => '', // The main number to call into. Optional.
'voiceBridge' => '', // PIN to join voice. Optional.
'webVoice' => '', // Alphanumeric to join voice. Optional.
'logoutUrl' => '', // Default in bigbluebutton.properties. Optional.
'maxParticipants' => '-1', // Optional. -1 = unlimitted. Not supported in BBB. [number]
'record' => "$record", // New. 'true' will tell BBB to record the meeting.
'duration' => '0',
);

// Create the meeting and get back a response:
$itsAllGood = true;
try {$result = $bbb->createMeetingWithXmlResponseArray($creationParams);}
    catch (Exception $e) {
        echo 'Caught exception: ', $e->getMessage(), "\n";
        $itsAllGood = false;
    }

if ($itsAllGood == true) {
    // If it's all good, then we've interfaced with our BBB php api OK:
    if ($result == null) {
        // If we get a null response, then we're not getting any XML back from BBB.
        echo "Failed to get any response. Maybe we can't contact the BBB server.";
    }   
    else {
    // We got an XML response, so let's see what it says:
    print_r($result);
        if ($result['returncode'] == 'SUCCESS') {
            // Then do stuff ...
            echo "<p>Meeting succesfullly created.fesfes</p>";
        }
        else {
            echo "<p>Meeting creation failed.</p>";
        }
    }
}

//////////////////////////////////////////////////////////////
}
else {
//echo "<p>Meeting creation failed.</p>";
}
}
}

}

if($isadmin == "moderate")
$joinParams = array(
'meetingId' => "$room", // REQUIRED - We have to know which meeting to join.
'username' => "$user", // REQUIRED - The user display name that will show in the BBB meeting.
'password' => "123456".$room, // REQUIRED - Must match either attendee or moderator pass for meeting.
'createTime' => '', // OPTIONAL - string
'userId' => '', // OPTIONAL - string
'webVoiceConf' => '' // OPTIONAL - string
);
else
$joinParams = array(
'meetingId' => "$room", // REQUIRED - We have to know which meeting to join.
'username' => "$user", // REQUIRED - The user display name that will show in the BBB meeting.
'password' => "567890".$room, // REQUIRED - Must match either attendee or moderator pass for meeting.
'createTime' => '', // OPTIONAL - string
'userId' => '', // OPTIONAL - string
'webVoiceConf' => '' // OPTIONAL - string
);


//echo json_encode($joinParams);
//exit;
// Get the URL to join meeting:
$itsAllGood = true;
try {$result = $bbb->getJoinMeetingURL($joinParams);}
catch (Exception $e) {
//echo 'Caught exception3: ', $e->getMessage(), "\n";
$itsAllGood = false;
}

if ($itsAllGood == true) {
//Output results to see what we're getting:
//print_r($result);
}
?>

</div>
</body>
<?php
echo "<script>location.href='$result';</script>";
}
?>

HostBBB.com

unread,
Sep 20, 2012, 10:37:19 AM9/20/12
to BigBlueButton-dev
Abas,

Not sure about the origin of this script or debuggng it for you? But
you can watch the nginx log to make sure the record parameter is being
passed properly to server with the create command.

If if is creating the meeting with the recording set, then use sudo
bbb-record command to list and watch the processing of recordings and
look for errors.

Lastly, use Omars apibuddy (google it) and call getrecordings to see
if any recordings exist on the server... Maybe the recordings exist
and you dont have code to fetch them workig properly.

I see this post was sent 5 days ago, I hate to see one go unanswered,
but providing more details on what version your running, and what you
have tried so far yourself to troubleshoot the problem will allow
someone to help and respond to your questions quicker.

Regards,
Stephen
http://hostbbb.com






On Sep 15, 12:04 pm, Abas roshan <roshan.engineer2...@gmail.com>
wrote:
> @connect_database($HOST_NAME,$MYSQL_USERNAME,$MYSQL_PASSWORD,$DATABASE_NAME­);

Fred Dixon

unread,
Sep 23, 2012, 2:01:05 PM9/23/12
to bigblueb...@googlegroups.com
Hi Abas,

It would be (much) easier for others to help with your code if you could provide a stand-alone version.   Also, in the future use pastebin to share code as posting to the mailing list causes the code to word wrap.

While we were not able to run your code, from what we can tell, it's not clear that your passing the '&record=true' parameter to the BigBlueButton API.  More specifically, you may not be passing true in

'record' => "$record", // New. 'true' will tell BBB to record the meeting.

An example of creating a meeting with recording is here



When you run your code, you can watch for the parameters received by the BigBlueButton server by monitoring bbb-web.log

  tail -f /var/log/bigbluebutton/bbb-web.log

All API calls are logged to bbb-web.log.  When you try running your code, check parameters of the create API call in this log file to ensure it passes record=true.  Here's a log of sample API create call 


2012-09-23 12:56:41,405 DEBUG [grails.app.controller.org.bigbluebutton.web.controllers.ApiController] - ApiController#create
2012-09-23 12:56:41,405 DEBUG [org.bigbluebutton.api.ParamsProcessorUtil] - checksum: [a21e75b58905406cf8dbd04d84e3603846ff5b] ; query string: [name=Breakout&meetingID=bbblauncher_Pc1Smw_x4hmiPadXRH-3aw&moderatorPW=pk3Q4wRr0rlG-NSgbceBlg&attendeePW=iCx4I4Ugs_JHC8B3E92IqA&welcome=Lots+of+new+ideas%21&dialNumber=51405&logoutURL=http%3A%2F%2Fhmyserver.com%2F&record=true&checksum=a21e75b58905406cf8dbd04d8433e3603846ff5b]

Notice the

  &record=true

in the above API call.

Try monitoring bbb-web.log after you make your API call and let us know if you see &record=true.



Regards,...  Fred
-- 
BigBlueButton Developer
BigBlueButton on twitter: @bigbluebutton






--
You received this message because you are subscribed to the Google Groups "BigBlueButton-dev" group.
To post to this group, send email to bigblueb...@googlegroups.com.
To unsubscribe from this group, send email to bigbluebutton-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bigbluebutton-dev?hl=en.




Sam

unread,
Sep 23, 2012, 11:30:39 PM9/23/12
to bigblueb...@googlegroups.com
You could also try executing:

  bbb-record --list

on the BBB server as this gives some good information about the state of recordings if any exist.


sam.

Fred Dixon

unread,
Sep 23, 2012, 11:46:56 PM9/23/12
to bigblueb...@googlegroups.com
You can also use 

  bbb-record --watch

to monitor the processing of recordings by BigBlueButton.  Type

  bbb-record

to receive a full list of options.

Regards,... Fred

--
You received this message because you are subscribed to the Google Groups "BigBlueButton-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/bigbluebutton-dev/-/D-HeFoN01NoJ.

To post to this group, send email to bigblueb...@googlegroups.com.
To unsubscribe from this group, send email to bigbluebutton-...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bigbluebutton-dev?hl=en.
Reply all
Reply to author
Forward
0 new messages