# CDR-Based Billing Explained: From Phone Call to Invoice

## What is a CDR?

A Call Detail Record (CDR) is a data file generated by a telecom switch or SIP server that captures the details of a single communication event. A typical VoIP CDR contains:

- **Calling number** (A-party)
- **Called number** (B-party)
- **Start time** and **end time**
- **Duration** (in seconds)
- **Routing information** (which carrier handled the call)
- **Call result** (answered, busy, no answer)

For an operator serving 500 business customers, each making dozens of calls per day, this adds up to millions of CDRs per month.

## The Rating Process

Rating is the process of assigning a monetary value to each CDR. It involves three steps:

### 1. Normalisation

Raw CDRs arrive in different formats depending on the switch vendor. The billing engine normalises them into a standard internal format before processing.

### 2. Destination Classification

The called number is matched against a destination table. Is this a national call? Mobile? International? Premium rate? The answer determines which rate applies.

### 3. Rate Application

The rate for the destination is applied to the call duration. This might be:

- A flat per-call fee
- A per-minute rate (rounded to the nearest second, 6 seconds, or 60 seconds depending on your contract)
- A tiered rate (first 100 minutes free, then €0.002/min)

The output is a **rated CDR**: the original CDR plus a calculated cost.

## From Rated CDRs to an Invoice

Once all CDRs for a billing period are rated, they are aggregated by customer account. The billing engine:

1. **Groups calls** by customer, by destination category, by service line
2. **Adds recurring charges** (monthly subscription fees, hardware rental, etc.)
3. **Applies discounts or commitments** (volume discounts, promotional pricing)
4. **Generates the invoice** as a structured document with line items per service

In BlueRockTEL, this entire process runs automatically on a schedule. For an operator with 500 customers, the full billing run completes in minutes.

## Margin Analysis

A well-designed billing system does not just generate customer invoices. It also tracks the cost side:

- What did the carrier charge us for each call?
- What are we charging the customer?
- What is the margin per destination? Per customer? Per month?

This real-time margin visibility is one of the most valuable features of an integrated BSS, it allows operators to identify unprofitable customer relationships or pricing anomalies before they become serious problems.

## Conclusion

CDR-based billing is technically complex but operationally critical. Getting it right, at scale, with accuracy, every month, is the difference between a profitable telecom operation and one that is constantly firefighting billing disputes. Purpose-built tools, designed for this specific problem, deliver reliability that generic accounting software simply cannot match.
