Skip to content

Commit

Permalink
[SMF] Fix Volume/Time Threshold conversion Gy->PFCP
Browse files Browse the repository at this point in the history
AS shown in 3GPP TS 29.244 C.2.1.1 diagram, the meaning of Threshold
value is different in Diameter Gy and in PFCP interfaces.
In Diameter Gy the value sets the trigger for the "remaining credit",
while in PFCP the value sets the trigger for the "used credit".

ThresholdPFCP = Quota - ThresholdGy
  • Loading branch information
pespin committed Apr 5, 2024
1 parent 3064861 commit 17a87fc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/smf/gy-handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ static void urr_update_volume(smf_sess_t *sess, ogs_pfcp_urr_t *urr, ogs_diam_gy
urr->vol_quota.total_volume = 0;
}

/* Volume Threshold */
if (gy_message->cca.volume_threshold) {
/* Volume Threshold, requires Volume Quota for calculations */
if (gy_message->cca.volume_threshold &&
gy_message->cca.granted.cc_total_octets >= gy_message->cca.volume_threshold) {
ogs_debug("Adding Volume Threshold total_octets=%" PRIu32, gy_message->cca.volume_threshold);
urr->rep_triggers.volume_threshold = 1;
urr->vol_threshold.tovol = 1;
urr->vol_threshold.total_volume = gy_message->cca.volume_threshold;
urr->vol_threshold.total_volume = (gy_message->cca.granted.cc_total_octets -
gy_message->cca.volume_threshold);
} else {
urr->rep_triggers.volume_threshold = 0;
urr->vol_threshold.tovol = 0;
Expand Down Expand Up @@ -94,6 +96,7 @@ static void urr_update_time(smf_sess_t *sess, ogs_pfcp_urr_t *urr, ogs_diam_gy_m
urr->meas_method &= ~OGS_PFCP_MEASUREMENT_METHOD_DURATION;
}

/* Time Quota */
if (time_quota) {
ogs_debug("Adding Time Quota secs=%" PRIu32, time_quota);
urr->rep_triggers.time_quota = 1;
Expand All @@ -103,10 +106,12 @@ static void urr_update_time(smf_sess_t *sess, ogs_pfcp_urr_t *urr, ogs_diam_gy_m
urr->time_quota = 0;
}

if (gy_message->cca.time_threshold) {
/* Time Threshold, requires Time Quota for calculations */
if (gy_message->cca.time_threshold &&
time_quota >= gy_message->cca.time_threshold) {
ogs_debug("Adding Time Threshold secs=%" PRIu32, gy_message->cca.time_threshold);
urr->rep_triggers.time_threshold = 1;
urr->time_threshold = gy_message->cca.time_threshold;
urr->time_threshold = (time_quota - gy_message->cca.time_threshold);
} else {
urr->rep_triggers.time_threshold = 0;
urr->time_threshold = 0;
Expand Down

0 comments on commit 17a87fc

Please sign in to comment.