Skip to content

Configuration

The platform is configured through TOML files parsed by tomlplusplus. There is one file per role under etc/, each driving a different subset of modules. The path is supplied to the server binary via -i. Utils::setup parses the file once at startup and exposes typed accessors UTILS::instance()->get_d(section, key) (integer) and get_s(section, key) (string).

File Layout

etc/
├── prepaid.toml                # Prepaid OCS role
├── cdr_loader.toml             # CDR ingestion role
├── billing1.toml               # Billing role for bill-cycle 1
├── billing2.toml               # Billing role for bill-cycle 2
├── billing3.toml               # Billing role for bill-cycle 3
├── billing4.toml               # Billing role for bill-cycle 4
├── prepaid_mass_rating.toml    # Developer-only mass rating role
├── crm.toml                    # CRM gRPC role
├── mediation.toml              # Roaming usage ingestion role
├── roaming.toml                # Roaming charging + TAP-out role
├── bill_formatter.toml         # PDF bill formatter role
├── cdr_generator.toml          # Tool config — bin/cdr_generator
├── diameter_client.toml        # Tool config — bin/diameter_client
├── certs/                      # TLS material for the CRM gRPC endpoint
└── templates/                  # *.template sources instantiated on deploy

The cdr_generator.toml and diameter_client.toml files configure standalone tools, not the server binary itself.

Common Sections

These sections appear (with the same semantics) in nearly every role's TOML.

[modules]

Boolean (0/1) gate per platform module. Read by main.cpp. The license feature mask still has final say, but [modules] is what enables the wiring at all:

[modules]
billing             = 0
prepaid             = 1
cdr_loader          = 0
crm                 = 0
bill_formatter      = 0
mediation           = 0
roaming             = 0

The reference role files each enable exactly one module (the exception is prepaid_mass_rating.toml, which enables both billing and prepaid_mass_rating). The roaming roles are read with a tolerant getter, so existing role TOMLs that predate them keep working without a mediation/roaming key.

[system]

[system]
thread_pool_size  = 8
timestamp_format  = "%Y-%m-%d %H:%M:%S"
time_zone         = "Europe/Bucharest"
ssl               = 0   # only present in prepaid.toml; not read by the engine

thread_pool_size is consumed by THREAD_POOL::instance()->init(size) in main.cpp. timestamp_format is used for both Utils::to_datetime and Utils::from_datetime.

[db]

[db]
username = "${MICROBSS_DB_USERNAME}"
password = "${MICROBSS_DB_PASSWORD}"
host     = "${MICROBSS_DB_HOST}"
port     = "${MICROBSS_DB_PORT}"   # MySQL X DevAPI port (33060 by default)
database = "${MICROBSS_DB_DATABASE}"
poolsize = 15

Credentials are never written into the TOML: they expand from the MICROBSS_DB_* environment variables (dev_env.sh, or etc/db.local.env on a deployed host). Every role connects to the same MySQL instance via mysqlcppconnx (X DevAPI) through one pooled mysqlx::Client; each worker thread checks out its own session. poolsize is the client pool's maximum size, and the bill-cycle fan-out caps [billing] parallelism to poolsize - 2 so workers cannot starve on session checkout.

[logging]

See Logging for full semantics.

[app]

[app]
operator_id                      = 3
free_units_functionality         = 1
initial_delay                    = 0
interval                         = 60
activity_heartbeat_stale_s       = 600
activity_heartbeat_interval_subs = 10

operator_id filters reference-data queries to the active operator. free_units_functionality toggles free-unit accounting in the rater. initial_delay and interval are passed to ACE_Reactor::schedule_timer for the timer-driven handlers (CDR loader, billing, stats, bill formatter); units are seconds.

activity_heartbeat_stale_s is the watchdog threshold consulted by BillingHandler::handle_timeout (see Postpaid Billing). A PROCESSING activity whose heartbeat_at is older than this many seconds is presumed dead and is transitioned to ACTIVITY_STATUS_ERROR on the next tick. The default of 600 seconds is generous so a long bill run on limited hardware does not trip a false positive; setting it to 0 disables the watchdog entirely.

activity_heartbeat_interval_subs is the cadence at which DB_layer::billCycle refreshes the heartbeat inside its per-subscriber loop. One beat per ten subscribers (the default) keeps heartbeat_at comfortably fresh without hammering the database; setting it to 0 heartbeats only at the start and end of the run.

[license]

[license]
license_key = "${BSS_HOME}/var/lib/license/platform.lic"
lkgt_path   = "${BSS_HOME}/var/lib/license/.lkgt"

Required in every role. Validated before any module is initialised.

Role-Specific Sections

prepaid.toml

[server]
port = 10100

The DIAMETER acceptor listens here. TLS on this port is a compile-time choice, not a TOML switch: the default build includes security/ssl.hpp (from utils/utility.hpp), so the acceptor is an ACE_SSL_SOCK_Acceptor loading etc/certs/server.crt / server.key. The [system].ssl key is a leftover and is not read.

billing*.toml

[billing]
billcycle = 1   # 2 in billing2.toml, 3 in billing3.toml, 4 in billing4.toml

BillingHandler::setBillcycle is called with this value. Activities whose bill-cycle does not match are silently rejected by the running process, so each bill-cycle has at most one process draining it.

cdr_loader.toml

[cdr]
cdr_path                  = "${BSS_HOME}/var/spool/cdr"
cdr_prefix                = "data"
new_cdr_path              = "${BSS_HOME}/var/spool/cdr/new"
processed_cdr_path        = "${BSS_HOME}/var/spool/cdr/processed"
error_cdr_path            = "${BSS_HOME}/var/spool/cdr/error"
duplicate_cdr_path        = "${BSS_HOME}/var/spool/cdr/duplicate"
new_cdr_extension         = ".cdr"
processed_cdr_extension   = ".done"
error_cdr_extension       = ".error"
duplicate_cdr_extension   = ".duplicate"

new_cdr_path is polled on every tick. Files matching new_cdr_extension are processed and renamed with the appropriate suffix. Files whose CDR id is already present in the offline table land in duplicate_cdr_path with the .duplicate suffix rather than error/ — a re-presented CDR is expected upstream-mediation behaviour, not an error. The paths resolve through ${BSS_HOME} at runtime, so they follow the deployment prefix without rewriting.

cdr_generator.toml

[generator]
gen_voice_min  = 3
gen_voice_max  = 30
gen_data_min   = 1024
gen_data_max   = 10240
gen_sms_units  = 1
gen_mms_units  = 1
gen_date_start = "2025-06-01 00:00:00"
gen_date_end   = "2026-02-01 00:00:00"
gen_b_number   = "40747498888"

Used by bin/cdr_generator to drive synthetic load.

crm.toml

[server]
port = 50051
host = "0.0.0.0"
shutdown_deadline_s = 5

[tls]
cert_path    = "${BSS_HOME}/etc/certs/server.crt"
key_path     = "${BSS_HOME}/etc/certs/server.key"
ca_cert_path = "${BSS_HOME}/etc/certs/ca.crt"

[jwt]
secret   = "${MICROBSS_JWT_SECRET}"
issuer   = "crm-server"
audience = "crm-api"

TLS is mandatory — there is no cleartext fallback; if the TLS material fails to load the server refuses to start. The JWT secret is read from the MICROBSS_JWT_SECRET environment variable, which dev_env.sh loads from etc/.jwt_secret (created and rotated by set_env.sh), never hard-coded.

bill_formatter.toml

[bill_formatter]
template_dir = "${BSS_HOME}/usr/share/templates"
output_dir   = "${BSS_HOME}/var/spool/invoice"
billcycle    = -1
year         = -1
month        = -1

-1 on the period filters means no filter; the formatter picks up any bill with status BILL_STATUS_NEW. The three filter fields are present for future scoping (e.g. running a one-shot formatter for a single archived month) but not currently consulted by BillFormatterHandler.

diameter_client.toml

See Prepaid Charging. Drives the bin/diameter_client load tester: connection target, execution mode, MSISDN pools, per-service ranges, and event-type distribution.

mediation.toml

[mediation]
formats_dir      = "${BSS_HOME}/etc/mediation/formats"
in_path          = "${BSS_HOME}/var/spool/mediation/in"
done_path        = "${BSS_HOME}/var/spool/mediation/done"
reject_path      = "${BSS_HOME}/var/spool/mediation/reject"
roaming_new_path = "${BSS_HOME}/var/spool/roaming/new"
cdr_new_path     = "${BSS_HOME}/var/spool/cdr/new"

Enables the mediation module. MediationDaemon polls in_path each [app] interval, selects a format descriptor from formats_dir, normalises each record to a canonical CDR — roaming records to roaming_new_path, home and native records to cdr_new_path (the CDR loader feed) — and archives the source to done_path (or reject_path with a .reason on a file-level failure). See Mediation.

roaming.toml

[roaming]
new_cdr_path        = "${BSS_HOME}/var/spool/roaming/new"
processed_cdr_path  = "${BSS_HOME}/var/spool/roaming/processed"
error_cdr_path      = "${BSS_HOME}/var/spool/roaming/error"
duplicate_cdr_path  = "${BSS_HOME}/var/spool/roaming/duplicate"
tapout_path         = "${BSS_HOME}/var/spool/tapout"
sender_tadig        = "ROUO1"
settlement_currency = "EUR"
sweep_age_s         = 0

Enables the roaming module. RoamingDaemon rates the Direction-1 CDRs from the roaming spool through the convergent Rater's roaming-tariff branch, and runs the Direction-2 pass that prices visiting-roamer usage at the wholesale IOT and emits TAP-out batches to tapout_path. sweep_age_s = 0 settles ended visits only. See Roaming.

Paths after deployment

TOML files never hard-code absolute paths: every path resolves at runtime through ${BSS_HOME}/… (or ${MICROBSS_*} for secrets and the log path), and in production the engine resolves BSS_HOME from BACKEND_PREFIX. Config files therefore need no rewriting after a move — unpack.sh instantiates them from the shipped *.templates into the target prefix. Operators rarely edit TOML by hand. For the full deployment flow see the Installation guide.