Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane James Rose */ include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('conference_interactive_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //get the http get or post and set it as php variables $conference_uuid = check_str($_REQUEST["c"]); //replace the space with underscore $conference_name = $conference_uuid.'@'.$_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 = "
".$text['message-connection']."
"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['label-message']."
$msg
\n"; echo "
\n"; } else { //show the content $xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd)); if (substr($xml_str, -9) == "not found") { $valid_xml = false; } else { $valid_xml = true; } 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"; } } } } $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo "
"; echo " ".$text['label-members'].": ".$member_count."\n"; echo " \n"; $recording_dir = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.date("Y").'/'.date("M").'/'.date("d"); $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"; } echo "  "; if (permission_exists('conference_interactive_lock')) { $action_locked = ($locked == "true") ? 'unlock' : 'lock'; echo " \n"; } if (permission_exists('conference_interactive_mute')) { $action_mute_all = ($mute_all == "true") ? 'unmute' : 'mute'; echo " \n"; } echo " \n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; 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) { if (permission_exists('conference_interactive_mute')) { $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]."\""; } echo "\n"; echo "\n"; $talking_icon = ($flag_talking == "true") ? "" : null; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } $c = ($c == 0) ? 1 : 0; } } echo "
 ".$text['label-cid-name']."".$text['label-cid-num']."".$text['label-capabilities']."".$text['label-joined']."".$text['label-quiet']."".$text['label-floor']." 
".$caller_id_name.$talking_icon."".$caller_id_number.""; echo ($flag_can_hear == "true") ? "" : null; echo ($flag_can_speak == "true") ? "" : null; if (permission_exists('conference_interactive_video')) { echo ($flag_has_video == "true") ? "" : null; } echo "".$join_time_formatted."".$last_talking_formatted."".$text['label-'.(($flag_has_floor == "true") ? 'yes' : 'no')]."\n"; //energy if (permission_exists('conference_interactive_energy')) { echo " \n"; echo " \n"; } //volume if (permission_exists('conference_interactive_volume')) { echo " \n"; echo " \n"; } if (permission_exists('conference_interactive_gain')) { echo " \n"; echo " \n"; } //mute and unmute if (permission_exists('conference_interactive_mute')) { echo " \n"; } //deaf and undeaf if (permission_exists('conference_interactive_deaf')) { $action_deaf = ($flag_can_hear == "true") ? 'deaf' : 'undeaf'; echo " \n"; } //kick someone from the conference if (permission_exists('conference_interactive_kick')) { echo " \n"; } echo "
\n"; echo "

"; } ?>