Add. Statistics takes account to leg. (#2653)

Add. Leg field to advanced search form.
This commit is contained in:
Alexey Melnichuk
2017-06-08 18:45:27 +03:00
committed by FusionPBX
parent d43cb9e700
commit a83d52eba6
2 changed files with 23 additions and 4 deletions

View File

@@ -107,8 +107,20 @@
echo " <option value='local'>".$text['label-local']."</option>\n";
}
echo " </select>\n";
if(permission_exists('xml_cdr_b_leg')){
echo " <select name='leg' class='formfld'>\n";
echo " <option value='' selected='selected'></option>\n";
echo " <option value='a'>a-leg</option>\n";
echo " <option value='b'>b-leg</option>\n";
echo " </select>\n";
}
echo " </td>\n";
echo " </tr>\n";
echo " <tr>";
echo " <td class='vncell'>".$text['label-caller_id_name']."</td>"; //source name
echo " <td class='vtable'><input type='text' class='formfld' name='caller_id_name' value='$caller_id_name'></td>";

View File

@@ -122,14 +122,20 @@ else {
$mos_comparison = "<>";
break;
}
} else {
$mos_comparison = '';
}
} else {
$mos_comparison = '';
}
//$mos_comparison = check_str($_REQUEST["mos_comparison"]);
$mos_score = check_str($_REQUEST["mos_score"]);
if(permission_exists('xml_cdr_b_leg')){
$leg = check_str($_REQUEST["leg"]);
}
}
//if we do not see b-leg then use only a-leg to generate statistics
if(!permission_exists('xml_cdr_b_leg')){
$leg = 'a';
}
//build the sql where string
if ($missed == true) {
@@ -182,6 +188,7 @@ else {
if (strlen($remote_media_ip) > 0) { $sql_where_ands[] = "remote_media_ip like '%".$remote_media_ip."%'"; }
if (strlen($network_addr) > 0) { $sql_where_ands[] = "network_addr like '%".$network_addr."%'"; }
if (strlen($mos_comparison) > 0 && strlen($mos_score) > 0 ) { $sql_where_ands[] = "rtp_audio_in_mos " . $mos_comparison . " ".$mos_score.""; }
if (strlen($leg) > 0) { $sql_where_ands[] = "leg='$leg'"; }
//if not admin or superadmin, only show own calls
if (!permission_exists('xml_cdr_domain')) {