OmniCHF Configuration Reference
Operator configuration is read from the application environment key :omnichf, populated at startup by config/runtime.exs. Every key is overridable by an OS environment variable. The example below shows the complete runtime configuration with the values applied when the corresponding environment variable is unset.
config :omnichf,
# SBI (service-based interface) listener
sbi_scheme: "http",
sbi_addr: "127.0.0.14",
sbi_port: 7777,
# NRF registration / heartbeat
nrf_uri: "http://127.0.0.1:7777",
# Serving PLMN identity
mcc: "999",
mnc: "70",
# Observability
prometheus_metrics_port: 9568,
# NRF heartbeat cadence
heartbeat_interval: 10_000,
# CGRateS rating / balance engine integration
cgrates_enabled: true,
cgrates_url: "http://localhost:2080/jsonrpc",
cgrates_tenant: "cgrates.org",
cgrates_timeout: 5000
# Structured JSON logging
config :logger, :default_formatter,
format: {OmniLogger.JsonFormatter, :format},
metadata: :all
Core Parameters
| Parameter | Type | Required | Default | Env Var | Description |
|---|---|---|---|---|---|
sbi_scheme | String | No | "http" | SBI_SCHEME | Transport scheme for the SBI listener (http or https). |
sbi_addr | String | No | "127.0.0.14" | SBI_ADDR | IP address the SBI HTTP server binds to, and the address advertised in the NF profile registered with the NRF. |
sbi_port | Integer | No | 7777 | SBI_PORT | TCP port the SBI HTTP server listens on and advertises to the NRF. |
nrf_uri | String | No | "http://127.0.0.1:7777" | NRF_URI | Base URI of the NRF, used for NF registration and heartbeat. |
mcc | String | No | "999" | MCC | Mobile Country Code of the serving PLMN. Used in the NF profile and serving network name. |
mnc | String | No | "70" | MNC | Mobile Network Code of the serving PLMN. Used in the NF profile and serving network name. |
prometheus_metrics_port | Integer | No | 9568 | PROMETHEUS_PORT | TCP port the Prometheus metrics endpoint is exposed on. See Metrics Reference. |
heartbeat_interval | Integer (ms) | No | 10000 | HEARTBEAT_INTERVAL | Interval in milliseconds between NRF heartbeat requests. |
CGRateS Parameters
These keys control the integration with the external CGRateS rating and balance engine. See CGRateS Integration for behavioral detail.
| Parameter | Type | Required | Default | Env Var | Description |
|---|---|---|---|---|---|
cgrates_enabled | Boolean | No | true ("true") | CGRATES_ENABLED | Master switch for CGRateS integration. When true, all charging operations call the CGRateS SessionS API for real credit authorization. When false, OmniCHF runs in bypass mode and grants a fixed default (see below). Set via the string "true" / anything-else. |
cgrates_url | String | No | "http://localhost:2080/jsonrpc" | CGRATES_URL | JSON-RPC endpoint URL of the CGRateS instance. Used only when cgrates_enabled is true. |
cgrates_tenant | String | No | "cgrates.org" | CGRATES_TENANT | CGRateS tenant name. Sent as the Tenant field on every SessionS call. Must match the tenant configured in CGRateS. |
cgrates_timeout | Integer (ms) | No | 5000 | CGRATES_TIMEOUT | Receive timeout in milliseconds for CGRateS JSON-RPC calls. The connectivity health check caps this at 3000 ms to avoid blocking. |
Default when disabled at build time: the compiled default (used if the application environment is never populated by
runtime.exs) iscgrates_enabled: false. In a normal deploymentruntime.exssets it, and there the default istrue. The test profile forcescgrates_enabled: false.
Advanced / Optional Keys
These keys are not populated by the default runtime.exs but are read from the :omnichf environment if present. They tune rating-group resolution, offline charging, and charging-ID generation. They have no dedicated environment variable and are set directly in the :omnichf config block.
| Parameter | Type | Required | Default | Env Var | Description |
|---|---|---|---|---|---|
rating_groups | Map | No | %{} | None | Map of DNN → rating group. When a session's DNN matches a key, that rating group is used in multipleUnitInformation and the CDR. |
default_rating_group | Integer | No | 1 | None | Rating group used when the DNN is not found in rating_groups. |
offline_charging_enabled | Boolean | No | false | None | When true, each released session's CDR is appended to a per-day offline charging file in addition to being logged. |
cdr_output_dir | String | No | "/var/log/omnichf/cdr" | None | Directory for offline CDR files (cdr_YYYYMMDD.json, one JSON CDR per line). Applies only when offline_charging_enabled is true. |
node_id | Integer | No | 1 | None | Node identifier (high byte) used to compose the 32-bit 3GPP chargingId per TS 32.251 clause 5.2.1.6. Give each CHF instance a unique value to keep charging IDs unique across a cluster. |
Rating Groups
rating_groups maps a DNN (the map key, a string) to the rating group (the value, an integer) applied to that DNN's sessions. The resolved rating group appears in the ratingGroup field of multipleUnitInformation returned to the consumer and in the CDR rating_group field. Resolution is:
- If the session's DNN is a key in
rating_groups, use that value. - Otherwise use
default_rating_group.
config :omnichf,
rating_groups: %{
"internet" => 10,
"ims" => 20,
"iot" => 30
},
default_rating_group: 1
Matching is on the exact DNN string. A DNN with no entry (and no default_rating_group) falls back to rating group 1. A malformed rating_groups value (not a map) is ignored and the default is used, so a bad config never blocks charging.
Logging
Structured JSON logging is configured via the :logger :default_formatter.
| Parameter | Type | Default | Description |
|---|---|---|---|
format | Tuple | {OmniLogger.JsonFormatter, :format} | Log line formatter. Emits structured JSON, suitable for ingestion by a log shipper. |
metadata | Atom / List | :all | Log metadata included in each line. :all emits all attached metadata (SUPI, DNN, PDU session ID, charging ID, procedure, etc.). |
Management Interfaces
OmniCHF exposes operator-facing management surfaces alongside the SBI. These ports are relevant for monitoring and OAM but are not part of the Nchf service:
| Interface | Port | Scheme | Purpose |
|---|---|---|---|
| SBI (Nchf) | sbi_port (default 7777) | HTTP | 5G inter-NF charging traffic. |
| Prometheus metrics | prometheus_metrics_port (default 9568) | HTTP | Metrics scrape endpoint. |
| Management API | 8443 | HTTPS | Status reads, session/statistics/CGRateS-health reads, CDR search, and OAM actions (config, CDR flush, log level, session abort, NRF re-register). |
| Control Panel | 7443 | HTTPS | Web UI for resources, configuration, license, and logs. |
Management / OAM API Endpoints
The Management API on port 8443 (HTTPS) exposes the following operator surfaces:
| Method | Path | Purpose |
|---|---|---|
GET | /api/status/api | Read API/service status. |
GET | /api/status/license | Read license status. |
GET | /api/status/nrf | Read NRF registration status. |
GET | /api/status/nf | Read NF (node) status. |
GET | /api/sessions | List active charging sessions. |
GET | /api/sessions/{id} | Inspect a single charging session by charging_data_ref. |
GET | /api/statistics | Read charging statistics (active session count, total charged volume, CGRateS reachability). |
GET | /api/health/cgrates | Read CGRateS connectivity health. |
GET | /api/oam/config | Read runtime configuration. |
PATCH | /api/oam/config/{id} | Update a runtime configuration key. |
POST | /api/oam/charging_session | Abort a charging session by charging_data_ref. |
GET | /api/oam/cdr | Search completed CDRs. Query params: supi, dnn, date_from, date_to (all optional). |
POST | /api/oam/cdr/flush | Force-flush accumulated usage as a CDR for one session ({"charging_data_ref": "<ref>"}) or all tracked sessions ({} / "all"). |
POST | /api/oam/log_level | Change the runtime log level. |
POST | /api/oam/nrf/reregister | Trigger NRF re-registration. |
Session-store visibility: the session-facing management surfaces (
/api/sessions,/api/statistics,/api/oam/charging_session,/api/oam/cdr/flush) present every live session. The live SBI charging path holds each session in a per-session worker process, and every worker session is mirrored into the in-memory Context store on create and update and removed on stop. The management surfaces query the worker registry first and fall back to Context, so a live session is always visible and actionable. See Session Store and Management Visibility for what this means operationally. CDR search (/api/oam/cdr) reads the offline CDR files and is independent of both stores.