Commit b84e9588 authored by Anastasios Pandis's avatar Anastasios Pandis Committed by Dimitrios Gogos
Browse files

Fix/location oai immediatereport

parent 4ce5e9d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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",
+3 −1
Original line number Diff line number Diff line
@@ -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,
        )

+8 −0
Original line number Diff line number Diff line
@@ -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."
    )
+4 −0
Original line number Diff line number Diff line
@@ -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