Update destination_context type inbound use public by default

Update the destination_context if the type is inbound and context is empty, then use public.
This commit is contained in:
FusionPBX
2025-10-21 12:18:14 -06:00
committed by GitHub
parent 0a07221217
commit 9dec9943ab

View File

@@ -50,6 +50,20 @@ if ($domains_processed == 1) {
}
unset($extensions, $row, $array);
//update destination_context if type is inbound and context is empty then use public
$sql = "select count(destination_uuid) as count from v_destinations ";
$sql .= "where destination_context is null ";
$sql .= "and destination_type = 'inbound' ";
$destination_count = $database->select($sql, null, 'column');
if ($destination_count > 0) {
$sql = "update v_destinations ";
$sql .= "set destination_context = 'public' ";
$sql .= "where destination_context is null ";
$sql .= "and destination_type = 'inbound' ";
$database->execute($sql, null);
unset($sql, $parameters);
}
//update destinations actions
$sql = "select * from v_destinations ";
$sql .= "where destination_actions is null ";