Skip to main content

← Overview

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

ParameterTypeRequiredDefaultEnv VarDescription
sbi_schemeStringNo"http"SBI_SCHEMETransport scheme for the SBI listener (http or https).
sbi_addrStringNo"127.0.0.14"SBI_ADDRIP address the SBI HTTP server binds to, and the address advertised in the NF profile registered with the NRF.
sbi_portIntegerNo7777SBI_PORTTCP port the SBI HTTP server listens on and advertises to the NRF.
nrf_uriStringNo"http://127.0.0.1:7777"NRF_URIBase URI of the NRF, used for NF registration and heartbeat.
mccStringNo"999"MCCMobile Country Code of the serving PLMN. Used in the NF profile and serving network name.
mncStringNo"70"MNCMobile Network Code of the serving PLMN. Used in the NF profile and serving network name.
prometheus_metrics_portIntegerNo9568PROMETHEUS_PORTTCP port the Prometheus metrics endpoint is exposed on. See Metrics Reference.
heartbeat_intervalInteger (ms)No10000HEARTBEAT_INTERVALInterval 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.

ParameterTypeRequiredDefaultEnv VarDescription
cgrates_enabledBooleanNotrue ("true")CGRATES_ENABLEDMaster 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_urlStringNo"http://localhost:2080/jsonrpc"CGRATES_URLJSON-RPC endpoint URL of the CGRateS instance. Used only when cgrates_enabled is true.
cgrates_tenantStringNo"cgrates.org"CGRATES_TENANTCGRateS tenant name. Sent as the Tenant field on every SessionS call. Must match the tenant configured in CGRateS.
cgrates_timeoutInteger (ms)No5000CGRATES_TIMEOUTReceive 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) is cgrates_enabled: false. In a normal deployment runtime.exs sets it, and there the default is true. The test profile forces cgrates_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.

ParameterTypeRequiredDefaultEnv VarDescription
rating_groupsMapNo%{}NoneMap of DNN → rating group. When a session's DNN matches a key, that rating group is used in multipleUnitInformation and the CDR.
default_rating_groupIntegerNo1NoneRating group used when the DNN is not found in rating_groups.
offline_charging_enabledBooleanNofalseNoneWhen true, each released session's CDR is appended to a per-day offline charging file in addition to being logged.
cdr_output_dirStringNo"/var/log/omnichf/cdr"NoneDirectory for offline CDR files (cdr_YYYYMMDD.json, one JSON CDR per line). Applies only when offline_charging_enabled is true.
node_idIntegerNo1NoneNode 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:

  1. If the session's DNN is a key in rating_groups, use that value.
  2. 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.

ParameterTypeDefaultDescription
formatTuple{OmniLogger.JsonFormatter, :format}Log line formatter. Emits structured JSON, suitable for ingestion by a log shipper.
metadataAtom / List:allLog 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:

InterfacePortSchemePurpose
SBI (Nchf)sbi_port (default 7777)HTTP5G inter-NF charging traffic.
Prometheus metricsprometheus_metrics_port (default 9568)HTTPMetrics scrape endpoint.
Management API8443HTTPSStatus reads, session/statistics/CGRateS-health reads, CDR search, and OAM actions (config, CDR flush, log level, session abort, NRF re-register).
Control Panel7443HTTPSWeb UI for resources, configuration, license, and logs.

Management / OAM API Endpoints

The Management API on port 8443 (HTTPS) exposes the following operator surfaces:

MethodPathPurpose
GET/api/status/apiRead API/service status.
GET/api/status/licenseRead license status.
GET/api/status/nrfRead NRF registration status.
GET/api/status/nfRead NF (node) status.
GET/api/sessionsList active charging sessions.
GET/api/sessions/{id}Inspect a single charging session by charging_data_ref.
GET/api/statisticsRead charging statistics (active session count, total charged volume, CGRateS reachability).
GET/api/health/cgratesRead CGRateS connectivity health.
GET/api/oam/configRead runtime configuration.
PATCH/api/oam/config/{id}Update a runtime configuration key.
POST/api/oam/charging_sessionAbort a charging session by charging_data_ref.
GET/api/oam/cdrSearch completed CDRs. Query params: supi, dnn, date_from, date_to (all optional).
POST/api/oam/cdr/flushForce-flush accumulated usage as a CDR for one session ({"charging_data_ref": "<ref>"}) or all tracked sessions ({} / "all").
POST/api/oam/log_levelChange the runtime log level.
POST/api/oam/nrf/reregisterTrigger 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.