diff --git a/app/xml_cdr/app_languages.php b/app/xml_cdr/app_languages.php index 66110cec9f..b5d5a879ec 100644 --- a/app/xml_cdr/app_languages.php +++ b/app/xml_cdr/app_languages.php @@ -61,8 +61,11 @@ $text['label-download']['en-us'] = 'Download'; $text['label-download']['pt-pt'] = ''; - $text['label-statistics']['en-us'] = 'Statistics'; - $text['label-statistics']['pt-pt'] = 'Estatisticas'; + $text['button-statistics']['en-us'] = 'Statistics'; + $text['button-statistics']['pt-pt'] = 'Estatisticas'; + + $text['button-missed']['en-us'] = 'Missed Calls'; + $text['button-statistics']['pt-pt'] = 'Chamadas Perdidas'; //xml_cdr_details $text['title2']['en-us'] = 'Call Details'; diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 8aba857832..4dbe0d752d 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -76,7 +76,8 @@ else { echo "\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo "\n"; diff --git a/app/xml_cdr/xml_cdr_statistics_inc.php b/app/xml_cdr/xml_cdr_statistics_inc.php index d5c3be4ad8..977d43dfd1 100644 --- a/app/xml_cdr/xml_cdr_statistics_inc.php +++ b/app/xml_cdr/xml_cdr_statistics_inc.php @@ -61,8 +61,8 @@ else { } //create the sql query to get the xml cdr records - if (strlen($order_by) == 0) { $order_by = "start_epoch"; } - if (strlen($order) == 0) { $order = "desc"; } + if (strlen($order_by) == 0) { $order_by = "start_epoch"; } + if (strlen($order) == 0) { $order = "desc"; } //calculate the seconds in different time frames $seconds_hour = 3600;
\n"; - echo " \n"; + echo " \n"; + echo " \n"; echo "
\n"; diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index b3f01dad24..77d0d69c52 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -45,32 +45,41 @@ else { //get post or get variables from http if (count($_REQUEST)>0) { - $order_by = $_REQUEST["order_by"]; - $order = $_REQUEST["order"]; - $cdr_id = $_REQUEST["cdr_id"]; - $direction = $_REQUEST["direction"]; - $caller_id_name = $_REQUEST["caller_id_name"]; - $caller_id_number = $_REQUEST["caller_id_number"]; - $destination_number = $_REQUEST["destination_number"]; - $context = $_REQUEST["context"]; - $start_stamp = $_REQUEST["start_stamp"]; - $answer_stamp = $_REQUEST["answer_stamp"]; - $end_stamp = $_REQUEST["end_stamp"]; - $duration = $_REQUEST["duration"]; - $billsec = $_REQUEST["billsec"]; - $hangup_cause = $_REQUEST["hangup_cause"]; - $uuid = $_REQUEST["uuid"]; - $bleg_uuid = $_REQUEST["bleg_uuid"]; - $accountcode = $_REQUEST["accountcode"]; - $read_codec = $_REQUEST["read_codec"]; - $write_codec = $_REQUEST["write_codec"]; - $remote_media_ip = $_REQUEST["remote_media_ip"]; - $network_addr = $_REQUEST["network_addr"]; + $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"]); + $caller_id_name = check_str($_REQUEST["caller_id_name"]); + $caller_id_number = check_str($_REQUEST["caller_id_number"]); + $destination_number = check_str($_REQUEST["destination_number"]); + $context = check_str($_REQUEST["context"]); + $start_stamp = check_str($_REQUEST["start_stamp"]); + $answer_stamp = check_str($_REQUEST["answer_stamp"]); + $end_stamp = check_str($_REQUEST["end_stamp"]); + $start_epoch = check_str($_REQUEST["start_epoch"]); + $stop_epoch = check_str($_REQUEST["stop_epoch"]); + $duration = check_str($_REQUEST["duration"]); + $billsec = check_str($_REQUEST["billsec"]); + $hangup_cause = check_str($_REQUEST["hangup_cause"]); + $uuid = check_str($_REQUEST["uuid"]); + $bleg_uuid = check_str($_REQUEST["bleg_uuid"]); + $accountcode = check_str($_REQUEST["accountcode"]); + $read_codec = check_str($_REQUEST["read_codec"]); + $write_codec = check_str($_REQUEST["write_codec"]); + $remote_media_ip = check_str($_REQUEST["remote_media_ip"]); + $network_addr = check_str($_REQUEST["network_addr"]); } //build the sql where string + if ($missed == true) { + $sql_where .= "and billsec = '0' "; + } + if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) { + $sql_where .= "and start_epoch BETWEEN ".$start_epoch." AND ".$stop_epoch." "; + } if (strlen($cdr_id) > 0) { $sql_where .= "and cdr_id like '%$cdr_id%' "; } - if (strlen($direction) > 0) { $sql_where .= "and direction like '%$direction%' "; } + if (strlen($direction) > 0) { $sql_where .= "and direction = '$direction' "; } if (strlen($caller_id_name) > 0) { $sql_where .= "and caller_id_name like '%$caller_id_name%' "; } if (strlen($caller_id_number) > 0 && strlen($destination_number) > 0) { $sql_where .= "and ("; @@ -137,6 +146,7 @@ else { //set the param variable which is used with paging $param = ""; + $param .= "&missed=$missed"; $param .= "&caller_id_name=$caller_id_name"; $param .= "&start_stamp=$start_stamp"; $param .= "&hangup_cause=$hangup_cause"; @@ -145,6 +155,8 @@ else { $param .= "&context=$context"; $param .= "&answer_stamp=$answer_stamp"; $param .= "&end_stamp=$end_stamp"; + $param .= "&start_epoch=$start_epoch"; + $param .= "&stop_epoch=$stop_epoch"; $param .= "&duration=$duration"; $param .= "&billsec=$billsec"; $param .= "&uuid=$uuid"; diff --git a/app/xml_cdr/xml_cdr_statistics.php b/app/xml_cdr/xml_cdr_statistics.php index 18731527b7..975344327b 100644 --- a/app/xml_cdr/xml_cdr_statistics.php +++ b/app/xml_cdr/xml_cdr_statistics.php @@ -211,7 +211,7 @@ else { echo " ".$row['volume']." ".(round($row['minutes'],2))." ".(round($row['avg_min'],2))." ".$row['missed']." ".$row['missed']." ".(round($row['asr'],2))." ".(round($row['aloc'],2))."