mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-22 10:56:31 +00:00
Remove the country code if not e.164 (#6367)
This commit is contained in:
@@ -329,8 +329,13 @@ if (!class_exists('call_block')) {
|
||||
}
|
||||
if ($this->call_block_direction == 'inbound') {
|
||||
//remove e.164 and country code
|
||||
$call_block_number = str_replace("+".trim($_SESSION['domain']['country_code']['numeric']), "", trim($row["caller_id_number"]));
|
||||
|
||||
if (trim($row["caller_id_number"])[0] == "+") {
|
||||
//format e.164
|
||||
$call_block_number = str_replace("+".trim($_SESSION['domain']['country_code']['numeric']), "", trim($row["caller_id_number"]));
|
||||
} else {
|
||||
//remove the country code if its the first in the string
|
||||
$call_block_number = ltrim(trim($row["caller_id_number"]),$_SESSION['domain']['country_code']['numeric']);
|
||||
}
|
||||
//build the array
|
||||
$array['call_block'][$x]['call_block_country_code'] = trim($_SESSION['domain']['country_code']['numeric']);
|
||||
$array['call_block'][$x]['call_block_name'] = trim($row["caller_id_name"]);
|
||||
|
||||
Reference in New Issue
Block a user