diff --git a/pyproject.toml b/pyproject.toml index 937bbb7a6c10061dac0ff7c783f39c4d4f8f0af6..fde50795f8cbb7d1064bc39957c1dd4cc5f43f1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "sunrise6g-opensdk" -version = "1.1.0" +version = "1.1.1" description = "Open source SDK to abstract CAMARA/GSMA Transformation Functions (TFs) for Edge Cloud platforms, 5G network cores and Open RAN solutions." keywords = [ "Federation", diff --git a/src/sunrise6g_opensdk/network/adapters/oai/client.py b/src/sunrise6g_opensdk/network/adapters/oai/client.py index cd0e13cc475070ee242d3a09124f5f713f2b2151..e4d4a7956948585041b9cfd073940fdd97e58a15 100644 --- a/src/sunrise6g_opensdk/network/adapters/oai/client.py +++ b/src/sunrise6g_opensdk/network/adapters/oai/client.py @@ -221,10 +221,12 @@ class NetworkManager(BaseNetworkClient): """ expire_time = datetime.now(timezone.utc) + timedelta(hours=1) return schemas.MonitoringEventSubscriptionRequest( - # notification destination is harded coded because it is not used currently but is needed as a placeholder, could later be added as a variable + # notificationDestination is a required placeholder per the 3GPP schema will be used in future; + # location is returned inline (immediateRep=true) so this URL is never called. notificationDestination="http://localhost:8080/callback", monitoringType=schemas.MonitoringType.LOCATION_REPORTING, maximumNumberOfReports=1, + immediateRep=True, monitorExpireTime=expire_time, ) diff --git a/src/sunrise6g_opensdk/network/core/schemas.py b/src/sunrise6g_opensdk/network/core/schemas.py index c7ee2545cc56bf55a120ef86aeb17f543c6d1c4b..6bfa986db3f3c8c6877c47207e7cd2e98a3bb9e3 100644 --- a/src/sunrise6g_opensdk/network/core/schemas.py +++ b/src/sunrise6g_opensdk/network/core/schemas.py @@ -355,6 +355,14 @@ class MonitoringEventSubscriptionRequest(BaseModel): None, description="Indicates whether the request is for Current Location, Initial Location, or Last Known Location.", ) + immediateRep: bool | None = Field( + None, + description=( + "When set to true, requests immediate inline delivery of the monitoring event " + "report in the POST response body (3GPP TS 29.522). Required for synchronous " + "location retrieval on spec-compliant NEFs." + ), + ) repPeriod: DurationSec | None = Field( None, description="Identifies the periodic time for the event reports." ) diff --git a/tests/network/aoi_location_retrieval_test.py b/tests/network/aoi_location_retrieval_test.py index d0980430d6e2c41565dc314074e646abf2097a6b..0f1c9fc314699fcac46d36be4c4e9d045b298f25 100644 --- a/tests/network/aoi_location_retrieval_test.py +++ b/tests/network/aoi_location_retrieval_test.py @@ -70,6 +70,8 @@ class TestCamaraToOai3gppTransformation: assert result.externalId == "imsi-001010000000001" assert result.monitoringType == MonitoringType.LOCATION_REPORTING assert result.maximumNumberOfReports == 1 + # immediateRep must be True — required for inline synchronous response (3GPP TS 29.522) + assert result.immediateRep is True # OAI adapter must NOT set locationType (NEF rejects it) assert result.locationType is None # msisdn should not be set (OAI uses externalId) @@ -82,6 +84,8 @@ class TestCamaraToOai3gppTransformation: ) json_str = result.model_dump_json(exclude_none=True, by_alias=True) assert '"externalId":"imsi-001010000000001"' in json_str.replace(" ", "") + # immediateRep must appear in the JSON sent to the NEF + assert '"immediateRep":true' in json_str.replace(" ", "") # locationType must NOT appear in the JSON assert "locationType" not in json_str