From 09bd7c3aa9c83488152f195c77cbb877be76fa74 Mon Sep 17 00:00:00 2001 From: Carsten Date: Wed, 8 Apr 2026 16:33:30 +0200 Subject: [PATCH] Add documentation for mid-session Gx RAR / PUT /pcrf/ PCC rule install in PCRF_Notes.md --- CHANGELOG.md | 1 + docs/PCRF_Notes.md | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ba275a..18618c4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Documentation: mid-session Gx RAR / `PUT /pcrf/` PCC rule install in `docs/PCRF_Notes.md` - 2G / 3G support via Osmocom GSUP. - Support for running PyHSS services in Docker containers and provide official Docker images. - Database types postgresql and sqlite. diff --git a/docs/PCRF_Notes.md b/docs/PCRF_Notes.md index 14465c4c..98e9e292 100644 --- a/docs/PCRF_Notes.md +++ b/docs/PCRF_Notes.md @@ -191,3 +191,17 @@ Now we've created the Charging Rule, we can just add it to the charging_rule_lis In the `charging_rule_list` object wen can add additional comma separated Charging Rule IDs for other defined Charging Rules. (Setting the value to None will result in no Charging Rules being installed in the Credit Control Answer) Then when a subscriber attaches to one of these APNs, the Charging Rules listed in the `charging_rule_list` will be returned in the *Gx Credit Control Answer* and installed into the PCEF in the PGW. + +## Mid-session PCC rule install (Gx RAR) + +PyHSS can **push** an already-defined charging rule to an **active** P-GW session by sending a **Gx Re-Auth-Request (RAR)**. This is used for **policy / QoS changes only** (for example switching to a throttled rule after fair-use). Online charging (Gy) and balances are handled by the **OCS**; PyHSS does **not** implement quota metering. + +**REST API:** `PUT /pcrf/` with JSON body: + +| Field | Description | +|-------|-------------| +| `imsi` | Subscriber IMSI | +| `apn_id` | Numeric APN id in PyHSS (same APN as the active session) | +| `charging_rule_id` | Rule id from `/charging_rule/` to install | + +Requirements: the subscriber must have an active **serving APN** entry with a valid **PCRF session** and **serving PGW** so PyHSS can route the RAR. If there is no live session, the push will not apply as intended. \ No newline at end of file