Citycom OAN: Always using last ctag for mgmt

This commit is contained in:
Frank Schubert
2025-11-26 15:20:36 +01:00
parent 2b825364ab
commit aeb0373cf5
3 changed files with 27 additions and 8 deletions

View File

@@ -94,6 +94,8 @@ class Citycom_OanApiHelper {
$execution_date = date("Y-m-d");
}
if(array_key_exists("ctag_range_search", $data) && $data["ctag_range_search"]) {
$ctag_range_search = $data["ctag_range_search"];
}
@@ -133,9 +135,9 @@ class Citycom_OanApiHelper {
$new_services = [];
if($ctag_range_search) {
$ctags = $preorder->getFreeCtagsInSet($ctag_range_search);
list($ctags, $mgmt_ctag) = $preorder->getFreeCtagsInSet($ctag_range_search);
} else {
$ctags = $preorder->getNextFreeCtags();
list($ctags, $mgmt_ctag) = $preorder->getNextFreeCtags();
}
$this->log->debug(print_r($ctags, true));
@@ -150,6 +152,8 @@ class Citycom_OanApiHelper {
return false;
}
$preorder_ctag_data = [
"preorder_id" => $preorder->id,
"network" => "citycom-oan",
@@ -161,7 +165,12 @@ class Citycom_OanApiHelper {
// was this service type requested
if(!in_array($stype->name, $want_services)) continue;
$ctag = $ctags[$service_count];
// ensure mgmt_ctag is always known (currently last in range)
if($mgmt_ctag && $stype->name == $allowed_service_types["mgmt"]) {
$ctag = $mgmt_ctag;
} else {
$ctag = $ctags[$service_count];
}
$ctag_service_type = array_flip($allowed_service_types)[$stype->name];
if(!$ctag_service_type) {
$this->log->error(__METHOD__.": Cannot create Service ".$stype->name." for preorder ".$preorder->id." because no ctag service type defined");