diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php
index 7880c69417..9158cb9519 100644
--- a/app/destinations/destination_edit.php
+++ b/app/destinations/destination_edit.php
@@ -54,6 +54,7 @@ else {
$dialplan_uuid = check_str($_POST["dialplan_uuid"]);
$destination_type = check_str($_POST["destination_type"]);
$destination_number = check_str($_POST["destination_number"]);
+ $db_destination_number = check_str($_POST["destination_number"]);
$destination_caller_id_name = check_str($_POST["destination_caller_id_name"]);
$destination_caller_id_number = check_str($_POST["destination_caller_id_number"]);
$destination_context = check_str($_POST["destination_context"]);
@@ -78,17 +79,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if (strlen($destination_context) == 0) { $msg .= $text['message-required']." ".$text['label-destination_context']."
\n"; }
if (strlen($destination_enabled) == 0) { $msg .= $text['message-required']." ".$text['label-destination_enabled']."
\n"; }
- //get the current destination_number
- $db_destination_number = '';
- $sql = "select destination_number from v_destinations ";
- $sql .= "where destination_uuid = '".$destination_uuid."' ";
- $prep_statement = $db->prepare($sql);
- if ($prep_statement) {
- $prep_statement->execute();
- $row = $prep_statement->fetch(PDO::FETCH_ASSOC);
- $db_destination_number = $row['destination_number'];
- }
-
//check for duplicates
if ($action == "add" || $destination_number != $db_destination_number) {
$sql = "select count(*) as num_rows from v_destinations ";
@@ -542,6 +532,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "