At a glance
Prices every usage event using the customer's tariff, discounts and allowances.
Key data
Receives from
- Mediation
- Product catalog
- Party & account
Sends to
- Billing
- Real-time actions
- Usage enquiry
Rated Usage Event Types
Categories of usage events processed and charged by the Rating module
Rating Flow — End-to-End
How a usage event travels from the billing pipeline through rating to monthly charge storage
Charge Calculation Models
How the rating engine calculates the charge for each usage event
Standard Charge
- Duration in seconds from the usage record
- Pulse: 30 or 60 seconds for Voice; 1 unit for SMS
- Rate in local currency per pulse from rate table
- Rate profile selected by: plan ID + charge type + call category + rating group
- Date-range check applied — CDR date must fall within rate validity window
Time-banded Charge
+ roundUp(duration / pulse) × rate
- Call duration split across day / night / late-night / holiday periods
- Each period uses its own pulse value
- Pulse count = Σ(period_duration / period_pulse)
- Holiday gains priority over regular time-bands
- All time-banded events share a dedicated charge identifier
Discount & Zero-rate
adjusted_duration = duration − free_allowance
charge = roundUp(adj / pulse) × rate
if unlimited_eligible:
charge = 0
- Free-usage allowance subtracted from duration before calculation
- Unlimited option sets charge to zero for eligible call categories
- Package eligibility checked against subscriber's active options
- Date-range validation: CDR time must be within package validity
- Adjusted duration returned to billing for storage
Rate Table — Lookup Key
How the rating engine identifies the correct tariff entry from the centralised rate table
Component Responsibilities
Detailed function of each service in the Rating module
Bill Event Processor
- Receives billing events from Mediation pipeline via event bus
- Validates subscriber identity and account status
- Identifies chargeable vs zero-rated events
- Sends chargeable events to Rating Orchestrator via internal API
- Receives rated response and stores monthly usage summaries
- Publishes rated, failed and duplicate events for downstream indexing
- Manages late-arrival events in overflow documents
Rating Orchestrator
- Receives rating requests from Bill Event Processor via internal API
- Fetches subscriber profile from data store (plan, active options, dates)
- Loads centralised rate table into memory at startup — no per-CDR DB reads
- Invokes Rate Processor for tariff resolution and charge calculation
- Invokes Discount Engine to check and apply active discount packages
- Returns rated charge and adjusted duration to Bill Event Processor
- Requires restart to pick up rate table configuration changes
Rate Processor
- Resolves the applicable rate profile from the centralised rate table
- Matches by plan ID, charge type, call category and rating group
- Validates CDR transaction date against rate validity window
- Supports multiple rate profiles per entry for historical rate changes
- Applies standard formula: roundUp(duration / pulse) × rate
- Applies time-banded formula for time-banded calls
- Entirely in-memory — no database access during rating
Real-Time Action Engine
- Listens to threshold event channels on the async event bus
- Monitors international roaming and intercontinental usage thresholds
- Monitors data usage thresholds for over-limit notifications
- Monitors top-up pack consumption status
- Triggers subscriber notification via Notification Service
- Initiates service suspend or resume via network control service
- Creates and manages threshold state documents in data store
Storage & Persistence
How and where the Rating module stores its data
Subscriber Profile Store
- Active plan and tariff package details
- Optional discount packages with validity dates
- Subscriber balance where applicable
- Read once per rating request; in-memory during processing
Rate Table (In-memory)
- Loaded into memory at service startup
- One entry per: plan + charge type + call category + rating group
- Supports multiple rate profiles with validity date ranges
- Requires service restart on configuration change
Monthly Usage Summary
- Voice monthly usage summary per subscriber
- Messaging monthly usage summary per subscriber
- Data monthly usage aggregate per subscriber
- Missed-billing overflow documents for late CDRs
- Threshold state documents (roaming / data / top-up)
Async Event Bus Channels
- Billing event input channels (from Mediation)
- Rated events output channel
- Failed / duplicate / missed event channels
- Threshold alert channels (for the Real-Time Action Engine)
Design Principles
Key architectural decisions behind the Rating module
In-memory Rate Table
The entire centralised rate table is loaded into memory at startup. No database reads occur per CDR during rating, enabling very high throughput. Configuration changes require a controlled service restart to reload the table.
Date-range Rate Validity
Each rate profile carries a validity window (start date / end date). The CDR transaction date is checked against this window, allowing historical rates and future price changes to coexist in the same rate table without requiring schema changes.
Real-time Threshold Control
Threshold monitoring is decoupled from the main rating path via the async event bus. The Real-Time Action Engine reacts independently to threshold events, enabling service suspension and subscriber notification without impacting rating latency.
Detect rating results that differ from similar customers on the same plan.
Simulate the revenue effect of tariff changes on real usage.
More in 30 AI & ML use cases and AIOps for BSS.