diff --git a/app/xml_cdr/app_languages.php b/app/xml_cdr/app_languages.php index 977d35eaef..6f75b0bfdf 100644 --- a/app/xml_cdr/app_languages.php +++ b/app/xml_cdr/app_languages.php @@ -184,7 +184,7 @@ $text['label-average']['es-cl'] = "Promedio"; $text['label-average']['pt-pt'] = "Média"; $text['label-average']['fr-fr'] = "Moyenne"; - + $text['label-preset']['en-us'] = 'Quick Select'; $text['label-preset']['es-cl'] = 'Quick Select'; $text['label-preset']['pt-pt'] = 'Quick Select'; @@ -275,15 +275,15 @@ $text['table-direction']['pt-pt'] = "Direcção"; $text['table-direction']['fr-fr'] = "Direction"; - $text['table-name']['en-us'] = "Name (play)"; - $text['table-name']['es-cl'] = "Nombre (Reproducir)"; - $text['table-name']['pt-pt'] = "Nome (tocar)"; - $text['table-name']['fr-fr'] = "Nom (jouer)"; + $text['table-name']['en-us'] = "Name"; + $text['table-name']['es-cl'] = "Nombre"; + $text['table-name']['pt-pt'] = "Nome"; + $text['table-name']['fr-fr'] = "Nom"; - $text['table-download']['en-us'] = "Number (download)"; - $text['table-download']['es-cl'] = "Número (descargar)"; - $text['table-download']['pt-pt'] = "Número (descarregar)"; - $text['table-download']['fr-fr'] = "Numéro (télécharger)"; + $text['table-download']['en-us'] = "Number"; + $text['table-download']['es-cl'] = "Número"; + $text['table-download']['pt-pt'] = "Número"; + $text['table-download']['fr-fr'] = "Numéro"; $text['table-end']['en-us'] = "End"; $text['table-end']['es-cl'] = "Fin"; @@ -562,30 +562,50 @@ $text['option-false']['es-cl'] = "Falso"; $text['option-false']['pt-pt'] = "Não"; $text['option-false']['fr-fr'] = "Non"; - + $text['option-default']['en-us'] = "Default"; $text['option-default']['es-cl'] = "Default"; $text['option-default']['pt-pt'] = "Default"; $text['option-default']['fr-fr'] = "Default"; + $text['option-last_hour']['en-us'] = "Last Hour"; $text['option-last_hour']['es-cl'] = "Last Hour"; $text['option-last_hour']['pt-pt'] = "Last Hour"; $text['option-last_hour']['fr-fr'] = "Last Hour"; + $text['option-today']['en-us'] = "Today"; $text['option-today']['es-cl'] = "Today"; $text['option-today']['pt-pt'] = "Today"; $text['option-today']['fr-fr'] = "Today"; + $text['option-yesterday']['en-us'] = "Yesterday"; $text['option-yesterday']['es-cl'] = "Yesterday"; $text['option-yesterday']['pt-pt'] = "Yesterday"; $text['option-yesterday']['fr-fr'] = "Yesterday"; + $text['option-this_month']['en-us'] = "This Month"; $text['option-this_month']['es-cl'] = "This Month"; $text['option-this_month']['pt-pt'] = "This Month"; $text['option-this_month']['fr-fr'] = "This Month"; + $text['option-this_year']['en-us'] = "This Year"; $text['option-this_year']['es-cl'] = "This Year"; $text['option-this_year']['pt-pt'] = "This Year"; $text['option-this_year']['fr-fr'] = "This Year"; + $text['confirm-delete']['en-us'] = "Do you really want to delete this?"; + $text['confirm-delete']['es-cl'] = "¿Realmente desea eliminar el número?"; + $text['confirm-delete']['pt-pt'] = "Deseja realmente remover isto?"; + $text['confirm-delete']['fr-fr'] = "Voulez-vous vraiment supprimer cela?"; + + $text['button-delete']['en-us'] = "Delete"; + $text['button-delete']['es-cl'] = "Eliminar"; + $text['button-delete']['pt-pt'] = "Remover"; + $text['button-delete']['fr-fr'] = "Supprimer"; + + $text['message-delete']['en-us'] = "Delete Completed"; + $text['message-delete']['es-cl'] = "Eliminación Completada"; + $text['message-delete']['pt-pt'] = "Remoção Efectuada"; + $text['message-delete']['fr-fr'] = "Supprimé"; + ?> \ No newline at end of file diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 766d378375..5370159d63 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -90,7 +90,9 @@ else { echo "\n"; echo "".$text['title']."


\n"; echo "\n"; - echo "
"; + echo " \n"; + echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -98,13 +100,14 @@ else { 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"; @@ -114,6 +117,11 @@ else { echo " \n"; echo " \n"; echo " \n"; + echo " \n"; + if (isset($order_by)) { + echo " \n"; + echo " \n"; + } echo " \n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -235,8 +235,8 @@ else { echo "
\n"; @@ -156,7 +164,7 @@ else { //basic search of call detail records if (permission_exists('xml_cdr_search')) { - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -331,30 +339,42 @@ else { echo "

"; } +//mod paging parameters for inclusion in column sort heading links + $param = substr($param, 1); //remove leading '&' + $param = substr($param, 0, strrpos($param, '&order_by=')); //remove trailing order by + //show the results + echo "\n"; echo "
\n"; echo "\n"; + if (permission_exists('xml_cdr_delete')) { + echo ""; + } echo "\n"; - echo th_order_by('caller_id_name', $text['label-cid-name'], $order_by, $order); - echo th_order_by('caller_id_number', $text['label-source'], $order_by, $order); - echo th_order_by('destination_number', $text['label-destination'], $order_by, $order); + echo th_order_by('caller_id_name', $text['label-cid-name'], $order_by, $order, null, null, $param); + echo th_order_by('caller_id_number', $text['label-source'], $order_by, $order, null, null, $param); + echo th_order_by('destination_number', $text['label-destination'], $order_by, $order, null, null, $param); echo "\n"; - echo th_order_by('start_stamp', $text['label-start'], $order_by, $order, null, "style='text-align: right;'"); - echo th_order_by('tta', $text['label-tta'], $order_by, $order, null, "style='text-align: right;'"); - echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "style='text-align: center;'"); + echo th_order_by('start_stamp', $text['label-start'], $order_by, $order, null, "style='text-align: center;'", $param); + echo th_order_by('tta', $text['label-tta'], $order_by, $order, null, "style='text-align: right;'", $param); + echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "style='text-align: center;'", $param); if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ // billing collumns echo "\n"; } if (permission_exists('xml_cdr_pdd')) { - echo th_order_by('pdd_ms', 'PDD', $order_by, $order, null, "style='text-align: right;'"); + echo th_order_by('pdd_ms', 'PDD', $order_by, $order, null, "style='text-align: right;'", $param); } if (permission_exists('xml_cdr_mos')) { - echo th_order_by('rtp_audio_in_mos', 'MOS', $order_by, $order, null, "style='text-align: center;'"); + echo th_order_by('rtp_audio_in_mos', 'MOS', $order_by, $order, null, "style='text-align: center;'", $param); } - echo th_order_by('hangup_cause', $text['label-status'], $order_by, $order); + echo th_order_by('hangup_cause', $text['label-status'], $order_by, $order, $param); if (if_group("admin") || if_group("superadmin") || if_group("cdr")) { - echo "\n"; + echo "\n"; } echo "\n"; if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){ @@ -386,9 +406,10 @@ else { $hangup_cause = strtolower($hangup_cause); $hangup_cause = ucwords($hangup_cause); - //If they cancelled, show the ring time, not the bill time. + //if call cancelled, show the ring time, not the bill time. $seconds = ($row['hangup_cause']=="ORIGINATOR_CANCEL") ? $row['duration'] : round(($row['billmsec'] / 1000), 0, PHP_ROUND_HALF_UP); + //handle recordings $tmp_dir = $_SESSION['switch']['recordings']['dir'].'/'.$path_mod.'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day; $tmp_name = ''; if(!empty($row['recording_file']) && file_exists($row['recording_file'])){ @@ -418,8 +439,29 @@ else { elseif (file_exists($tmp_dir.'/'.$row['bridge_uuid'].'_1.mp3')) { $tmp_name = $row['bridge_uuid']."_1.mp3"; } + if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name) && $seconds > 0) { + $recording_file_path = '/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name; + $recording_file_name = strtolower(pathinfo($tmp_name, PATHINFO_BASENAME)); + $recording_file_ext = pathinfo($recording_file_name, PATHINFO_EXTENSION); + switch ($recording_file_ext) { + case "wav" : $recording_type = "audio/wav"; break; + case "mp3" : $recording_type = "audio/mpeg"; break; + case "ogg" : $recording_type = "audio/ogg"; break; + } + } + else { + unset($recording_file_path); + } + $tr_link = (if_group("admin") || if_group("superadmin") || if_group("cdr")) ? "href='xml_cdr_details.php?uuid=".$row['uuid']."'" : null; echo "\n"; + if (permission_exists('xml_cdr_delete')) { + echo " "; + } if ( file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_missed.png") && file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/images/icon_cdr_inbound_connected.png") && @@ -483,19 +525,11 @@ else { echo " \n"; echo " \n"; - if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name) && $seconds > 0) { + if ($recording_file_path != '') { echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; @@ -571,7 +605,7 @@ else { if (permission_exists("xml_cdr_mos")) { echo " \n"; } - echo " \n"; if (if_group("admin") || if_group("superadmin") || if_group("cdr")) { - echo " \n"; } echo "\n"; @@ -592,10 +629,25 @@ else { echo "\n"; echo "
 ".$text['label-tools']."".$text['label-price']." "; + if (permission_exists('xml_cdr_delete')) { + echo "".$v_link_label_delete.""; + } + echo "
"; @@ -503,7 +537,7 @@ else { } echo " ".$tmp_start_epoch."".$tmp_start_epoch."".(($row['tta'] > 0) ? $row['tta']."s" : " ")." 0) ? "title='".($row['rtp_audio_in_mos'] / 5 * 100)."%'" : null)." style='text-align: center;'>".((strlen($row['rtp_audio_in_mos']) > 0) ? $row['rtp_audio_in_mos'] : " ").""; + echo " "; if (if_group("admin") || if_group("superadmin") || if_group("cdr")) { echo "".$hangup_cause.""; } @@ -580,8 +614,11 @@ else { } echo " "; + echo "
"; + echo ""; echo "

"; echo $paging_controls; echo "

"; + // check or uncheck all checkboxes + if (sizeof($xml_ids) > 0) { + echo "\n"; + } + + //store last search/sort query parameters in session + $_SESSION['xml_cdr']['last_query'] = $_SERVER["QUERY_STRING"]; + //show the footer require_once "resources/footer.php"; diff --git a/app/xml_cdr/xml_cdr_delete.php b/app/xml_cdr/xml_cdr_delete.php new file mode 100644 index 0000000000..0bfb1cee0e --- /dev/null +++ b/app/xml_cdr/xml_cdr_delete.php @@ -0,0 +1,69 @@ + + Copyright (C) 2008-2012 + 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('xml_cdr_delete')) { + //access granted +} +else { + echo "access denied"; + exit; +} + +//add multi-lingual support + $language = new text; + $text = $language->get(); + +//get posted values, if any +if (sizeof($_REQUEST) > 0) { + + $xml_cdr_uuids = $_REQUEST["id"]; + $recording_file_path = $_REQUEST["rec"]; + + if (sizeof($xml_cdr_uuids) > 0) { + foreach ($xml_cdr_uuids as $index => $xml_cdr_uuid) { + // delete record + $sql = "delete from v_xml_cdr "; + $sql .= "where uuid = '".$xml_cdr_uuid."' "; + $sql .= "and domain_uuid = '".$domain_uuid."' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + unset($sql, $prep_statement); + //delete recording, if any + echo $_SESSION['switch']['recordings']['dir'].base64_decode($recording_file_path[$index])."..."; + if (file_exists($_SESSION['switch']['recordings']['dir'].base64_decode($recording_file_path[$index]))) { + @unlink($_SESSION['switch']['recordings']['dir'].base64_decode($recording_file_path[$index])); + } + } + } + +} + +// set message +$_SESSION["message"] = $text['message-delete'].": ".sizeof($xml_cdr_uuids); +header("Location: xml_cdr.php".(($_SESSION['xml_cdr']['last_query'] != '') ? "?".$_SESSION['xml_cdr']['last_query'] : null)); +?> \ No newline at end of file diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index d4e3156e69..c2c2ad0827 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -100,7 +100,7 @@ else { echo "
".$text['title2']."\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; foreach($array["channel_data"] as $key => $value) { $value = urldecode($value); @@ -255,7 +255,7 @@ else { $row_style["1"] = "row_style1"; echo "
NameValue".$text['label-name']."".$text['label-value']."
\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "\n"; echo "\n"; echo "
Variables ".$text['label-variables']." 
\n"; @@ -353,7 +353,7 @@ else { echo " \n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "
".$text['label-call-flow']."  
\n"; @@ -379,7 +379,7 @@ else { echo "\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "
".$text['label-call-flow-2']."  
\n"; @@ -405,7 +405,7 @@ else { echo "\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "
".$text['label-call-flow-3']."  
\n"; @@ -432,7 +432,7 @@ else { echo "\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo "
".$text['label-call-flow-4']."  
\n"; @@ -450,8 +450,8 @@ else { echo " ".wordwrap($value,75,"
\n", TRUE)." \n"; } else { - echo " ".$key."\n"; - echo " \n"; + echo " ".$key." \n"; + echo " \n"; echo " \n"; foreach($child["originatee_caller_profile"] as $key => $value) { //print_r($tmp_child); diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index 8ad512e600..a3e3bff344 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -45,8 +45,6 @@ else { //get post or get variables from http if (count($_REQUEST) > 0) { - $order_by = check_str($_REQUEST["order_by"]); - $order = check_str($_REQUEST["order"]); $cdr_id = check_str($_REQUEST["cdr_id"]); $missed = check_str($_REQUEST["missed"]); $direction = check_str($_REQUEST["direction"]); @@ -73,6 +71,9 @@ else { $write_codec = check_str($_REQUEST["write_codec"]); $remote_media_ip = check_str($_REQUEST["remote_media_ip"]); $network_addr = check_str($_REQUEST["network_addr"]); + $bridge_uuid = check_str($_REQUEST["network_addr"]); + $order_by = check_str($_REQUEST["order_by"]); + $order = check_str($_REQUEST["order"]); } //build the sql where string @@ -172,11 +173,12 @@ else { } //set the param variable which is used with paging - $param = "&missed=".$missed; + $param = "&cdr_id=".$cdr_id; + $param .= "&missed=".$missed; + $param .= "&direction=".$direction; $param .= "&caller_id_name=".$caller_id_name; - $param .= "&start_stamp=".$start_stamp; - $param .= "&hangup_cause=".$hangup_cause; $param .= "&caller_id_number=".$caller_id_number; + $param .= "&caller_extension_uuid=".$caller_extension_uuid; $param .= "&destination_number=".$destination_number; $param .= "&context=".$context; $param .= "&start_stamp_begin=".$start_stamp_begin; @@ -189,18 +191,17 @@ else { $param .= "&stop_epoch=".$stop_epoch; $param .= "&duration=".$duration; $param .= "&billsec=".$billsec; + $param .= "&hangup_cause=".$hangup_cause; $param .= "&uuid=".$uuid; - $param .= "&bridge_uuid=".$bridge_uuid; + $param .= "&bleg_uuid=".$bleg_uuid; $param .= "&accountcode=".$accountcode; $param .= "&read_codec=".$read_codec; $param .= "&write_codec=".$write_codec; $param .= "&remote_media_ip=".$remote_media_ip; $param .= "&network_addr=".$network_addr; + $param .= "&bridge_uuid=".$bridge_uuid; if (isset($order_by)) { - $param .= "&order_by=".$order_by; - } - if (isset($order)) { - $param .= "&order=".$order; + $param .= "&order_by=".$order_by."&order=".$order; } //create the sql query to get the xml cdr records