Copyright (C) 2010 All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('active_queue_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //set variables $fifo_name = trim($_REQUEST["c"]); //if not the user is not a member of the superadmin then restrict to viewing their own domain if (!if_group("superadmin")) { if (stripos($fifo_name, $_SESSION['domain_name']) === false) { echo "access denied"; exit; } } //prepare and send the api command over event socket $switch_cmd = 'fifo list_verbose '.$fifo_name.''; $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); if (!$fp) { $msg = "
Connection to Event Socket failed.
"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Message
$msg
\n"; echo "
\n"; } else { //send the api command over event socket $xml_str = trim(event_socket_request($fp, 'api '.$switch_cmd)); //parse the response as xml try { $xml = new SimpleXMLElement($xml_str); } catch(Exception $e) { //echo $e->getMessage(); } //set variables from the xml //$name = $xml->conference['name']; //$member_count = $xml->conference['member-count']; //$locked = $xml->conference['locked']; //set the alternating row styles $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; //response div tag echo "
\n"; echo "
\n"; //show the content 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"; echo "\n"; echo "\n"; foreach ($xml->fifo->callers->caller as $row) { /* $username = $row->caller_profile->username; $dialplan = $row->caller_profile->dialplan; $caller_id_name = urldecode($row->caller_profile->caller_id_name); $caller_id_number = $row->caller_profile->caller_id_number; $ani = $row->caller_profile->ani; $aniii = $row->caller_profile->aniii; $network_addr = $row->caller_profile->network_addr; $destination_number = $row->destination_number->rdnis; $rdnis = $row->caller_profile->rdnis; $uuid = $row->caller_profile->uuid; $source = $row->caller_profile->source; $context = $row->caller_profile->context; $chan_name = $row->caller_profile->chan_name; $default_language = $row->variables->default_language; $fifo_position = $row->variables->fifo_position; $fifo_priority = $row->variables->fifo_priority; $fifo_status = $row->variables->fifo_status; $fifo_timestamp = urldecode($row->variables->fifo_timestamp); $fifo_time = strtotime($fifo_timestamp); $fifo_duration = time() - $fifo_time; $fifo_duration_formatted = str_pad(intval(intval($fifo_duration/3600)),2,"0",STR_PAD_LEFT).":" . str_pad(intval(($fifo_duration / 60) % 60),2,"0",STR_PAD_LEFT).":" . str_pad(intval($fifo_duration % 60),2,"0",STR_PAD_LEFT) ; */ $username = $row->cdr->callflow->caller_profile->username; $dialplan = $row->cdr->callflow->caller_profile->dialplan; $caller_id_name = urldecode($row->cdr->callflow->caller_profile->caller_id_name); $caller_id_number = $row->cdr->callflow->caller_profile->caller_id_number; $ani = $row->cdr->callflow->caller_profile->ani; $aniii = $row->cdr->callflow->caller_profile->aniii; $network_addr = $row->cdr->callflow->caller_profile->network_addr; $destination_number = $row->cdr->callflow->caller_profile->destination_number; $rdnis = $row->cdr->callflow->caller_profile->rdnis; $uuid = $row->cdr->callflow->caller_profile->uuid; $source = $row->cdr->callflow->caller_profile->source; $context = $row->cdr->callflow->caller_profile->context; $chan_name = $row->cdr->callflow->caller_profile->chan_name; $default_language = $row->cdr->variables->default_language; $fifo_position = $row->cdr->variables->fifo_position; $fifo_priority = $row->cdr->variables->fifo_priority; $fifo_status = $row->cdr->variables->fifo_status; $fifo_timestamp = urldecode($row->cdr->variables->fifo_timestamp); $fifo_time = strtotime($fifo_timestamp); $fifo_duration = time() - $fifo_time; $fifo_duration_formatted = str_pad(intval(intval($fifo_duration/3600)),2,"0",STR_PAD_LEFT).":" . str_pad(intval(($fifo_duration / 60) % 60),2,"0",STR_PAD_LEFT).":" . str_pad(intval($fifo_duration % 60),2,"0",STR_PAD_LEFT) ; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if ($c==0) { $c=1; } else { $c=0; } } echo "
\n"; //echo " Count: $member_count\n"; echo "\n"; echo "  \n"; echo "\n"; echo " Queues Tools: \n"; echo " Start Record \n"; echo " Stop Record \n"; if ($locked == "true") { echo " Unlock \n"; } else { echo " Lock \n"; } echo "
".$text['label-username']."".$text['label-caller_id_name']."".$text['label-caller_id_number']."".$text['label-language']."".$text['label-destination_number']."".$text['label-position']."".$text['label-priority']."".$text['label-status']."".$text['label-duration']."
$username  $caller_id_name  $caller_id_number  $default_language  $destination_number  $fifo_position  $fifo_priority  $fifo_status  $fifo_duration_formatted  
\n"; } ?>