2012-06-04 16:58:40 +02:00
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
FusionPBX
|
|
|
|
|
Version: MPL 1.1
|
|
|
|
|
|
|
|
|
|
The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
http://www.mozilla.org/MPL/
|
|
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
for the specific language governing rights and limitations under the
|
|
|
|
|
License.
|
|
|
|
|
|
|
|
|
|
The Original Code is FusionPBX
|
|
|
|
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
|
|
|
|
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
|
|
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Contributor(s):
|
|
|
|
|
Mark J Crane <markjcrane@fusionpbx.com>
|
2012-11-24 18:58:54 +01:00
|
|
|
James Rose <james.o.rose@gmail.com>
|
2012-06-04 16:58:40 +02:00
|
|
|
*/
|
|
|
|
|
include "root.php";
|
2013-07-06 08:03:27 +02:00
|
|
|
require_once "resources/require.php";
|
2013-07-06 07:50:55 +02:00
|
|
|
require_once "resources/check_auth.php";
|
2015-02-12 03:09:59 +01:00
|
|
|
if (permission_exists('conference_interactive_view')) {
|
2012-06-04 16:58:40 +02:00
|
|
|
//access granted
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
echo "access denied";
|
|
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-24 18:58:54 +01:00
|
|
|
//add multi-lingual support
|
2015-01-18 11:06:08 +01:00
|
|
|
$language = new text;
|
|
|
|
|
$text = $language->get();
|
2012-11-24 18:58:54 +01:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
//get the http get or post and set it as php variables
|
2013-02-02 10:54:20 +01:00
|
|
|
$conference_uuid = check_str($_REQUEST["c"]);
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//replace the space with underscore
|
2017-04-17 17:01:04 +02:00
|
|
|
$conference_name = $conference_uuid.'@'.$_SESSION['domain_name'];
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
//create the conference list command
|
|
|
|
|
$switch_cmd = "conference '".$conference_name."' xml_list";
|
|
|
|
|
|
|
|
|
|
//connect to event socket, send the command and process the results
|
|
|
|
|
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
|
|
|
|
if (!$fp) {
|
2014-06-21 12:54:37 +02:00
|
|
|
$msg = "<div align='center'>".$text['message-connection']."<br /></div>";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<div align='center'>\n";
|
|
|
|
|
echo "<table width='40%'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2012-11-24 18:58:54 +01:00
|
|
|
echo "<th align='left'>".$text['label-message']."</th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td class='row_style1'><strong>$msg</strong></td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "</div>\n";
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//show the content
|
|
|
|
|
$xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
|
2016-04-30 01:55:27 +02:00
|
|
|
if (substr($xml_str, -9) == "not found") {
|
|
|
|
|
$valid_xml = false;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2016-04-30 01:55:27 +02:00
|
|
|
else {
|
|
|
|
|
$valid_xml = true;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2016-04-30 01:55:27 +02:00
|
|
|
if ($valid_xml) {
|
|
|
|
|
try {
|
|
|
|
|
$xml = new SimpleXMLElement($xml_str);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception $e) {
|
|
|
|
|
//echo $e->getMessage();
|
|
|
|
|
}
|
|
|
|
|
//$name = $xml->conference['name'];
|
|
|
|
|
$session_uuid = $xml->conference['uuid'];
|
|
|
|
|
$member_count = $xml->conference['member-count'];
|
|
|
|
|
$locked = $xml->conference['locked'];
|
|
|
|
|
$recording = $xml->conference['recording'];
|
|
|
|
|
if (strlen($member_count) == 0) {
|
|
|
|
|
$member_count = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//get mute_all
|
|
|
|
|
$mute_all = "true";
|
|
|
|
|
foreach ($xml->conference->members->member as $row) {
|
|
|
|
|
if ($row->flags->is_moderator == "false") {
|
|
|
|
|
if ($row->flags->can_speak == "true") {
|
|
|
|
|
$mute_all = "false";
|
|
|
|
|
}
|
2013-02-02 10:54:20 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-04 16:58:40 +02:00
|
|
|
$c = 0;
|
|
|
|
|
$row_style["0"] = "row_style0";
|
|
|
|
|
$row_style["1"] = "row_style1";
|
|
|
|
|
|
2015-02-05 01:43:17 +01:00
|
|
|
echo "<div id='cmd_reponse'></div>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
|
|
|
|
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
|
|
|
|
echo "<tr>\n";
|
2015-02-25 21:38:24 +01:00
|
|
|
echo " <td>";
|
|
|
|
|
echo " <strong style='color: #000;'>".$text['label-members'].": ".$member_count."</strong>\n";
|
|
|
|
|
echo " </td>\n";
|
|
|
|
|
echo "<td align='right'>\n";
|
2012-10-27 04:01:36 +02:00
|
|
|
|
2015-12-06 21:37:35 +01:00
|
|
|
$recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d");
|
2012-10-27 04:01:36 +02:00
|
|
|
$recording_name = '';
|
|
|
|
|
if (file_exists($recording_dir.'/'.$row['uuid'].'.wav')) {
|
|
|
|
|
$recording_name = $session_uuid.".wav";
|
|
|
|
|
}
|
|
|
|
|
elseif (file_exists($recording_dir.'/'.$row['uuid'].'.mp3')) {
|
|
|
|
|
$recording_name = $session_uuid.".mp3";
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-05 01:43:17 +01:00
|
|
|
echo "<img src='resources/images/".(($recording == "true") ? "recording.png" : "not_recording.png")."' style='width: 16px; height: 16px; border: none;' align='absmiddle' title=\"".$text['label-'.(($recording == "true") ? 'recording' : 'not-recording')]."\"> ";
|
|
|
|
|
|
2015-02-12 03:09:59 +01:00
|
|
|
if (permission_exists('conference_interactive_lock')) {
|
2015-02-25 21:38:24 +01:00
|
|
|
$action_locked = ($locked == "true") ? 'unlock' : 'lock';
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=".$action_locked."');\" value='".$text['label-'.$action_locked]."'>\n";
|
2013-02-02 10:54:20 +01:00
|
|
|
}
|
2015-02-25 21:38:24 +01:00
|
|
|
if (permission_exists('conference_interactive_mute')) {
|
|
|
|
|
$action_mute_all = ($mute_all == "true") ? 'unmute' : 'mute';
|
|
|
|
|
echo " <input type='button' class='btn' title=\"".$text['label-mute-all-alt']."\" onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=".$action_mute_all."+non_moderator');\" value='".$text['label-'.$action_mute_all.'-all']."'>\n";
|
2013-02-02 10:54:20 +01:00
|
|
|
}
|
2015-02-25 21:38:24 +01:00
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=kick+all');\" value='".$text['label-end-conference']."'>\n";
|
2013-02-01 16:49:37 +01:00
|
|
|
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
2015-02-25 21:38:24 +01:00
|
|
|
echo "</table>\n";
|
|
|
|
|
echo "<br />\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
|
2015-02-25 21:38:24 +01:00
|
|
|
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "<tr>\n";
|
2015-02-25 21:38:24 +01:00
|
|
|
echo "<th width='1'> </th>\n";
|
2012-11-24 18:58:54 +01:00
|
|
|
echo "<th>".$text['label-cid-name']."</th>\n";
|
|
|
|
|
echo "<th>".$text['label-cid-num']."</th>\n";
|
2015-02-25 21:38:24 +01:00
|
|
|
echo "<th>".$text['label-capabilities']."</th>\n";
|
2012-11-24 18:58:54 +01:00
|
|
|
echo "<th>".$text['label-joined']."</th>\n";
|
2015-02-25 21:38:24 +01:00
|
|
|
echo "<th>".$text['label-quiet']."</th>\n";
|
2012-11-24 18:58:54 +01:00
|
|
|
echo "<th>".$text['label-floor']."</th>\n";
|
2015-02-25 21:38:24 +01:00
|
|
|
echo "<th> </th>\n";
|
2012-06-04 16:58:40 +02:00
|
|
|
echo "</tr>\n";
|
|
|
|
|
|
2016-04-30 01:55:27 +02:00
|
|
|
if ($valid_xml) {
|
|
|
|
|
if (isset($xml->conference->members->member)) foreach ($xml->conference->members->member as $row) {
|
|
|
|
|
$id = $row->id;
|
|
|
|
|
$record_path = $row->record_path;
|
|
|
|
|
$flag_can_hear = $row->flags->can_hear;
|
|
|
|
|
$flag_can_speak = $row->flags->can_speak;
|
|
|
|
|
$flag_talking = $row->flags->talking;
|
|
|
|
|
$last_talking = $row->last_talking;
|
|
|
|
|
$join_time = $row->join_time;
|
|
|
|
|
$flag_has_video = $row->flags->has_video;
|
|
|
|
|
$flag_has_floor = $row->flags->has_floor;
|
|
|
|
|
$is_moderator = $row->flags->is_moderator;
|
|
|
|
|
$uuid = $row->uuid;
|
|
|
|
|
$caller_id_name = $row->caller_id_name;
|
|
|
|
|
$caller_id_name = urldecode($caller_id_name);
|
|
|
|
|
$caller_id_number = $row->caller_id_number;
|
|
|
|
|
|
|
|
|
|
//format seconds
|
|
|
|
|
$join_time_formatted = sprintf('%02d:%02d:%02d', ($join_time/3600), ($join_time/60%60), $join_time%60);
|
|
|
|
|
$last_talking_formatted = sprintf('%02d:%02d:%02d', ($last_talking/3600), ($last_talking/60%60), $last_talking%60);
|
|
|
|
|
|
|
|
|
|
if (strlen($record_path) == 0) {
|
2015-02-12 03:09:59 +01:00
|
|
|
if (permission_exists('conference_interactive_mute')) {
|
2016-04-30 01:55:27 +02:00
|
|
|
$action_mute = ($flag_can_speak == "true") ? 'mute' : 'unmute';
|
|
|
|
|
$td_onclick = "onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=".$action_mute."&id=".$id."');\"";
|
|
|
|
|
$td_title = "title=\"".$text['message-click_to_'.$action_mute]."\"";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2016-04-30 01:55:27 +02:00
|
|
|
echo "<tr>\n";
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick." ".$td_title." style='padding: 4px 6px;'><img src='resources/images/".(($is_moderator == "true") ? 'moderator' : 'participant').".png' style='width: 16px; height: 16px; border: none;' title=\"".$text['label-'.(($is_moderator == "true") ? 'moderator' : 'participant')]."\"></td>\n";
|
|
|
|
|
$talking_icon = ($flag_talking == "true") ? "<img src='resources/images/talking.png' style='width: 16px; height: 16px; border: none; margin: -2px 10px -2px 15px;' align='absmiddle' title=\"".$text['label-talking']."\">" : null;
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick." ".$td_title.">".$caller_id_name.$talking_icon."</td>\n";
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick." ".$td_title.">".$caller_id_number."</td>\n";
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick." ".$td_title." style='padding-top: 5px;'>";
|
|
|
|
|
echo ($flag_can_hear == "true") ? "<img src='resources/images/hear.png' style='width: 16px; height: 16px; border: none; margin: 0px 4px -2px 0px;' align='absmiddle' title=\"".$text['label-hear']."\">" : null;
|
|
|
|
|
echo ($flag_can_speak == "true") ? "<img src='resources/images/speak.png' style='width: 16px; height: 16px; border: none; margin: 0px 6px -2px 0px;' align='absmiddle' title=\"".$text['label-speak']."\">" : null;
|
|
|
|
|
if (permission_exists('conference_interactive_video')) {
|
|
|
|
|
echo ($flag_has_video == "true") ? "<img src='resources/images/video.png' style='width: 16px; height: 16px; border: none; margin: 0px 4px -2px 0px;' align='absmiddle' title=\"".$text['label-video']."\">" : null;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
2016-04-30 01:55:27 +02:00
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick." ".$td_title.">".$join_time_formatted."</td>\n";
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick." ".$td_title.">".$last_talking_formatted."</td>\n";
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' ".$td_onclick." ".$td_title.">".$text['label-'.(($flag_has_floor == "true") ? 'yes' : 'no')]."</td>\n";
|
|
|
|
|
echo "<td valign='top' class='".$row_style[$c]."' style='text-align: right; padding: 1px 2px; white-space: nowrap;'>\n";
|
|
|
|
|
//energy
|
|
|
|
|
if (permission_exists('conference_interactive_energy')) {
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?direction=up&cmd=conference&name=".$conference_name."&data=energy&id=".$id."');\" value='+".$text['label-energy']."'>\n";
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?direction=down&cmd=conference&name=".$conference_name."&data=energy&id=".$id."');\" value='-".$text['label-energy']."'>\n";
|
|
|
|
|
}
|
|
|
|
|
//volume
|
|
|
|
|
if (permission_exists('conference_interactive_volume')) {
|
2017-05-07 19:35:41 +02:00
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?direction=up&cmd=conference&name=".$conference_name."&data=volume_in&id=".$id."');\" value='+".$text['label-volume']."'>\n";
|
2016-04-30 01:55:27 +02:00
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?direction=down&cmd=conference&name=".$conference_name."&data=volume_in&id=".$id."');\" value='-".$text['label-volume']."'>\n";
|
|
|
|
|
}
|
|
|
|
|
if (permission_exists('conference_interactive_gain')) {
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?direction=up&cmd=conference&name=".$conference_name."&data=volume_out&id=".$id."');\" value='+".$text['label-gain']."'>\n";
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?direction=down&cmd=conference&name=".$conference_name."&data=volume_out&id=".$id."');\" value='-".$text['label-gain']."'>\n";
|
|
|
|
|
}
|
|
|
|
|
//mute and unmute
|
|
|
|
|
if (permission_exists('conference_interactive_mute')) {
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=".$action_mute."&id=".$id."');\" value='".$text['label-'.$action_mute]."'>\n";
|
|
|
|
|
}
|
|
|
|
|
//deaf and undeaf
|
|
|
|
|
if (permission_exists('conference_interactive_deaf')) {
|
|
|
|
|
$action_deaf = ($flag_can_hear == "true") ? 'deaf' : 'undeaf';
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=".$action_deaf."&id=".$id."');\" value='".$text['label-'.$action_deaf]."'>\n";
|
|
|
|
|
}
|
|
|
|
|
//kick someone from the conference
|
|
|
|
|
if (permission_exists('conference_interactive_kick')) {
|
|
|
|
|
echo " <input type='button' class='btn' onclick=\"send_cmd('conference_exec.php?cmd=conference&name=".$conference_name."&data=kick&id=".$id."&uuid=".$uuid."');\" value='".$text['label-kick']."'>\n";
|
|
|
|
|
}
|
|
|
|
|
echo "</td>\n";
|
|
|
|
|
echo "</tr>\n";
|
|
|
|
|
}
|
|
|
|
|
$c = ($c == 0) ? 1 : 0;
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
echo "</table>\n";
|
2015-02-12 03:09:59 +01:00
|
|
|
echo "<br /><br />";
|
2012-06-04 16:58:40 +02:00
|
|
|
}
|
|
|
|
|
?>
|