Add conference recording play and download. Change the dialplan from lua conference_center.lua to lua 'app.lua conference_center'. Add a few more conference center permissions.

This commit is contained in:
Mark Crane
2013-02-27 10:10:24 +00:00
parent a9abe08db9
commit a9698425df
7 changed files with 134 additions and 56 deletions

View File

@@ -80,6 +80,11 @@
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$apps[$x]['permissions'][$y]['groups'][] = 'user';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'conference_session_play';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$apps[$x]['permissions'][$y]['groups'][] = 'user';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'conference_room_profile';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
@@ -110,6 +115,11 @@
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$apps[$x]['permissions'][$y]['groups'][] = 'user';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'conference_room_sounds';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';
$apps[$x]['permissions'][$y]['groups'][] = 'user';
$y++;
$apps[$x]['permissions'][$y]['name'] = 'conference_room_enabled';
$apps[$x]['permissions'][$y]['groups'][] = 'superadmin';
$apps[$x]['permissions'][$y]['groups'][] = 'admin';

View File

@@ -193,7 +193,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//<action application="lua" />
$dialplan_detail_tag = 'action'; //condition, action, antiaction
$dialplan_detail_type = 'lua';
$dialplan_detail_data = 'conference_center.lua';
$dialplan_detail_data = 'app.lua conference_center';
$dialplan_detail_order = '020';
$dialplan_detail_group = '2';
dialplan_detail_add($_SESSION['domain_uuid'], $dialplan_uuid, $dialplan_detail_tag, $dialplan_detail_order, $dialplan_detail_group, $dialplan_detail_type, $dialplan_detail_data);
@@ -201,9 +201,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//save the xml
save_dialplan_xml();
//apply settings reminder
$_SESSION["reload_xml"] = true;
//redirect the browser
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_centers.php\">\n";
@@ -254,7 +251,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//update dialplan detail action
$dialplan_detail_type = 'lua';
$dialplan_detail_data = 'conference_center.lua';
$dialplan_detail_data = 'app.lua conference_center';
$sql = "update v_dialplan_details set ";
$sql .= "dialplan_detail_type = '".$dialplan_detail_type."', ";
$sql .= "dialplan_detail_data = '".$dialplan_detail_data."' ";
@@ -274,9 +271,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//save the xml
save_dialplan_xml();
//apply settings reminder
$_SESSION["reload_xml"] = true;
//redirect the browser
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=conference_centers.php\">\n";

View File

@@ -652,7 +652,12 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " <tr>\n";
echo " <td class='vtable'>".$field['username']."</td>\n";
echo " <td style='width : 25px;' align='right'>\n";
echo " <a href='conference_room_edit.php?meeting_user_uuid=".$field['meeting_user_uuid']."&conference_room_uuid=".$conference_room_uuid."&a=delete' alt='delete' onclick=\"return confirm(".$text['confirm-delete'].")\">$v_link_label_delete</a>\n";
if ($result_count > 1) {
echo " <a href='conference_room_edit.php?meeting_user_uuid=".$field['meeting_user_uuid']."&conference_room_uuid=".$conference_room_uuid."&a=delete' alt='delete' onclick=\"return confirm(".$text['confirm-delete'].")\">$v_link_label_delete</a>\n";
}
else {
echo " &nbsp;";
}
echo " </td>\n";
echo " </tr>\n";
}
@@ -892,30 +897,32 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-sounds'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='sounds'>\n";
echo " <option value=''></option>\n";
if ($sounds == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
if (permission_exists('conference_room_sounds')) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-sounds'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='sounds'>\n";
echo " <option value=''></option>\n";
if ($sounds == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($sounds == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($sounds == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";

View File

@@ -184,7 +184,9 @@ else {
echo th_order_by('sounds', $text['label-sounds'], $order_by, $order);
echo "<th>".$text['label-members']."</th>\n";
echo "<th>".$text['label-tools']."</th>\n";
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order);
if (permission_exists('conference_room_enabled')) {
echo th_order_by('enabled', $text['label-enabled'], $order_by, $order);
}
echo th_order_by('description', $text['label-description'], $order_by, $order);
echo "<td align='right' width='42' nowrap='nowrap'>\n";
if (permission_exists('conference_room_add')) {
@@ -275,15 +277,17 @@ else {
echo " <a href='conference_sessions.php?id=".$row['meeting_uuid']."'>".$text['label-sessions']."</a>\n";
echo " </td>\n";
echo " <td valign='middle' class='".$row_style[$c]."'>";
if ($row['enabled'] == "true") {
echo " <a href=\"?conference_room_uuid=".$row['conference_room_uuid']."&enabled=false\">".$text['label-true']."</a>";
if (permission_exists('conference_room_enabled')) {
echo " <td valign='middle' class='".$row_style[$c]."'>";
if ($row['enabled'] == "true") {
echo " <a href=\"?conference_room_uuid=".$row['conference_room_uuid']."&enabled=false\">".$text['label-true']."</a>";
}
else {
echo " <a href=\"?conference_room_uuid=".$row['conference_room_uuid']."&enabled=true\">".$text['label-false']."</a>";
}
echo " &nbsp;\n";
echo " </td>\n";
}
else {
echo " <a href=\"?conference_room_uuid=".$row['conference_room_uuid']."&enabled=true\">".$text['label-false']."</a>";
}
echo " &nbsp;\n";
echo " </td>\n";
echo " <td valign='middle' class='row_stylebg' width='20%'>";
echo " ".$row['description']."\n";
@@ -291,6 +295,7 @@ else {
echo " </td>\n";
echo " <td valign='top' align='right' nowrap='nowrap'>\n";
echo " &nbsp;\n";
if (permission_exists('conference_room_edit')) {
echo " <a href='conference_room_edit.php?id=".$row['conference_room_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
}

View File

@@ -48,6 +48,32 @@ else {
$order = check_str($_GET["order"]);
$conference_session_uuid = check_str($_GET["uuid"]);
//add meeting_uuid to a session variable
if (strlen($conference_session_uuid) > 0) {
$_SESSION['meeting']['session_uuid'] = $conference_session_uuid;
}
//get the list
$sql = "select * from v_conference_sessions ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '".$_SESSION['meeting']['session_uuid']."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll();
foreach ($result as &$row) {
$meeting_uuid = $row["meeting_uuid"];
$recording = $row["recording"];
$start_epoch = $row["start_epoch"];
$end_epoch = $row["end_epoch"];
$profile = $row["profile"];
}
unset ($prep_statement);
//set the year, month and day based on the session start epoch
$tmp_year = date("Y", $start_epoch);
$tmp_month = date("M", $start_epoch);
$tmp_day = date("d", $start_epoch);
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
@@ -58,7 +84,32 @@ else {
echo "<table width='100%' border='0'>\n";
echo " <tr>\n";
echo " <td width='50%' align='left' nowrap='nowrap'><b>".$text['title-conference-session-details']."</b></td>\n";
echo " <td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='conference_sessions.php'\" value='".$text['button-back']."'></td>\n";
echo " <td width='70%' align='right'>\n";
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_name = '';
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
$tmp_name = $row['conference_session_uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.wav')) {
$tmp_name = $row['conference_session_uuid'].".wav";
}
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name)) {
if (permission_exists('conference_session_play')) {
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('".PROJECT_PATH."/app/recordings/recordings_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
//echo " ".$text['label-play']."\n";
echo " <input type='button' class='btn' name='' alt='".$text['label-play']."' onclick=\"\" value='".$text['label-play']."'></a>\n";
//echo " \n";
echo " &nbsp;\n";
}
echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
//echo " ".$text['label-download']."\n";
echo " <input type='button' class='btn' name='' alt='".$text['label-download']."' onclick=\"\" value='".$text['label-download']."'></a>\n";
//echo " \n";
//echo " <input type='button' class='btn' name='' alt='".$text['label-download']."' onclick=\"window.location='".PROJECT_PATH."/app/recordings/recordings_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."'\" value='".$text['label-download']."'>\n";
echo " &nbsp;\n";
}
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='conference_sessions.php'\" value='".$text['button-back']."'>\n";
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align='left' colspan='2'>\n";
@@ -70,7 +121,7 @@ else {
//prepare to page the results
$sql = "select count(*) as num_rows from v_conference_session_details ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '$conference_session_uuid' ";
$sql .= "and conference_session_uuid = '".$_SESSION['meeting']['session_uuid']."' ";
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
@@ -94,7 +145,7 @@ else {
//get the list
$sql = "select * from v_conference_session_details ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and conference_session_uuid = '$conference_session_uuid' ";
$sql .= "and conference_session_uuid = '".$_SESSION['meeting']['session_uuid']."' ";
if (strlen($order_by) == 0) {
$sql .= "order by start_epoch asc ";
}

View File

@@ -48,6 +48,11 @@ else {
$order_by = check_str($_GET["order_by"]);
$order = check_str($_GET["order"]);
//add meeting_uuid to a session variable
if (strlen($meeting_uuid) > 0) {
$_SESSION['meeting']['uuid'] = $meeting_uuid;
}
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
@@ -70,7 +75,7 @@ else {
//prepare to page the results
$sql = "select count(*) as num_rows from v_conference_sessions ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and meeting_uuid = '$meeting_uuid' ";
$sql .= "and meeting_uuid = '".$_SESSION['meeting']['uuid']."' ";
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
@@ -94,7 +99,7 @@ else {
//get the list
$sql = "select * from v_conference_sessions ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and meeting_uuid = '$meeting_uuid' ";
$sql .= "and meeting_uuid = '".$_SESSION['meeting']['uuid']."' ";
if (strlen($order_by) == 0) {
$sql .= "order by start_epoch desc ";
}
@@ -149,20 +154,22 @@ else {
echo " <td valign='top' class='".$row_style[$c]."'>".$row['profile']."&nbsp;</td>\n";
$tmp_dir = $_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day;
$tmp_name = '';
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.wav')) {
$tmp_name = $row['conference_session_uuid'].".wav";
}
elseif (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
if (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.mp3')) {
$tmp_name = $row['conference_session_uuid'].".mp3";
}
elseif (file_exists($tmp_dir.'/'.$row['conference_session_uuid'].'.wav')) {
$tmp_name = $row['conference_session_uuid'].".wav";
}
echo " <td valign='top' class='".$row_style[$c]."'>\n";
echo " <a href='conference_session_details.php?uuid=".$row['conference_session_uuid']."'>".$text['label-details']."</a>&nbsp;\n";
if (strlen($tmp_name) > 0 && file_exists($tmp_dir.'/'.$tmp_name)) {
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('".PROJECT_PATH."/app/recordings/v_recordings_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
echo " ".$text['label-play']."\n";
echo " </a>\n";
echo " &nbsp;\n";
echo " <a href=\"../recordings/v_recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
if (permission_exists('conference_session_play')) {
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('".PROJECT_PATH."/app/recordings/recordings_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
echo " ".$text['label-play']."\n";
echo " </a>\n";
echo " &nbsp;\n";
}
echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
echo " ".$text['label-download']."\n";
echo " </a>\n";
echo " &nbsp;\n";

View File

@@ -68,7 +68,11 @@
if (!if_group("admin") && !if_group("superadmin")) {
$sql .= "and u.user_uuid = '".$_SESSION["user_uuid"]."' ";
}
if (strlen($this->order_by)> 0) { $sql .= "order by $this->order_by $this->order "; }
if (strlen($this->order_by) == 0) {
$sql .= "order by description, meeting_uuid asc ";
} else {
$sql .= "order by $this->order_by $this->order ";
}
$sql .= "limit $this->rows_per_page offset $this->offset ";
$prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement->execute();