Fix the destination check for duplicates

This commit is contained in:
FusionPBX
2026-01-28 12:36:40 -07:00
committed by GitHub
parent 3b8392eaaa
commit d2fe653199

View File

@@ -192,7 +192,7 @@
if (empty($destination_enabled)) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."<br>\n"; }
//check for duplicates
if ($destination_type == 'inbound' && $destination_number != $db_destination_number && $_SESSION['destinations']['unique']['boolean'] == 'true') {
if ($action == 'add' && $destination_type == 'inbound' && $_SESSION['destinations']['unique']['boolean'] == 'true') {
$sql = "select count(*) from v_destinations ";
$sql .= "where (destination_number = :destination_number or destination_prefix || destination_number = :destination_number) ";
$sql .= "and destination_type = 'inbound' ";