Frytimo pr patches for php8.1 (#6630)
* Passing null to parameter #2 ($string) of type string is deprecated * Passing null to parameter #1 ($string) of type string is deprecated * php 8.1 fixes * php 8.1 fixes - replace strlen($var) > 0 with !empty($var) * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - replace ${var} with {$var} * php 8.1 fixes - strlower with null * php 8.1 fixes - strreplace with null * php 8.1 fixes - passing null to base64_decode * php 8.1 fixes - check for false and check for null on $this->dir * php 8.1 fixes - remove assignment of $db variable to modules object * php 8.1 fixes - avoid sending null to substr * php 8.1 fixes - change ${var} to {$var} * php 8.1 fixes - check for null before preg_replace * php 8.1 fixes - remove setting db variable on domains object * php 8.1 fixes - set empty string if $row['domain_setting_subcategory'] is null * php 8.1 fixes - set empty string if $_REQUEST['show'] is not available * php 8.1 fixes * php 8.1 fixes - correct $_POST checking syntax * php 8.1 fixes - correct $_POST variables * php 8.1 fixes * Use brackets consistently * Update user_setting_edit.php * Change to not empty * Update device.php * Update text.php --------- Co-authored-by: Tim Fry <tim@voipstratus.com> Co-authored-by: FusionPBX <markjcrane@gmail.com>
This commit is contained in:
co-authored by
Tim Fry
FusionPBX
parent
ebbb2f1a72
commit
fef8165be2
@@ -209,7 +209,7 @@ if (!class_exists('xml_cdr')) {
|
||||
if (isset($this->fields)) {
|
||||
foreach ($this->fields as $field) {
|
||||
$field = preg_replace('#[^a-zA-Z0-9_\-]#', '', $field);
|
||||
if (isset($row[$field]) && strlen($row[$field]) > 0) {
|
||||
if (isset($row[$field]) && !empty($row[$field])) {
|
||||
$array['xml_cdr'][0][$field] = $row[$field];
|
||||
}
|
||||
}
|
||||
@@ -362,7 +362,7 @@ if (!class_exists('xml_cdr')) {
|
||||
unset($i);
|
||||
|
||||
//if last_sent_callee_id_number is set use it for the destination_number
|
||||
if (strlen($xml->variables->last_sent_callee_id_number) > 0) {
|
||||
if (!empty($xml->variables->last_sent_callee_id_number)) {
|
||||
$destination_number = urldecode($xml->variables->last_sent_callee_id_number);
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ if (!class_exists('xml_cdr')) {
|
||||
|
||||
//call quality
|
||||
$rtp_audio_in_mos = urldecode($xml->variables->rtp_audio_in_mos);
|
||||
if (strlen($rtp_audio_in_mos) > 0) {
|
||||
if (!empty($rtp_audio_in_mos)) {
|
||||
$this->array[$key]['rtp_audio_in_mos'] = $rtp_audio_in_mos;
|
||||
}
|
||||
|
||||
@@ -539,18 +539,18 @@ if (!class_exists('xml_cdr')) {
|
||||
$domain_uuid = urldecode($xml->variables->domain_uuid);
|
||||
|
||||
//get the domain name
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$domain_name = urldecode($xml->variables->dialed_domain);
|
||||
}
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$domain_name = urldecode($xml->variables->sip_invite_domain);
|
||||
}
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$domain_name = urldecode($xml->variables->sip_req_host);
|
||||
}
|
||||
if (strlen($domain_name) == 0) {
|
||||
if (empty($domain_name)) {
|
||||
$presence_id = urldecode($xml->variables->presence_id);
|
||||
if (strlen($presence_id) > 0) {
|
||||
if (!empty($presence_id)) {
|
||||
$presence_array = explode($presence_id, '%40');
|
||||
$domain_name = $presence_array[1];
|
||||
}
|
||||
@@ -586,9 +586,9 @@ if (!class_exists('xml_cdr')) {
|
||||
//$this->log("\ndomain_name is `$domain_name`;\ndomain_uuid is '$domain_uuid'\n");
|
||||
|
||||
//get the domain_uuid with the domain_name
|
||||
if (strlen($domain_uuid) == 0) {
|
||||
if (empty($domain_uuid)) {
|
||||
$sql = "select domain_uuid from v_domains ";
|
||||
if (strlen($domain_name) == 0 && $context != 'public' && $context != 'default') {
|
||||
if (empty($domain_name) && $context != 'public' && $context != 'default') {
|
||||
$sql .= "where domain_name = :context ";
|
||||
$parameters['context'] = $context;
|
||||
}
|
||||
@@ -602,10 +602,10 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
//set values in the database
|
||||
if (strlen($domain_uuid) > 0) {
|
||||
if (!empty($domain_uuid)) {
|
||||
$this->array[$key]['domain_uuid'] = $domain_uuid;
|
||||
}
|
||||
if (strlen($domain_name) > 0) {
|
||||
if (!empty($domain_name)) {
|
||||
$this->array[$key]['domain_name'] = $domain_name;
|
||||
}
|
||||
|
||||
@@ -635,17 +635,17 @@ if (!class_exists('xml_cdr')) {
|
||||
$record_name = urldecode($xml->variables->record_name);
|
||||
$record_length = urldecode($xml->variables->duration);
|
||||
}
|
||||
elseif (strlen($xml->variables->sofia_record_file) > 0) {
|
||||
elseif (!empty($xml->variables->sofia_record_file)) {
|
||||
$record_path = dirname(urldecode($xml->variables->sofia_record_file));
|
||||
$record_name = basename(urldecode($xml->variables->sofia_record_file));
|
||||
$record_length = urldecode($xml->variables->record_seconds);
|
||||
}
|
||||
elseif (strlen($xml->variables->cc_record_filename) > 0) {
|
||||
elseif (!empty($xml->variables->cc_record_filename)) {
|
||||
$record_path = dirname(urldecode($xml->variables->cc_record_filename));
|
||||
$record_name = basename(urldecode($xml->variables->cc_record_filename));
|
||||
$record_length = urldecode($xml->variables->record_seconds);
|
||||
}
|
||||
elseif (strlen($xml->variables->api_on_answer) > 0) {
|
||||
elseif (!empty($xml->variables->api_on_answer)) {
|
||||
$command = str_replace("\n", " ", urldecode($xml->variables->api_on_answer));
|
||||
$parts = explode(" ", $command);
|
||||
if ($parts[0] == "uuid_record") {
|
||||
@@ -655,13 +655,13 @@ if (!class_exists('xml_cdr')) {
|
||||
$record_length = urldecode($xml->variables->duration);
|
||||
}
|
||||
}
|
||||
elseif (strlen($xml->variables->conference_recording) > 0) {
|
||||
elseif (!empty($xml->variables->conference_recording)) {
|
||||
$conference_recording = urldecode($xml->variables->conference_recording);
|
||||
$record_path = dirname($conference_recording);
|
||||
$record_name = basename($conference_recording);
|
||||
$record_length = urldecode($xml->variables->duration);
|
||||
}
|
||||
elseif (strlen($xml->variables->current_application_data) > 0) {
|
||||
elseif (!empty($xml->variables->current_application_data)) {
|
||||
$commands = explode(",", urldecode($xml->variables->current_application_data));
|
||||
foreach ($commands as $command) {
|
||||
$cmd = explode("=", $command);
|
||||
@@ -705,7 +705,7 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
//last check
|
||||
if (!isset($record_name) || is_null ($record_name) || (strlen($record_name) == 0)) {
|
||||
if (!isset($record_name) || is_null ($record_name) || (empty($record_name))) {
|
||||
$bridge_uuid = urldecode($xml->variables->bridge_uuid) ?: $last_bridge ;
|
||||
$path = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/archive/'.$start_year.'/'.$start_month.'/'.$start_day;
|
||||
if (file_exists($path.'/'.$bridge_uuid.'.wav')) {
|
||||
@@ -862,7 +862,7 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
if ($_SESSION['cdr']['storage']['text'] == "dir" && $error != "true") {
|
||||
if (strlen($uuid) > 0) {
|
||||
if (!empty($uuid)) {
|
||||
$tmp_dir = $_SESSION['switch']['log']['dir'].'/xml_cdr/archive/'.$start_year.'/'.$start_month.'/'.$start_day;
|
||||
if(!file_exists($tmp_dir)) {
|
||||
mkdir($tmp_dir, 0770, true);
|
||||
@@ -973,7 +973,7 @@ if (!class_exists('xml_cdr')) {
|
||||
|
||||
//authentication for xml cdr http post
|
||||
if (!defined('STDIN')) {
|
||||
if ($_SESSION["cdr"]["http_enabled"]["boolean"] == "true" && strlen($_SESSION["xml_cdr"]["username"]) == 0) {
|
||||
if ($_SESSION["cdr"]["http_enabled"]["boolean"] == "true" && empty($_SESSION["xml_cdr"]["username"])) {
|
||||
//get the contents of xml_cdr.conf.xml
|
||||
$conf_xml_string = file_get_contents($_SESSION['switch']['conf']['dir'].'/autoload_configs/xml_cdr.conf.xml');
|
||||
|
||||
@@ -1065,19 +1065,19 @@ if (!class_exists('xml_cdr')) {
|
||||
}
|
||||
|
||||
//build the date range
|
||||
if (strlen($this->start_stamp_begin) > 0 || strlen($this->start_stamp_end) > 0) {
|
||||
if (strlen($this->start_stamp_begin) > 0 || !empty($this->start_stamp_end)) {
|
||||
unset($this->quick_select);
|
||||
if (strlen($this->start_stamp_begin) > 0 && strlen($this->start_stamp_end) > 0) {
|
||||
if (strlen($this->start_stamp_begin) > 0 && !empty($this->start_stamp_end)) {
|
||||
$sql_date_range = " and start_stamp between :start_stamp_begin::timestamptz and :start_stamp_end::timestamptz \n";
|
||||
$parameters['start_stamp_begin'] = $this->start_stamp_begin.':00.000 '.$time_zone;
|
||||
$parameters['start_stamp_end'] = $this->start_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
else {
|
||||
if (strlen($this->start_stamp_begin) > 0) {
|
||||
if (!empty($this->start_stamp_begin)) {
|
||||
$sql_date_range = "and start_stamp >= :start_stamp_begin::timestamptz \n";
|
||||
$parameters['start_stamp_begin'] = $this->start_stamp_begin.':00.000 '.$time_zone;
|
||||
}
|
||||
if (strlen($this->start_stamp_end) > 0) {
|
||||
if (!empty($this->start_stamp_end)) {
|
||||
$sql_date_range .= "and start_stamp <= :start_stamp_end::timestamptz \n";
|
||||
$parameters['start_stamp_end'] = $this->start_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@
|
||||
else if ($row['answer_stamp'] == '' && $row['bridge_uuid'] != '') { $call_result = 'cancelled'; }
|
||||
else { $call_result = 'failed'; }
|
||||
}
|
||||
if (strlen($row['direction']) > 0) {
|
||||
if (!empty($row['direction'])) {
|
||||
$image_name = "icon_cdr_" . $row['direction'] . "_" . $call_result;
|
||||
if ($row['leg'] == 'b') {
|
||||
$image_name .= '_b';
|
||||
@@ -798,7 +798,7 @@
|
||||
}
|
||||
//mos (mean opinion score)
|
||||
if (permission_exists("xml_cdr_mos")) {
|
||||
if(strlen($row['rtp_audio_in_mos']) > 0){
|
||||
if(!empty($row['rtp_audio_in_mos'])){
|
||||
$title = " title='".$text['label-mos_score-'.round($row['rtp_audio_in_mos'])]."'";
|
||||
$value = $row['rtp_audio_in_mos'];
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
unset($sql, $parameters, $row);
|
||||
|
||||
//get the format
|
||||
if (strlen($xml_string) > 0) {
|
||||
if (!empty($xml_string)) {
|
||||
$format = "xml";
|
||||
}
|
||||
if (strlen($json_string) > 0) {
|
||||
if (!empty($json_string)) {
|
||||
$format = "json";
|
||||
}
|
||||
|
||||
@@ -383,12 +383,12 @@
|
||||
else if (file_exists($tmp_dir.'/'.$value.'_1.mp3')) {
|
||||
$tmp_name = $value."_1.mp3";
|
||||
}
|
||||
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||
if (!empty($tmp_name) && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||
echo " <a href=\"javascript:void(0);\" onclick=\"window.open('../recordings/recording_play.php?a=download&type=moh&filename=".base64_encode('archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)."', 'play',' width=420,height=150,menubar=no,status=no,toolbar=no')\">\n";
|
||||
echo " play";
|
||||
echo " </a> ";
|
||||
}
|
||||
if (strlen($tmp_name) > 0 && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||
if (!empty($tmp_name) && file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/archive/'.$tmp_year.'/'.$tmp_month.'/'.$tmp_day.'/'.$tmp_name)) {
|
||||
echo " <a href=\"../recordings/recordings.php?a=download&type=rec&t=bin&filename=".base64_encode("archive/".$tmp_year."/".$tmp_month."/".$tmp_day."/".$tmp_name)."\">\n";
|
||||
echo " download";
|
||||
echo " </a>";
|
||||
|
||||
@@ -210,7 +210,7 @@
|
||||
$data_body[$p] .= '<td align="center">';
|
||||
if (permission_exists("xml_cdr_mos")) {
|
||||
$total['rtp_audio_in_mos'] += $fields['rtp_audio_in_mos'];
|
||||
$data_body[$p] .= (strlen($total['rtp_audio_in_mos']) > 0) ? $fields['rtp_audio_in_mos'] : null;
|
||||
$data_body[$p] .= (!empty($total['rtp_audio_in_mos'])) ? $fields['rtp_audio_in_mos'] : null;
|
||||
}
|
||||
$data_body[$p] .= '</td>';
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
if (permission_exists('xml_cdr_extension_summary_all') && $_GET['show'] != 'all') {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-show_all'],'icon'=>$_SESSION['theme']['button_icon_all'],'collapse'=>'hide-sm-dn','link'=>'xml_cdr_extension_summary.php?show=all']);
|
||||
}
|
||||
echo button::create(['type'=>'button','label'=>$text['button-download_csv'],'icon'=>$_SESSION['theme']['button_icon_download'],'collapse'=>'hide-sm-dn','link'=>'xml_cdr_extension_summary.php?'.(strlen($_SERVER["QUERY_STRING"]) > 0 ? $_SERVER["QUERY_STRING"].'&' : null).'type=csv']);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-download_csv'],'icon'=>$_SESSION['theme']['button_icon_download'],'collapse'=>'hide-sm-dn','link'=>'xml_cdr_extension_summary.php?'.(!empty($_SERVER["QUERY_STRING"]) ? $_SERVER["QUERY_STRING"].'&' : null).'type=csv']);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-reset'],'icon'=>$_SESSION['theme']['button_icon_reset'],'collapse'=>'hide-xs','style'=>'margin-left: 15px;','link'=>'xml_cdr_extension_summary.php']);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-update'],'icon'=>$_SESSION['theme']['button_icon_save'],'id'=>'btn_save','collapse'=>'hide-xs','onclick'=>"document.getElementById('frm').submit();"]);
|
||||
echo " </div>\n";
|
||||
|
||||
+71
-71
@@ -90,7 +90,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strlen($_REQUEST["mos_comparison"]) > 0) {
|
||||
if (!empty($_REQUEST["mos_comparison"])) {
|
||||
switch($_REQUEST["mos_comparison"]) {
|
||||
case 'less': $mos_comparison = "<"; break;
|
||||
case 'greater': $mos_comparison = ">"; break;
|
||||
@@ -137,41 +137,41 @@
|
||||
}
|
||||
|
||||
//set the param variable which is used with paging
|
||||
$param = "&cdr_id=".urlencode($cdr_id);
|
||||
$param .= "&missed=".urlencode($missed);
|
||||
$param .= "&direction=".urlencode($direction);
|
||||
$param .= "&caller_id_name=".urlencode($caller_id_name);
|
||||
$param .= "&caller_id_number=".urlencode($caller_id_number);
|
||||
$param .= "&caller_destination=".urlencode($caller_destination);
|
||||
$param .= "&extension_uuid=".urlencode($extension_uuid);
|
||||
$param .= "&destination_number=".urlencode($destination_number);
|
||||
$param .= "&context=".urlencode($context);
|
||||
$param .= "&start_stamp_begin=".urlencode($start_stamp_begin);
|
||||
$param .= "&start_stamp_end=".urlencode($start_stamp_end);
|
||||
$param .= "&answer_stamp_begin=".urlencode($answer_stamp_begin);
|
||||
$param .= "&answer_stamp_end=".urlencode($answer_stamp_end);
|
||||
$param .= "&end_stamp_begin=".urlencode($end_stamp_begin);
|
||||
$param .= "&end_stamp_end=".urlencode($end_stamp_end);
|
||||
$param .= "&start_epoch=".urlencode($start_epoch);
|
||||
$param .= "&stop_epoch=".urlencode($stop_epoch);
|
||||
$param .= "&duration_min=".urlencode($duration_min);
|
||||
$param .= "&duration_max=".urlencode($duration_max);
|
||||
$param .= "&billsec=".urlencode($billsec);
|
||||
$param .= "&hangup_cause=".urlencode($hangup_cause);
|
||||
$param .= "&call_result=".urlencode($call_result);
|
||||
$param .= "&xml_cdr_uuid=".urlencode($xml_cdr_uuid);
|
||||
$param .= "&bleg_uuid=".urlencode($bleg_uuid);
|
||||
$param .= "&accountcode=".urlencode($accountcode);
|
||||
$param .= "&read_codec=".urlencode($read_codec);
|
||||
$param .= "&write_codec=".urlencode($write_codec);
|
||||
$param .= "&remote_media_ip=".urlencode($remote_media_ip);
|
||||
$param .= "&network_addr=".urlencode($network_addr);
|
||||
$param .= "&bridge_uuid=".urlencode($bridge_uuid);
|
||||
$param .= "&mos_comparison=".urlencode($mos_comparison);
|
||||
$param .= "&mos_score=".urlencode($mos_score);
|
||||
$param .= "&tta_min=".urlencode($tta_min);
|
||||
$param .= "&tta_max=".urlencode($tta_max);
|
||||
$param .= "&recording=".urlencode($recording);
|
||||
$param = "&cdr_id=".urlencode($cdr_id ?? '');
|
||||
$param .= "&missed=".urlencode($missed ?? '');
|
||||
$param .= "&direction=".urlencode($direction ?? '');
|
||||
$param .= "&caller_id_name=".urlencode($caller_id_name ?? '');
|
||||
$param .= "&caller_id_number=".urlencode($caller_id_number ?? '');
|
||||
$param .= "&caller_destination=".urlencode($caller_destination ?? '');
|
||||
$param .= "&extension_uuid=".urlencode($extension_uuid ?? '');
|
||||
$param .= "&destination_number=".urlencode($destination_number ?? '');
|
||||
$param .= "&context=".urlencode($context ?? '');
|
||||
$param .= "&start_stamp_begin=".urlencode($start_stamp_begin ?? '');
|
||||
$param .= "&start_stamp_end=".urlencode($start_stamp_end ?? '');
|
||||
$param .= "&answer_stamp_begin=".urlencode($answer_stamp_begin ?? '');
|
||||
$param .= "&answer_stamp_end=".urlencode($answer_stamp_end ?? '');
|
||||
$param .= "&end_stamp_begin=".urlencode($end_stamp_begin ?? '');
|
||||
$param .= "&end_stamp_end=".urlencode($end_stamp_end ?? '');
|
||||
$param .= "&start_epoch=".urlencode($start_epoch ?? '');
|
||||
$param .= "&stop_epoch=".urlencode($stop_epoch ?? '');
|
||||
$param .= "&duration_min=".urlencode($duration_min ?? '');
|
||||
$param .= "&duration_max=".urlencode($duration_max ?? '');
|
||||
$param .= "&billsec=".urlencode($billsec ?? '');
|
||||
$param .= "&hangup_cause=".urlencode($hangup_cause ?? '');
|
||||
$param .= "&call_result=".urlencode($call_result ?? '');
|
||||
$param .= "&xml_cdr_uuid=".urlencode($xml_cdr_uuid ?? '');
|
||||
$param .= "&bleg_uuid=".urlencode($bleg_uuid ?? '');
|
||||
$param .= "&accountcode=".urlencode($accountcode ?? '');
|
||||
$param .= "&read_codec=".urlencode($read_codec ?? '');
|
||||
$param .= "&write_codec=".urlencode($write_codec ?? '');
|
||||
$param .= "&remote_media_ip=".urlencode($remote_media_ip ?? '');
|
||||
$param .= "&network_addr=".urlencode($network_addr ?? '');
|
||||
$param .= "&bridge_uuid=".urlencode($bridge_uuid ?? '');
|
||||
$param .= "&mos_comparison=".urlencode($mos_comparison ?? '');
|
||||
$param .= "&mos_score=".urlencode($mos_score ?? '');
|
||||
$param .= "&tta_min=".urlencode($tta_min ?? '');
|
||||
$param .= "&tta_max=".urlencode($tta_max ?? '');
|
||||
$param .= "&recording=".urlencode($recording ?? '');
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
@@ -189,8 +189,8 @@
|
||||
}
|
||||
|
||||
//create the sql query to get the xml cdr records
|
||||
if (strlen($order_by) == 0) { $order_by = "start_stamp"; }
|
||||
if (strlen($order) == 0) { $order = "desc"; }
|
||||
if (empty($order_by)) { $order_by = "start_stamp"; }
|
||||
if (empty($order)) { $order = "desc"; }
|
||||
|
||||
//set a default number of rows to show
|
||||
$num_rows = '0';
|
||||
@@ -303,20 +303,20 @@
|
||||
$sql .= "and false \n";
|
||||
}
|
||||
}
|
||||
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
|
||||
if (!empty($start_epoch) && !empty($stop_epoch)) {
|
||||
$sql .= "and start_epoch between :start_epoch and :stop_epoch \n";
|
||||
$parameters['start_epoch'] = $start_epoch;
|
||||
$parameters['stop_epoch'] = $stop_epoch;
|
||||
}
|
||||
if (strlen($cdr_id) > 0) {
|
||||
if (!empty($cdr_id)) {
|
||||
$sql .= "and cdr_id like :cdr_id \n";
|
||||
$parameters['cdr_id'] = '%'.$cdr_id.'%';
|
||||
}
|
||||
if (strlen($direction) > 0) {
|
||||
if (!empty($direction)) {
|
||||
$sql .= "and direction = :direction \n";
|
||||
$parameters['direction'] = $direction;
|
||||
}
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
if (!empty($caller_id_name)) {
|
||||
$mod_caller_id_name = str_replace("*", "%", $caller_id_name);
|
||||
if (strstr($mod_caller_id_name, '%')) {
|
||||
$sql .= "and caller_id_name like :caller_id_name \n";
|
||||
@@ -327,7 +327,7 @@
|
||||
$parameters['caller_id_name'] = $mod_caller_id_name;
|
||||
}
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
if (!empty($caller_id_number)) {
|
||||
$mod_caller_id_number = str_replace("*", "%", $caller_id_number);
|
||||
$mod_caller_id_number = preg_replace("#[^\+0-9.%/]#", "", $mod_caller_id_number);
|
||||
if (strstr($mod_caller_id_number, '%')) {
|
||||
@@ -340,11 +340,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($extension_uuid) > 0 && is_uuid($extension_uuid)) {
|
||||
if (!empty($extension_uuid) && is_uuid($extension_uuid)) {
|
||||
$sql .= "and e.extension_uuid = :extension_uuid \n";
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
}
|
||||
if (strlen($caller_destination) > 0) {
|
||||
if (!empty($caller_destination)) {
|
||||
$mod_caller_destination = str_replace("*", "%", $caller_destination);
|
||||
$mod_caller_destination = preg_replace("#[^\+0-9.%/]#", "", $mod_caller_destination);
|
||||
if (strstr($mod_caller_destination, '%')) {
|
||||
@@ -356,7 +356,7 @@
|
||||
$parameters['caller_destination'] = $mod_caller_destination;
|
||||
}
|
||||
}
|
||||
if (strlen($destination_number) > 0) {
|
||||
if (!empty($destination_number)) {
|
||||
$mod_destination_number = str_replace("*", "%", $destination_number);
|
||||
$mod_destination_number = preg_replace("#[^\+0-9.%/]#", "", $mod_destination_number);
|
||||
if (strstr($mod_destination_number, '%')) {
|
||||
@@ -368,17 +368,17 @@
|
||||
$parameters['destination_number'] = $mod_destination_number;
|
||||
}
|
||||
}
|
||||
if (strlen($context) > 0) {
|
||||
if (!empty($context)) {
|
||||
$sql .= "and context like :context \n";
|
||||
$parameters['context'] = '%'.$context.'%';
|
||||
}
|
||||
if (is_array($_SESSION['cdr']['field'])) {
|
||||
if (!empty($_SESSION['cdr']['field']) && is_array($_SESSION['cdr']['field'])) {
|
||||
foreach ($_SESSION['cdr']['field'] as $field) {
|
||||
$array = explode(",", $field);
|
||||
$field_name = end($array);
|
||||
if (isset($$field_name)) {
|
||||
$$field_name = $_REQUEST[$field_name];
|
||||
if (strlen($$field_name) > 0) {
|
||||
if (!empty($$field_name)) {
|
||||
if (strstr($$field_name, '%')) {
|
||||
$sql .= "and $field_name like :".$field_name." \n";
|
||||
$parameters[$field_name] = $$field_name;
|
||||
@@ -392,47 +392,47 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) {
|
||||
if (!empty($start_stamp_begin) && !empty($start_stamp_end)) {
|
||||
$sql .= "and start_stamp between :start_stamp_begin::timestamptz and :start_stamp_end::timestamptz \n";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000 '.$time_zone;
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
else {
|
||||
if (strlen($start_stamp_begin) > 0) {
|
||||
if (!empty($start_stamp_begin)) {
|
||||
$sql .= "and start_stamp >= :start_stamp_begin \n";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000 '.$time_zone;
|
||||
}
|
||||
if (strlen($start_stamp_end) > 0) {
|
||||
if (!empty($start_stamp_end)) {
|
||||
$sql .= "and start_stamp <= :start_stamp_end \n";
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
}
|
||||
if (strlen($answer_stamp_begin) > 0 && strlen($answer_stamp_end) > 0) {
|
||||
if (!empty($answer_stamp_begin) && !empty($answer_stamp_end)) {
|
||||
$sql .= "and answer_stamp between :answer_stamp_begin::timestamptz and :answer_stamp_end::timestamptz \n";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000 '.$time_zone;
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
else {
|
||||
if (strlen($answer_stamp_begin) > 0) {
|
||||
if (!empty($answer_stamp_begin)) {
|
||||
$sql .= "and answer_stamp >= :answer_stamp_begin \n";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000 '.$time_zone;;
|
||||
}
|
||||
if (strlen($answer_stamp_end) > 0) {
|
||||
if (!empty($answer_stamp_end)) {
|
||||
$sql .= "and answer_stamp <= :answer_stamp_end \n";
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
}
|
||||
if (strlen($end_stamp_begin) > 0 && strlen($end_stamp_end) > 0) {
|
||||
if (!empty($end_stamp_begin) && !empty($end_stamp_end)) {
|
||||
$sql .= "and end_stamp between :end_stamp_begin::timestamptz and :end_stamp_end::timestamptz \n";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000 '.$time_zone;
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
else {
|
||||
if (strlen($end_stamp_begin) > 0) {
|
||||
if (!empty($end_stamp_begin)) {
|
||||
$sql .= "and end_stamp >= :end_stamp_begin \n";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000 '.$time_zone;
|
||||
}
|
||||
if (strlen($end_stamp_end) > 0) {
|
||||
if (!empty($end_stamp_end)) {
|
||||
$sql .= "and end_stamp <= :end_stamp_end \n";
|
||||
$parameters['end_stamp'] = $end_stamp_end.':59.999 '.$time_zone;
|
||||
}
|
||||
@@ -445,11 +445,11 @@
|
||||
$sql .= "and duration <= :duration_max \n";
|
||||
$parameters['duration_max'] = $duration_max;
|
||||
}
|
||||
if (strlen($billsec) > 0) {
|
||||
if (!empty($billsec)) {
|
||||
$sql .= "and billsec like :billsec \n";
|
||||
$parameters['billsec'] = '%'.$billsec.'%';
|
||||
}
|
||||
if (strlen($hangup_cause) > 0) {
|
||||
if (!empty($hangup_cause)) {
|
||||
$sql .= "and hangup_cause like :hangup_cause \n";
|
||||
$parameters['hangup_cause'] = '%'.$hangup_cause.'%';
|
||||
}
|
||||
@@ -459,7 +459,7 @@
|
||||
$sql .= "and hangup_cause != 'LOSE_RACE' \n";
|
||||
}
|
||||
|
||||
if (strlen($call_result) > 0) {
|
||||
if (!empty($call_result)) {
|
||||
switch ($call_result) {
|
||||
case 'answered':
|
||||
$sql .= "and (answer_stamp is not null and bridge_uuid is not null) \n";
|
||||
@@ -511,40 +511,40 @@
|
||||
//$sql .= "and (answer_stamp is null and bridge_uuid is null and billsec = 0 and sip_hangup_disposition = 'send_refuse') ";
|
||||
}
|
||||
}
|
||||
if (strlen($xml_cdr_uuid) > 0) {
|
||||
if (!empty($xml_cdr_uuid)) {
|
||||
$sql .= "and xml_cdr_uuid = :xml_cdr_uuid \n";
|
||||
$parameters['xml_cdr_uuid'] = $xml_cdr_uuid;
|
||||
}
|
||||
if (strlen($bleg_uuid) > 0) {
|
||||
if (!empty($bleg_uuid)) {
|
||||
$sql .= "and bleg_uuid = :bleg_uuid \n";
|
||||
$parameters['bleg_uuid'] = $bleg_uuid;
|
||||
}
|
||||
if (strlen($accountcode) > 0) {
|
||||
if (!empty($accountcode)) {
|
||||
$sql .= "and c.accountcode = :accountcode \n";
|
||||
$parameters['accountcode'] = $accountcode;
|
||||
}
|
||||
if (strlen($read_codec) > 0) {
|
||||
if (!empty($read_codec)) {
|
||||
$sql .= "and read_codec like :read_codec \n";
|
||||
$parameters['read_codec'] = '%'.$read_codec.'%';
|
||||
}
|
||||
if (strlen($write_codec) > 0) {
|
||||
if (!empty($write_codec)) {
|
||||
$sql .= "and write_codec like :write_codec \n";
|
||||
$parameters['write_codec'] = '%'.$write_codec.'%';
|
||||
}
|
||||
if (strlen($remote_media_ip) > 0) {
|
||||
if (!empty($remote_media_ip)) {
|
||||
$sql .= "and remote_media_ip like :remote_media_ip \n";
|
||||
$parameters['remote_media_ip'] = $remote_media_ip;
|
||||
}
|
||||
if (strlen($network_addr) > 0) {
|
||||
if (!empty($network_addr)) {
|
||||
$sql .= "and network_addr like :network_addr \n";
|
||||
$parameters['network_addr'] = '%'.$network_addr.'%';
|
||||
}
|
||||
//if (strlen($mos_comparison) > 0 && strlen($mos_score) > 0 ) {
|
||||
//if (strlen($mos_comparison) > 0 && !empty($mos_score) ) {
|
||||
// $sql .= "and rtp_audio_in_mos = :mos_comparison :mos_score ";
|
||||
// $parameters['mos_comparison'] = $mos_comparison;
|
||||
// $parameters['mos_score'] = $mos_score;
|
||||
//}
|
||||
if (strlen($leg) > 0) {
|
||||
if (!empty($leg)) {
|
||||
$sql .= "and leg = :leg \n";
|
||||
$parameters['leg'] = $leg;
|
||||
}
|
||||
@@ -569,7 +569,7 @@
|
||||
$sql .= "and (cc_side is null or cc_side != 'agent') \n";
|
||||
}
|
||||
//end where
|
||||
if (strlen($order_by) > 0) {
|
||||
if (!empty($order_by)) {
|
||||
$sql .= order_by($order_by, $order);
|
||||
}
|
||||
if ($_REQUEST['export_format'] !== "csv" && $_REQUEST['export_format'] !== "pdf") {
|
||||
|
||||
@@ -58,79 +58,79 @@
|
||||
if(permission_exists('xml_cdr_all') && ($_GET['showall'] === 'true')){
|
||||
$search_url .= '&showall=true';
|
||||
}
|
||||
if (strlen($_GET['direction']) > 0) {
|
||||
if (!empty($_GET['direction'])) {
|
||||
$search_url .= '&direction='.urlencode($_GET['direction']);
|
||||
}
|
||||
if (strlen($_GET['leg']) > 0) {
|
||||
if (!empty($_GET['leg'])) {
|
||||
$search_url .= '&leg='.urlencode($_GET['leg']);
|
||||
}
|
||||
if (strlen($_GET['caller_id_name']) > 0) {
|
||||
if (!empty($_GET['caller_id_name'])) {
|
||||
$search_url .= '&caller_id_name='.urlencode($_GET['caller_id_name']);
|
||||
}
|
||||
if (strlen($_GET['caller_extension_uuid']) > 0) {
|
||||
if (!empty($_GET['caller_extension_uuid'])) {
|
||||
$search_url .= '&caller_extension_uuid='.urlencode($_GET['caller_extension_uuid']);
|
||||
}
|
||||
if (strlen($_GET['caller_id_number']) > 0) {
|
||||
if (!empty($_GET['caller_id_number'])) {
|
||||
$search_url .= '&caller_id_number='.urlencode($_GET['caller_id_number']);
|
||||
}
|
||||
if (strlen($_GET['destination_number']) > 0) {
|
||||
if (!empty($_GET['destination_number'])) {
|
||||
$search_url .= '&destination_number='.urlencode($_GET['destination_number']);
|
||||
}
|
||||
if (strlen($_GET['context']) > 0) {
|
||||
if (!empty($_GET['context'])) {
|
||||
$search_url .= '&context='.urlencode($_GET['context']);
|
||||
}
|
||||
if (strlen($_GET['start_stamp_begin']) > 0) {
|
||||
if (!empty($_GET['start_stamp_begin'])) {
|
||||
$search_url .= '&start_stamp_begin='.urlencode($_GET['start_stamp_begin']);
|
||||
}
|
||||
if (strlen($_GET['start_stamp_end']) > 0) {
|
||||
if (!empty($_GET['start_stamp_end'])) {
|
||||
$search_url .= '&start_stamp_end='.urlencode($_GET['start_stamp_end']);
|
||||
}
|
||||
if (strlen($_GET['answer_stamp_begin']) > 0) {
|
||||
if (!empty($_GET['answer_stamp_begin'])) {
|
||||
$search_url .= '&answer_stamp_begin='.urlencode($_GET['answer_stamp_begin']);
|
||||
}
|
||||
if (strlen($_GET['answer_stamp_end']) > 0) {
|
||||
if (!empty($_GET['answer_stamp_end'])) {
|
||||
$search_url .= '&answer_stamp_end='.urlencode($_GET['answer_stamp_end']);
|
||||
}
|
||||
if (strlen($_GET['end_stamp_begin']) > 0) {
|
||||
if (!empty($_GET['end_stamp_begin'])) {
|
||||
$search_url .= '&end_stamp_begin='.urlencode($_GET['end_stamp_begin']);
|
||||
}
|
||||
if (strlen($_GET['end_stamp_end']) > 0) {
|
||||
if (!empty($_GET['end_stamp_end'])) {
|
||||
$search_url .= '&end_stamp_end='.urlencode($_GET['end_stamp_end']);
|
||||
}
|
||||
if (strlen($_GET['duration']) > 0) {
|
||||
if (!empty($_GET['duration'])) {
|
||||
$search_url .= '&duration='.urlencode($_GET['duration']);
|
||||
}
|
||||
if (strlen($_GET['billsec']) > 0) {
|
||||
if (!empty($_GET['billsec'])) {
|
||||
$search_url .= '&billsec='.urlencode($_GET['billsec']);
|
||||
}
|
||||
if (strlen($_GET['hangup_cause']) > 0) {
|
||||
if (!empty($_GET['hangup_cause'])) {
|
||||
$search_url .= '&hangup_cause='.urlencode($_GET['hangup_cause']);
|
||||
}
|
||||
if (strlen($_GET['uuid']) > 0) {
|
||||
if (!empty($_GET['uuid'])) {
|
||||
$search_url .= '&uuid='.urlencode($_GET['uuid']);
|
||||
}
|
||||
if (strlen($_GET['bleg_uuid']) > 0) {
|
||||
if (!empty($_GET['bleg_uuid'])) {
|
||||
$search_url .= '&bleg_uuid='.urlencode($_GET['bleg_uuid']);
|
||||
}
|
||||
if (strlen($_GET['accountcode']) > 0) {
|
||||
if (!empty($_GET['accountcode'])) {
|
||||
$search_url .= '&accountcode='.urlencode($_GET['accountcode']);
|
||||
}
|
||||
if (strlen($_GET['read_codec']) > 0) {
|
||||
if (!empty($_GET['read_codec'])) {
|
||||
$search_url .= '&read_codec='.urlencode($_GET['read_codec']);
|
||||
}
|
||||
if (strlen($_GET['write_codec']) > 0) {
|
||||
if (!empty($_GET['write_codec'])) {
|
||||
$search_url .= '&write_codec='.urlencode($_GET['write_codec']);
|
||||
}
|
||||
if (strlen($_GET['remote_media_ip']) > 0) {
|
||||
if (!empty($_GET['remote_media_ip'])) {
|
||||
$search_url .= '&remote_media_ip='.urlencode($_GET['remote_media_ip']);
|
||||
}
|
||||
if (strlen($_GET['network_addr']) > 0) {
|
||||
if (!empty($_GET['network_addr'])) {
|
||||
$search_url .= '&network_addr='.urlencode($_GET['network_addr']);
|
||||
}
|
||||
if (strlen($_GET['mos_comparison']) > 0) {
|
||||
if (!empty($_GET['mos_comparison'])) {
|
||||
$search_url .= '&mos_comparison='.urlencode($_GET['mos_comparison']);
|
||||
}
|
||||
if (strlen($_GET['mos_score']) > 0) {
|
||||
if (!empty($_GET['mos_score'])) {
|
||||
$search_url .= '&mos_score='.urlencode($_GET['mos_score']);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
}
|
||||
|
||||
//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 (empty($order_by)) { $order_by = "start_epoch"; }
|
||||
if (empty($order)) { $order = "desc"; }
|
||||
|
||||
//get post or get variables from http
|
||||
if (isset($_REQUEST)) {
|
||||
@@ -112,7 +112,7 @@
|
||||
$bridge_uuid = $_REQUEST["network_addr"];
|
||||
$order_by = $_REQUEST["order_by"];
|
||||
$order = $_REQUEST["order"];
|
||||
if (strlen($_REQUEST["mos_comparison"]) > 0) {
|
||||
if (!empty($_REQUEST["mos_comparison"])) {
|
||||
switch($_REQUEST["mos_comparison"]) {
|
||||
case 'less':
|
||||
$mos_comparison = "<";
|
||||
@@ -163,96 +163,96 @@
|
||||
$sql_where_ands[] = "c.missed_call = true ";
|
||||
$sql_where_ands[] = "c.and hangup_cause <> 'LOSE_RACE' ";
|
||||
}
|
||||
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
|
||||
if (!empty($start_epoch) && !empty($stop_epoch)) {
|
||||
$sql_where_ands[] = "c.start_epoch between :start_epoch and :stop_epoch";
|
||||
$parameters['start_epoch'] = $start_epoch;
|
||||
$parameters['stop_epoch'] = $stop_epoch;
|
||||
}
|
||||
if (strlen($cdr_id) > 0) {
|
||||
if (!empty($cdr_id)) {
|
||||
$sql_where_ands[] = "c.cdr_id like :cdr_id";
|
||||
$parameters['cdr_id'] = '%'.$cdr_id.'%';
|
||||
}
|
||||
if (strlen($direction) > 0) {
|
||||
if (!empty($direction)) {
|
||||
$sql_where_ands[] = "c.direction = :direction";
|
||||
$parameters['direction'] = $direction;
|
||||
}
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
if (!empty($caller_id_name)) {
|
||||
$mod_caller_id_name = str_replace("*", "%", $caller_id_name);
|
||||
$sql_where_ands[] = "c.caller_id_name like :mod_caller_id_name";
|
||||
$parameters['mod_caller_id_name'] = $mod_caller_id_name;
|
||||
}
|
||||
if (strlen($caller_extension_uuid) > 0) {
|
||||
if (!empty($caller_extension_uuid)) {
|
||||
$sql_where_ands[] = "c.extension_uuid = :caller_extension_uuid";
|
||||
$parameters['caller_extension_uuid'] = $caller_extension_uuid;
|
||||
}
|
||||
if (strlen($extension_uuid) > 0) {
|
||||
if (!empty($extension_uuid)) {
|
||||
$sql_where_ands[] = "c.extension_uuid = :extension_uuid";
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
if (!empty($caller_id_number)) {
|
||||
$mod_caller_id_number = str_replace("*", "%", $caller_id_number);
|
||||
$sql_where_ands[] = "c.caller_id_number like :mod_caller_id_number";
|
||||
$parameters['mod_caller_id_number'] = $mod_caller_id_number;
|
||||
}
|
||||
if (strlen($destination_number) > 0) {
|
||||
if (!empty($destination_number)) {
|
||||
$mod_destination_number = str_replace("*", "%", $destination_number);
|
||||
$sql_where_ands[] = "c.destination_number like :mod_destination_number";
|
||||
$parameters['mod_destination_number'] = $mod_destination_number;
|
||||
}
|
||||
if (strlen($context) > 0) {
|
||||
if (!empty($context)) {
|
||||
$sql_where_ands[] = "c.context like :context";
|
||||
$parameters['context'] = '%'.$context.'%';
|
||||
}
|
||||
/*
|
||||
if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) {
|
||||
if (!empty($start_stamp_begin) && !empty($start_stamp_end)) {
|
||||
$sql_where_ands[] = "start_stamp between :start_stamp_begin and :start_stamp_end";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($start_stamp_begin) > 0) {
|
||||
else if (!empty($start_stamp_begin)) {
|
||||
$sql_where_ands[] = "start_stamp >= :start_stamp_begin";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($start_stamp_end) > 0) {
|
||||
else if (!empty($start_stamp_end)) {
|
||||
$sql_where_ands[] = "start_stamp <= :start_stamp_end";
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
*/
|
||||
if (strlen($answer_stamp_begin) > 0 && strlen($answer_stamp_end) > 0) {
|
||||
if (!empty($answer_stamp_begin) && !empty($answer_stamp_end)) {
|
||||
$sql_where_ands[] = "c.answer_stamp between :answer_stamp_begin and :answer_stamp_end";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($answer_stamp_begin) > 0) {
|
||||
else if (!empty($answer_stamp_begin)) {
|
||||
$sql_where_ands[] = "c.answer_stamp >= :answer_stamp_begin";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($answer_stamp_end) > 0) {
|
||||
else if (!empty($answer_stamp_end)) {
|
||||
$sql_where_ands[] = "c.answer_stamp <= :answer_stamp_end";
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($end_stamp_begin) > 0 && strlen($end_stamp_end) > 0) {
|
||||
if (!empty($end_stamp_begin) && !empty($end_stamp_end)) {
|
||||
$sql_where_ands[] = "c.end_stamp between :end_stamp_begin and :end_stamp_end";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($end_stamp_begin) > 0) {
|
||||
else if (!empty($end_stamp_begin)) {
|
||||
$sql_where_ands[] = "c.end_stamp >= :end_stamp_begin";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($end_stamp_end) > 0) {
|
||||
else if (!empty($end_stamp_end)) {
|
||||
$sql_where_ands[] = "c.end_stamp <= :end_stamp_end";
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($duration) > 0) {
|
||||
if (!empty($duration)) {
|
||||
$sql_where_ands[] = "c.duration like :duration";
|
||||
$parameters['duration'] = '%'.$duration.'%';
|
||||
}
|
||||
if (strlen($billsec) > 0) {
|
||||
if (!empty($billsec)) {
|
||||
$sql_where_ands[] = "c.billsec like :billsec";
|
||||
$parameters['billsec'] = '%'.$billsec.'%';
|
||||
}
|
||||
if (strlen($hangup_cause) > 0) {
|
||||
if (!empty($hangup_cause)) {
|
||||
$sql_where_ands[] = "c.hangup_cause like :hangup_cause";
|
||||
$parameters['hangup_cause'] = '%'.$hangup_cause.'%';
|
||||
}
|
||||
@@ -264,31 +264,31 @@
|
||||
$sql_where_ands[] = "c.bleg_uuid = :bleg_uuid";
|
||||
$parameters['bleg_uuid'] = $bleg_uuid;
|
||||
}
|
||||
if (strlen($accountcode) > 0) {
|
||||
if (!empty($accountcode)) {
|
||||
$sql_where_ands[] = "c.accountcode = :accountcode";
|
||||
$parameters['accountcode'] = $accountcode;
|
||||
}
|
||||
if (strlen($read_codec) > 0) {
|
||||
if (!empty($read_codec)) {
|
||||
$sql_where_ands[] = "c.read_codec like :read_codec";
|
||||
$parameters['read_codec'] = '%'.$read_codec.'%';
|
||||
}
|
||||
if (strlen($write_codec) > 0) {
|
||||
if (!empty($write_codec)) {
|
||||
$sql_where_ands[] = "c.write_codec like :write_codec";
|
||||
$parameters['write_codec'] = '%'.$write_codec.'%';
|
||||
}
|
||||
if (strlen($remote_media_ip) > 0) {
|
||||
if (!empty($remote_media_ip)) {
|
||||
$sql_where_ands[] = "c.remote_media_ip like :remote_media_ip";
|
||||
$parameters['remote_media_ip'] = '%'.$remote_media_ip.'%';
|
||||
}
|
||||
if (strlen($network_addr) > 0) {
|
||||
if (!empty($network_addr)) {
|
||||
$sql_where_ands[] = "c.network_addr like :network_addr";
|
||||
$parameters['network_addr'] = '%'.$network_addr.'%';
|
||||
}
|
||||
if (strlen($mos_comparison) > 0 && strlen($mos_score) > 0 ) {
|
||||
if (!empty($mos_comparison) && !empty($mos_score) ) {
|
||||
$sql_where_ands[] = "c.rtp_audio_in_mos ".$mos_comparison." :mos_score";
|
||||
$parameters['mos_score'] = $mos_score;
|
||||
}
|
||||
if (strlen($leg) > 0) {
|
||||
if (!empty($leg)) {
|
||||
$sql_where_ands[] = "c.leg = :leg";
|
||||
$parameters['leg'] = $leg;
|
||||
}
|
||||
@@ -324,7 +324,7 @@
|
||||
// if source submitted is blank, implement restriction for assigned extension(s)
|
||||
if ($caller_id_number == '') { // if source criteria is blank, then restrict to assigned ext
|
||||
foreach ($user_extensions as $user_extension) {
|
||||
if (strlen($user_extension) > 0) {
|
||||
if (!empty($user_extension)) {
|
||||
$sql_where_ors[] = "c.caller_id_number like :user_extension";
|
||||
$parameters['user_extension'] = $user_extension;
|
||||
}
|
||||
@@ -333,7 +333,7 @@
|
||||
// if destination submitted is blank, implement restriction for assigned extension(s)
|
||||
if ($destination_number == '') {
|
||||
foreach ($user_extensions as $user_extension) {
|
||||
if (strlen($user_extension) > 0) {
|
||||
if (!empty($user_extension)) {
|
||||
$sql_where_ors[] = "c.destination_number like :user_extension";
|
||||
$sql_where_ors[] = "c.destination_number like :star_99_user_extension";
|
||||
$parameters['user_extension'] = $user_extension;
|
||||
@@ -435,102 +435,102 @@
|
||||
if ($missed == true) {
|
||||
$sql .= "and c.missed_call = true ";
|
||||
}
|
||||
if (strlen($start_epoch) > 0 && strlen($stop_epoch) > 0) {
|
||||
if (!empty($start_epoch) && !empty($stop_epoch)) {
|
||||
$sql .= "and c.start_epoch between :start_epoch and :stop_epoch \n";
|
||||
$parameters['start_epoch'] = $start_epoch;
|
||||
$parameters['stop_epoch'] = $stop_epoch;
|
||||
}
|
||||
if (strlen($start_date) > 0 && strlen($stop_date) > 0) {
|
||||
if (!empty($start_date) && !empty($stop_date)) {
|
||||
$sql .= "and c.start_stamp between :start_date and :stop_date \n";
|
||||
$parameters['start_date'] = $start_date;
|
||||
$parameters['stop_date'] = $stop_date;
|
||||
}
|
||||
//if (strlen($start_stamp) == 0 && strlen($end_stamp) == 0) {
|
||||
//if (strlen($start_stamp) == 0 && empty($end_stamp)) {
|
||||
// $sql .= "and c.start_stamp between NOW() - INTERVAL '24 HOURS' AND NOW() \n";
|
||||
//}
|
||||
if (strlen($cdr_id) > 0) {
|
||||
if (!empty($cdr_id)) {
|
||||
$sql .= "and c.cdr_id like :cdr_id \n";
|
||||
$parameters['cdr_id'] = '%'.$cdr_id.'%';
|
||||
}
|
||||
if (strlen($direction) > 0) {
|
||||
if (!empty($direction)) {
|
||||
$sql .= "and c.direction = :direction \n";
|
||||
$parameters['direction'] = $direction;
|
||||
}
|
||||
if (strlen($caller_id_name) > 0) {
|
||||
if (!empty($caller_id_name)) {
|
||||
$mod_caller_id_name = str_replace("*", "%", $caller_id_name);
|
||||
$sql .= "and c.caller_id_name like :mod_caller_id_name";
|
||||
$parameters['mod_caller_id_name'] = $mod_caller_id_name;
|
||||
}
|
||||
if (strlen($caller_extension_uuid) > 0) {
|
||||
if (!empty($caller_extension_uuid)) {
|
||||
$sql .= "and c.extension_uuid = :caller_extension_uuid \n";
|
||||
$parameters['caller_extension_uuid'] = $caller_extension_uuid;
|
||||
}
|
||||
if (strlen($extension_uuid) > 0) {
|
||||
if (!empty($extension_uuid)) {
|
||||
$sql .= "and c.extension_uuid = :extension_uuid \n";
|
||||
$parameters['extension_uuid'] = $extension_uuid;
|
||||
}
|
||||
if (strlen($caller_id_number) > 0) {
|
||||
if (!empty($caller_id_number)) {
|
||||
$mod_caller_id_number = str_replace("*", "%", $caller_id_number);
|
||||
$sql .= "and c.caller_id_number like :mod_caller_id_number \n";
|
||||
$parameters['mod_caller_id_number'] = $mod_caller_id_number;
|
||||
}
|
||||
if (strlen($destination_number) > 0) {
|
||||
if (!empty($destination_number)) {
|
||||
$mod_destination_number = str_replace("*", "%", $destination_number);
|
||||
$sql .= "and c.destination_number like :mod_destination_number \n";
|
||||
$parameters['mod_destination_number'] = $mod_destination_number;
|
||||
}
|
||||
if (strlen($context) > 0) {
|
||||
if (!empty($context)) {
|
||||
$sql .= "and c.context like :context \n";
|
||||
$parameters['context'] = '%'.$context.'%';
|
||||
}
|
||||
if (strlen($start_stamp_begin) > 0 && strlen($start_stamp_end) > 0) {
|
||||
if (!empty($start_stamp_begin) && !empty($start_stamp_end)) {
|
||||
$sql .= "and c.start_stamp between :start_stamp_begin and :start_stamp_end \n";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($start_stamp_begin) > 0) {
|
||||
else if (!empty($start_stamp_begin)) {
|
||||
$sql .= "and c.start_stamp >= :start_stamp_begin \n";
|
||||
$parameters['start_stamp_begin'] = $start_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($start_stamp_end) > 0) {
|
||||
else if (!empty($start_stamp_end)) {
|
||||
$sql .= "and c.start_stamp <= :start_stamp_end \n";
|
||||
$parameters['start_stamp_end'] = $start_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($answer_stamp_begin) > 0 && strlen($answer_stamp_end) > 0) {
|
||||
if (!empty($answer_stamp_begin) && !empty($answer_stamp_end)) {
|
||||
$sql .= "and c.answer_stamp between :answer_stamp_begin and :answer_stamp_end \n";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($answer_stamp_begin) > 0) {
|
||||
else if (!empty($answer_stamp_begin)) {
|
||||
$sql .= "and c.answer_stamp >= :answer_stamp_begin \n";
|
||||
$parameters['answer_stamp_begin'] = $answer_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($answer_stamp_end) > 0) {
|
||||
else if (!empty($answer_stamp_end)) {
|
||||
$sql .= "and c.answer_stamp <= :answer_stamp_end \n";
|
||||
$parameters['answer_stamp_end'] = $answer_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($end_stamp_begin) > 0 && strlen($end_stamp_end) > 0) {
|
||||
if (!empty($end_stamp_begin) && !empty($end_stamp_end)) {
|
||||
$sql .= "and c.end_stamp between :end_stamp_begin and :end_stamp_end \n";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
else if (strlen($end_stamp_begin) > 0) {
|
||||
else if (!empty($end_stamp_begin)) {
|
||||
$sql .= "and c.end_stamp >= :end_stamp_begin \n";
|
||||
$parameters['end_stamp_begin'] = $end_stamp_begin.':00.000';
|
||||
}
|
||||
else if (strlen($end_stamp_end) > 0) {
|
||||
else if (!empty($end_stamp_end)) {
|
||||
$sql .= "and c.end_stamp <= :end_stamp_end \n";
|
||||
$parameters['end_stamp_end'] = $end_stamp_end.':59.999';
|
||||
}
|
||||
if (strlen($duration) > 0) {
|
||||
if (!empty($duration)) {
|
||||
$sql .= "and c.duration like :duration \n";
|
||||
$parameters['duration'] = '%'.$duration.'%';
|
||||
}
|
||||
if (strlen($billsec) > 0) {
|
||||
if (!empty($billsec)) {
|
||||
$sql .= "and c.billsec like :billsec \n";
|
||||
$parameters['billsec'] = '%'.$billsec.'%';
|
||||
}
|
||||
if (strlen($hangup_cause) > 0) {
|
||||
if (!empty($hangup_cause)) {
|
||||
$sql .= "and c.hangup_cause like :hangup_cause \n";
|
||||
$parameters['hangup_cause'] = '%'.$hangup_cause.'%';
|
||||
}
|
||||
@@ -542,31 +542,31 @@
|
||||
$sql .= "and c.bleg_uuid = :bleg_uuid \n";
|
||||
$parameters['bleg_uuid'] = $bleg_uuid;
|
||||
}
|
||||
if (strlen($accountcode) > 0) {
|
||||
if (!empty($accountcode)) {
|
||||
$sql .= "and c.accountcode = :accountcode \n";
|
||||
$parameters['accountcode'] = $accountcode;
|
||||
}
|
||||
if (strlen($read_codec) > 0) {
|
||||
if (!empty($read_codec)) {
|
||||
$sql .= "and c.read_codec like :read_codec \n";
|
||||
$parameters['read_codec'] = '%'.$read_codec.'%';
|
||||
}
|
||||
if (strlen($write_codec) > 0) {
|
||||
if (!empty($write_codec)) {
|
||||
$sql .= "and c.write_codec like :write_codec \n";
|
||||
$parameters['write_codec'] = '%'.$write_codec.'%';
|
||||
}
|
||||
if (strlen($remote_media_ip) > 0) {
|
||||
if (!empty($remote_media_ip)) {
|
||||
$sql .= "and c.remote_media_ip like :remote_media_ip \n";
|
||||
$parameters['remote_media_ip'] = '%'.$remote_media_ip.'%';
|
||||
}
|
||||
if (strlen($network_addr) > 0) {
|
||||
if (!empty($network_addr)) {
|
||||
$sql .= "and c.network_addr like :network_addr \n";
|
||||
$parameters['network_addr'] = '%'.$network_addr.'%';
|
||||
}
|
||||
if (strlen($mos_comparison) > 0 && strlen($mos_score) > 0 ) {
|
||||
if (!empty($mos_comparison) && !empty($mos_score) ) {
|
||||
$sql .= "and c.rtp_audio_in_mos ".$mos_comparison." :mos_score \n";
|
||||
$parameters['mos_score'] = $mos_score;
|
||||
}
|
||||
if (strlen($leg) > 0) {
|
||||
if (!empty($leg)) {
|
||||
$sql .= "and c.leg = :leg \n";
|
||||
$parameters['leg'] = $leg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user