mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Update xml_cdr.php
This commit is contained in:
@@ -742,48 +742,13 @@
|
||||
}
|
||||
//destination
|
||||
if (permission_exists('xml_cdr_destination')) {
|
||||
if ($_SESSION['cdr']['remove_prefix']['boolean'] == 'true') {
|
||||
//get outbound prefix variable from json table if exists
|
||||
$json_string = trim($row["json"]);
|
||||
$array = json_decode($json_string,true);
|
||||
$remove_prefix = false;
|
||||
$prefix = false;
|
||||
if (is_array($array["app_log"]["application"])) {
|
||||
foreach ($array["app_log"]["application"] as $application) {
|
||||
$app_data = urldecode($application["@attributes"]["app_data"]);
|
||||
if (substr($app_data,0,7) == "prefix=") {
|
||||
$prefix = substr($app_data,7);
|
||||
$remove_prefix = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$content .= " <td class='middle no-link no-wrap'>";
|
||||
$content .= " <a href=\"javascript:void(0)\" onclick=\"send_cmd('".PROJECT_PATH."/app/click_to_call/click_to_call.php?src_cid_name=".urlencode(escape($row['destination_number']))."&src_cid_number=".urlencode(escape($row['destination_number']))."&dest_cid_name=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_name'])."&dest_cid_number=".urlencode($_SESSION['user']['extension'][0]['outbound_caller_id_number'])."&src=".urlencode($_SESSION['user']['extension'][0]['user'])."&dest=".urlencode(escape($row['destination_number']))."&rec=false&ringback=us-ring&auto_answer=true');\">\n";
|
||||
if (is_numeric($row['destination_number'])) {
|
||||
if ($prefix) {
|
||||
//confirms call was made with a prefix
|
||||
$is_prefixed = substr(format_phone(escape(substr($row['destination_number'], 0, 20))),0,strlen($prefix));
|
||||
|
||||
//remove the prefix
|
||||
if ($prefix == $is_prefixed) {
|
||||
$content .= substr(format_phone(escape(substr($row['destination_number'], 0, 20))),strlen($prefix))."\n";
|
||||
}
|
||||
else {
|
||||
$content .= format_phone(escape(substr($row['destination_number'], 0, 20)))."\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$content .= format_phone(escape(substr($row['destination_number'], 0, 20)))."\n";
|
||||
}
|
||||
$content .= format_phone(escape(substr($row['destination_number'], 0, 20)))."\n";
|
||||
}
|
||||
else {
|
||||
if ($remove_prefix == 'true') {
|
||||
$content .= substr(format_phone(escape(substr($row['destination_number'], 0, 20))),strlen($prefix))."\n";
|
||||
}
|
||||
else {
|
||||
$content .= format_phone(escape(substr($row['destination_number'], 0, 20)))."\n";
|
||||
}
|
||||
$content .= escape(substr($row['destination_number'], 0, 20))."\n";
|
||||
}
|
||||
$content .= " </a>\n";
|
||||
$content .= " </td>\n";
|
||||
|
||||
Reference in New Issue
Block a user