Add a missing file sip_profile_copy.php to the dev branch.

This commit is contained in:
Mark Crane
2012-06-04 14:58:40 +00:00
commit af103e9c41
1240 changed files with 164946 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
<?php
//application details
$apps[$x]['name'] = "Conferences Active";
$apps[$x]['uuid'] = 'c168c943-833a-c29c-7ef9-d1ee78810b71';
$apps[$x]['category'] = 'Switch';;
$apps[$x]['subcategory'] = '';
$apps[$x]['version'] = '';
$apps[$x]['license'] = 'Mozilla Public License 1.1';
$apps[$x]['url'] = 'http://www.fusionpbx.com';
$apps[$x]['description']['en'] = 'AJAX tool to view and manage all active callers in a conference room.';
//menu details
$apps[$x]['menu'][0]['title']['en'] = 'Active Conferences';
$apps[$x]['menu'][0]['uuid'] = '2d857bbb-43b9-b8f7-a138-642868e0453a';
$apps[$x]['menu'][0]['parent_uuid'] = '0438b504-8613-7887-c420-c837ffb20cb1';
$apps[$x]['menu'][0]['category'] = 'internal';
$apps[$x]['menu'][0]['path'] = '/app/conferences_active/v_conferences_active.php';
$apps[$x]['menu'][0]['groups'][] = 'admin';
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
//permission details
$apps[$x]['permissions'][0]['name'] = 'conferences_active_view';
$apps[$x]['permissions'][0]['groups'][] = 'user';
$apps[$x]['permissions'][0]['groups'][] = 'admin';
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
$apps[$x]['permissions'][1]['name'] = 'conferences_active_record';
$apps[$x]['permissions'][1]['groups'][] = 'user';
$apps[$x]['permissions'][1]['groups'][] = 'admin';
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
$apps[$x]['permissions'][2]['name'] = 'conferences_active_lock';
$apps[$x]['permissions'][2]['groups'][] = 'user';
$apps[$x]['permissions'][2]['groups'][] = 'admin';
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
$apps[$x]['permissions'][3]['name'] = 'conferences_active_kick';
$apps[$x]['permissions'][3]['groups'][] = 'user';
$apps[$x]['permissions'][3]['groups'][] = 'admin';
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
$apps[$x]['permissions'][4]['name'] = 'conferences_active_energy';
$apps[$x]['permissions'][4]['groups'][] = 'user';
$apps[$x]['permissions'][4]['groups'][] = 'admin';
$apps[$x]['permissions'][4]['groups'][] = 'superadmin';
$apps[$x]['permissions'][5]['name'] = 'conferences_active_volume';
$apps[$x]['permissions'][5]['groups'][] = 'user';
$apps[$x]['permissions'][5]['groups'][] = 'admin';
$apps[$x]['permissions'][5]['groups'][] = 'superadmin';
$apps[$x]['permissions'][6]['name'] = 'conferences_active_gain';
$apps[$x]['permissions'][6]['groups'][] = 'user';
$apps[$x]['permissions'][6]['groups'][] = 'admin';
$apps[$x]['permissions'][6]['groups'][] = 'superadmin';
$apps[$x]['permissions'][7]['name'] = 'conferences_active_mute';
$apps[$x]['permissions'][7]['groups'][] = 'user';
$apps[$x]['permissions'][7]['groups'][] = 'admin';
$apps[$x]['permissions'][7]['groups'][] = 'superadmin';
$apps[$x]['permissions'][8]['name'] = 'conferences_active_deaf';
$apps[$x]['permissions'][8]['groups'][] = 'user';
$apps[$x]['permissions'][8]['groups'][] = 'admin';
$apps[$x]['permissions'][8]['groups'][] = 'superadmin';
$apps[$x]['permissions'][9]['name'] = 'conferences_active_advanced_view';
$apps[$x]['permissions'][9]['groups'][] = 'admin';
$apps[$x]['permissions'][9]['groups'][] = 'superadmin';
?>
+50
View File
@@ -0,0 +1,50 @@
<?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>
*/
// make sure the PATH_SEPARATOR is defined
if (!defined("PATH_SEPARATOR")) {
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
}
// make sure the document_root is set
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
// if the project directory exists then add it to the include path otherwise add the document root to the include path
if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
}
else {
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
}
?>
@@ -0,0 +1,126 @@
<?php
/* $Id$ */
/*
v_exec.php
Copyright (C) 2008 Mark J Crane
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conferences_active_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//get the http values and set them as php variables
if (count($_GET)>0) {
$cmd = trim($_GET["cmd"]);
$name = trim($_GET["name"]);
$data = trim($_GET["data"]);
$id = trim($_GET["id"]);
$direction = trim($_GET["direction"]);
}
//authorized commands
if ($cmd == "conference") {
//authorized;
} else {
//not found. this command is not authorized
echo "access denied";
exit;
}
//check if the domain is in the switch_cmd
if(stristr($name, $_SESSION['domain_name']) === FALSE) {
echo "access denied";
exit;
}
if (count($_GET)>0) {
if (strlen($cmd) > 0) {
//prepare the switch cmd
$switch_cmd = $cmd . " ";
$switch_cmd .= $name . " ";
$switch_cmd .= $data . " ";
if (strlen($id) > 0) {
$switch_cmd .= " ".$id;
}
//connect to event socket
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if ($fp) {
if ($data == "energy") {
//conference 3001-example-domain.org energy 103
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$result_array = explode("=",$switch_result);
$tmp_value = $result_array[1];
if ($direction == "up") { $tmp_value = $tmp_value + 100; }
if ($direction == "down") { $tmp_value = $tmp_value - 100; }
//echo "energy $tmp_value<br />\n";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
}
elseif ($data == "volume_in") {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$result_array = explode("=",$switch_result);
$tmp_value = $result_array[1];
if ($direction == "up") { $tmp_value = $tmp_value + 1; }
if ($direction == "down") { $tmp_value = $tmp_value - 1; }
//echo "volume $tmp_value<br />\n";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
}
elseif ($data == "volume_out") {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
$result_array = explode("=",$switch_result);
$tmp_value = $result_array[1];
if ($direction == "up") { $tmp_value = $tmp_value + 1; }
if ($direction == "down") { $tmp_value = $tmp_value - 1; }
//echo "volume $tmp_value<br />\n";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd.' '.$tmp_value);
}
elseif ($data == "record") {
$switch_cmd .= $_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav";
if (!file_exists($_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav")) {
$switch_result = event_socket_request($fp, "api ".$switch_cmd);
}
}
elseif ($data == "norecord") {
//stop recording and rename the file
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav")) {
rename($_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav", $_SESSION['switch']['recordings']['dir']."/".$name."-".date("Y").".".date("M").".".date("d")."-".uuid().".wav");
}
$switch_cmd .= $_SESSION['switch']['recordings']['dir']."/".$name."-tmp.wav";
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
else {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
}
}
}
?>
@@ -0,0 +1,129 @@
<?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>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conferences_active_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//get and prepare the conference name
$conference_name = check_str(trim($_REQUEST["c"]));
$conference_display_name = str_replace("-", " ", $conference_name);
$conference_display_name = str_replace("_", " ", $conference_display_name);
//show the header
require_once "includes/header.php";
?><script type="text/javascript">
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
loadXmlHttp.prototype.stateChanged=function () {
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_reponse').innerHTML = this.xmlHttp.responseText;
}
var requestTime = function() {
var url = 'v_conference_interactive_inc.php?c=<?php echo trim($_REQUEST["c"]); ?>';
new loadXmlHttp(url, 'ajax_reponse');
setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, 1222);
}
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
window.attachEvent('onload', requestTime);
}
function send_cmd(url) {
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else {// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,false);
xmlhttp.send(null);
document.getElementById('cmd_reponse').innerHTML=xmlhttp.responseText;
}
var record_count = 0;
</script>
<?php
echo "<div align='center'>";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left'><b>Interactive Conference</b><br>\n";
echo " Use this to monitor and interact with the members of the <strong>$conference_display_name</strong> conference.\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo " <tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <div id=\"ajax_reponse\"></div>\n";
echo " <div id=\"time_stamp\" style=\"visibility:hidden\">".date('Y-m-d-s')."</div>\n";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
//show the header
require_once "includes/footer.php";
?>
@@ -0,0 +1,263 @@
<?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>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conferences_active_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
//get the http get or post and set it as php variables
$conference_name = check_str($_REQUEST["c"]);
//determine if the user should have access to the conference room
if (if_group("superadmin") || if_group("admin")) {
//access granted
}
else {
//get the conference_uuid from the coference_name
$sql = "select conference_uuid from v_conferences ";
$sql .= "where conference_name = '".$conference_name."' ";
$sql .= "and domain_uuid = '".$_SESSION['domain_uuid']."' ";
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
$conference_uuid = $row['conference_uuid'];
}
//show only assigned extensions
$sql = "select count(*) as num_rows from v_conferences as c, v_conference_users as u ";
$sql .= "where c.conference_uuid = u.conference_uuid ";
$sql .= "and c.conference_uuid = '".$conference_uuid."' ";
$sql .= "and c.domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and u.user_uuid = '".$_SESSION['user_uuid']."' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] == 0) {
echo "access denied";
exit;
}
}
}
//replace the space with underscore
$conference_name = $conference_name.'-'.$_SESSION['domain_name'];
//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) {
$msg = "<div align='center'>Connection to Event Socket failed.<br /></div>";
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
echo "<th align='left'>Message</th>\n";
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));
try {
$xml = new SimpleXMLElement($xml_str);
}
catch(Exception $e) {
//echo $e->getMessage();
}
//$name = $xml->conference['name'];
$member_count = $xml->conference['member-count'];
$locked = $xml->conference['locked'];
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<div id='cmd_reponse'>\n";
echo "</div>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td >\n";
echo " <strong>Count: $member_count</strong>\n";
echo "</td>\n";
echo "<td colspan='9'>\n";
echo " &nbsp;\n";
echo "</td>\n";
echo "<td colspan='1' align='right'>\n";
if (permission_exists('conferences_active_record') || permission_exists('conferences_active_lock')) {
echo " <strong>Conference Tools:</strong> \n";
}
if (permission_exists('conferences_active_record')) {
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$conference_name."-tmp.wav")) {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=norecord');\">Stop Record</a>&nbsp;\n";
}
else {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=record');\">Start Record</a>&nbsp;\n";
}
}
if (permission_exists('conferences_active_lock')) {
if ($locked == "true") {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=unlock');\">Unlock</a>&nbsp;\n";
}
else {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=lock');\">Lock</a>&nbsp;\n";
}
}
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>ID</th>\n";
//echo "<th>UUID</th>\n";
echo "<th>Caller ID Name</th>\n";
echo "<th>Caller ID Number</th>\n";
echo "<th>Joined</th>\n";
echo "<th>Hear</th>\n";
echo "<th>Speak</th>\n";
echo "<th>Talking</th>\n";
echo "<th>Last Talked</th>\n";
echo "<th>Video</th>\n";
echo "<th>Has Floor</th>\n";
echo "<th>Tools</th>\n";
echo "</tr>\n";
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;
$uuid = $row->uuid;
$caller_id_name = $row->caller_id_name;
$caller_id_name = str_replace("%20", " ", $caller_id_name);
$caller_id_number = $row->caller_id_number;
//format the seconds
$join_time_formatted = floor($join_time/60)."' ".($join_time - (floor($join_time/60))*60)."\"";
$last_talking_formatted = floor($last_talking/60)."' ".($last_talking - (floor($last_talking/60))*60)."\"";
if (strlen($record_path) == 0) {
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$id</td>\n";
//echo "<td valign='top' class='".$row_style[$c]."'>$uuid</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$caller_id_name</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>$caller_id_number</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$join_time_formatted."</td>\n";
if ($flag_can_hear == "true") {
echo "<td valign='top' class='".$row_style[$c]."'>yes</td>\n";
}
else {
echo "<td valign='top' class='".$row_style[$c]."'>no</td>\n";
}
if ($flag_can_speak == "true") {
echo "<td valign='top' class='".$row_style[$c]."'>yes</td>\n";
}
else {
echo "<td valign='top' class='".$row_style[$c]."'>no</td>\n";
}
if ($flag_talking == "true") {
echo "<td valign='top' class='".$row_style[$c]."'>yes</td>\n";
}
else {
echo "<td valign='top' class='".$row_style[$c]."'>no</td>\n";
}
echo "<td valign='top' class='".$row_style[$c]."'>$last_talking_formatted</td>\n";
if ($flag_has_video == "true") {
echo "<td valign='top' class='".$row_style[$c]."'>yes</td>\n";
}
else {
echo "<td valign='top' class='".$row_style[$c]."'>no</td>\n";
}
if ($flag_has_floor == "true") {
echo "<td valign='top' class='".$row_style[$c]."'>yes</td>\n";
}
else {
echo "<td valign='top' class='".$row_style[$c]."'>no</td>\n";
}
echo "<td valign='top' class='".$row_style[$c]."' style='text-align:right;'>\n";
//energy
if (permission_exists('conferences_active_energy')) {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?direction=up&cmd=conference&name=".$conference_name."&data=energy&id=".$id."');\">+energy</a>&nbsp;\n";
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?direction=down&cmd=conference&name=".$conference_name."&data=energy&id=".$id."');\">-energy</a>&nbsp;\n";
}
//volume
if (permission_exists('conferences_active_volume')) {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?direction=up&cmd=conference&name=".$conference_name."%&data=volume_in&id=".$id."');\">+vol</a>&nbsp;\n";
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?direction=down&cmd=conference&name=".$conference_name."&data=volume_in&id=".$id."');\">-vol</a>&nbsp;\n";
}
if (permission_exists('conferences_active_gain')) {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?direction=up&cmd=conference&name=".$conference_name."&data=volume_out&id=".$id."');\">+gain</a>&nbsp;\n";
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?direction=down&cmd=conference&name=".$conference_name."&data=volume_out&id=".$id."');\">-gain</a>&nbsp;\n";
}
//mute and unmute
if (permission_exists('conferences_active_mute')) {
if ($flag_can_speak == "true"){
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=mute&id=".$id."');\">mute</a>&nbsp;\n";
}
else {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=unmute&id=".$id."');\">unmute</a>&nbsp;\n";
}
}
//deaf and undeaf
if (permission_exists('conferences_active_deaf')) {
if ($flag_can_hear == "true"){
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=deaf&id=".$id."');\">deaf</a>&nbsp;\n";
}
else {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=undeaf&id=".$id."');\">undeaf</a>&nbsp;\n";
}
}
//kick someone from the conference
if (permission_exists('conferences_active_kick')) {
echo " <a href='javascript:void(0);' onclick=\"send_cmd('v_conference_exec.php?cmd=conference&name=".$conference_name."&data=kick&id=".$id."');\">kick</a>&nbsp;\n";
}
echo " &nbsp;";
echo "</td>\n";
echo "</tr>\n";
}
if ($c==0) { $c=1; } else { $c=0; }
}
echo "</table>\n";
}
?>
@@ -0,0 +1,112 @@
<?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>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conferences_active_advanced_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
require_once "includes/header.php";
?><script type="text/javascript">
function loadXmlHttp(url, id) {
var f = this;
f.xmlHttp = null;
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
@end @*/
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
else if (/(object)|(function)/.test(typeof createRequest))
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
else {
f.xmlHttp = null;
// Internet Explorer 5 to 6, includes IE 7+ when local //
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
@end @*/
}
if(f.xmlHttp != null){
f.el = document.getElementById(id);
f.xmlHttp.open("GET",url,true);
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
f.xmlHttp.send(null);
}
}
loadXmlHttp.prototype.stateChanged=function () {
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
//this.el.innerHTML = this.xmlHttp.responseText;
document.getElementById('ajax_reponse').innerHTML = this.xmlHttp.responseText;
}
var requestTime = function() {
var url = 'v_conferences_active_inc.php';
new loadXmlHttp(url, 'ajax_reponse');
setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, 1777);
}
if (window.addEventListener) {
window.addEventListener('load', requestTime, false);
}
else if (window.attachEvent) {
window.attachEvent('onload', requestTime);
}
</script>
<?php
echo "<div align='center'>";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td align='left'><b>Active Conferences</b><br>\n";
echo " List all the conferences that are currently active with one or more members.\n";
echo " </td>\n";
echo " </tr>\n";
echo "</table>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <div id=\"ajax_reponse\">\n";
echo " </div>\n";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
require_once "includes/footer.php";
?>
@@ -0,0 +1,107 @@
<?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>
*/
include "root.php";
require_once "includes/require.php";
require_once "includes/checkauth.php";
if (permission_exists('conferences_active_advanced_view')) {
//access granted
}
else {
echo "access denied";
exit;
}
$tmp_conference_name = str_replace("_", " ", $conference_name);
$switch_cmd = 'conference xml_list';
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
if (!$fp) {
$msg = "<div align='center'>Connection to Event Socket failed.<br /></div>";
echo "<div align='center'>\n";
echo "<table width='40%'>\n";
echo "<tr>\n";
echo "<th align='left'>Message</th>\n";
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 {
$xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd));
try {
$xml = new SimpleXMLElement($xml_str);
}
catch(Exception $e) {
//echo $e->getMessage();
}
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo "<th>Name</th>\n";
echo "<th>Member Count</th>\n";
echo "<th>&nbsp;</th>\n";
echo "</tr>\n";
foreach ($xml->conference as $row) {
//set the variables
$name = $row['name'];
$member_count = $row['member-count'];
//show the conferences that have a matching domain
$tmp_domain = substr($name, -strlen($_SESSION['domain_name']));
if ($tmp_domain == $_SESSION['domain_name']) {
$conference_name = substr($name, 0, strlen($name) - strlen('-'.$_SESSION['domain_name']));
$conference_display_name = str_replace("-", " ", $conference_name);
$conference_display_name = str_replace("_", " ", $conference_display_name);
//$id = $row->members->member->id;
//$flag_can_hear = $row->members->member->flags->can_hear;
//$flag_can_speak = $row->members->member->flags->can_speak;
//$flag_talking = $row->members->member->flags->talking;
//$flag_has_video = $row->members->member->flags->has_video;
//$flag_has_floor = $row->members->member->flags->has_floor;
//$uuid = $row->members->member->uuid;
//$caller_id_name = $row->members->member->caller_id_name;
//$caller_id_name = str_replace("%20", " ", $caller_id_name);
//$caller_id_number = $row->members->member->caller_id_number;
echo "<tr>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$conference_display_name."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'>".$member_count."</td>\n";
echo "<td valign='top' class='".$row_style[$c]."'><a href='v_conference_interactive.php?c=".$conference_name."'>view</a></td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
}
}
echo "</table>\n";
}
?>