VoIP Billing
Real-Time VoIP Billing System

How to Build a Real-Time VoIP Billing System That Prevents Revenue Leakage

Revenue leakage from your VoIP business would typically never make itself known. The difference between the volume of calls on your network and the revenues recorded in your accounting records will reflect this. When you compare revenues and volumes on a monthly basis, you might realize there’s a problem, but by then, you may have already lost several weeks’ worth of margins on your top traffic routes.

Putting together a VoIP billing system capable of eliminating revenue leakages will require carefully designed architectures in all five areas: CDR, mediation, rating, balance check, and reporting. The following guide addresses everything needed to develop such a billing system.

Understanding Revenue Leakage in VoIP Operations

There are many causes of revenue leakage in a VoIP billing environment, and they might not be so evident.

Unprocessed or Dropped CDRs

Every call creates a Call Detail Record. Even a 0.5% loss of such records due to any reason means that you lose some revenues as the amount you bill becomes less than the actual amount of traffic carried. The higher your volume of work, the more money you lose because of this problem.

Timing Gaps in Prepaid Balance Checking

Prepaid accounts require checking their credits in real time during the process of call initiation. Delays here mean that people are able to make long-distance calls without having enough credits on their accounts, which means a lot in terms of losses if you have thousands of prepaid clients.

Incorrect Rate Application

VoIP services are charged according to many criteria: per minute costs according to destination, special charges, additional connection rates, and minimum call duration. If there is an error in setting up a rate of destination or other parameters, it will cost you much money in case of a large number of calls.

Wholesale Cost Tracking Failures

If you sell VoIP services, your profit margin will depend on the gap between what you charge the customers and what you pay the carriers. In case your billing system fails to monitor termination rates for each route, you risk selling your services at a loss.

Free Minute Bundle Overruns

Customers with free minute bundles who use all these minutes without exceeding the bundle and without getting charged extra per minute.

Architecture of a Real-Time VoIP Billing System

A VoIP Billing Platform that prevents revenue leakage needs to process usage data as it happens, not in batches at the end of the day. Here is the technical architecture that makes that possible.

Layer 1: CDR Collection

CDRs originate at your media servers (FreeSWITCH, Asterisk) and SIP proxies (Kamailio, OpenSIPS). Your billing platform needs to collect these records through reliable channels.

  • RADIUS accounting: Standard protocol for real-time accounting messages from media servers
  • DIAMETER: Preferred for carrier-grade deployments and 4G/LTE-connected services
  • SIP-based CDRs: Some platforms generate CDRs directly from SIP signaling
  • Direct database integration: For platforms that write CDRs to a shared database

The collection layer must be reliable and redundant. CDRs that fail to reach the billing system are CDRs that never get billed.

Layer 2: CDR Mediation

Telecom Billing Software includes a mediation layer that normalizes raw CDRs from different sources into a consistent format for rating. Mediation handles:

  • Format normalization (different platforms generate CDRs in different formats)
  • Duplicate detection (the same call may generate CDRs from multiple network elements)
  • CDR enrichment (adding subscriber data, rate plan information, and routing metadata)
  • Error handling and exception queuing for records that fail validation

Mediation is where most CDR drop issues originate. A robust mediation layer logs every record it receives, every record it processes, and every record that fails, and alerts on any drop rate above your defined threshold.

Layer 3: Real-Time Rating Engine

The rating engine applies pricing rules to each mediated CDR and calculates the charge. For prepaid subscribers, this must happen in real time, before the call completes. For postpaid subscribers, near-real-time rating (within seconds of call completion) is acceptable.

A high-performance rating engine needs:

  • In-memory rate table caching to avoid database lookups on every call
  • Support for multi-dimensional rate structures (destination, time of day, subscriber tier, bundle status)
  • Minimum call duration enforcement
  • Connection fee application
  • Currency and rounding rule handling

Layer 4: Online Charging System (OCS) for Prepaid

For prepaid subscribers, credit control must happen before the call is connected. The OCS receives a credit check request from your media server via RADIUS or DIAMETER, validates the subscriber’s available balance, authorizes a specific number of minutes or units, and decrements the balance as the call progresses.

Key OCS requirements:

  • Sub-100ms response time for credit authorization requests
  • Real-time mid-call balance monitoring with automatic disconnect on credit exhaustion
  • Reservation and release logic for calls that do not complete
  • Balance notification thresholds that trigger alerts or top-up prompts

Layer 5: Invoice Generation and Reconciliation

Postpaid billing requires accurate invoice generation on your billing cycle, reconciliation of your carrier costs against subscriber revenue, and dispute management for billing exceptions.

  • Automated invoice generation with itemized CDR breakdowns
  • Carrier invoice import and cost-per-route reconciliation
  • Margin reporting by product, route, and subscriber segment
  • Exception reporting for CDRs that could not be rated

Real-Time Monitoring: Catching Leakage Before It Accumulates

Even the best-architected billing system can develop leakage over time as the network changes. Real-time monitoring is your early warning system.

  • CDR throughput monitoring: Alert when CDR intake drops below expected rates
  • Rating exception dashboard: Real-time visibility into unrated CDRs
  • Revenue per route tracking: Flag routes where revenue per minute drops unexpectedly
  • Prepaid balance anomaly detection: Alert on accounts with unusual credit consumption patterns
  • Carrier cost spike alerting: Flag sudden increases in termination costs on specific routes

Integration Requirements

The VoIP Billing System does not exist in isolation. It requires seamless integration with other systems, both for revenue generation and efficiency.

CRM Integration

The subscriber accounts, the service plans, and the available credit on those subscribers from your CRM system must match those in your billing system. Inconsistency between your CRM and billing systems will lead to rating errors.

Payment Gateway Integration

To facilitate prepaid top-up services and automated payments of postpaid invoices, you require seamless integration with your payment gateway so that there is no additional administrative work.

LCR Integration

Least-cost routing helps decide what route each call takes and which carrier terminates the calls. The billing platform must know which route the call has taken in order to rate the call according to the appropriate carrier rate.

Reseller Portal

In case you deal with resellers, then you would require a reseller portal in your billing system, enabling the resellers to add their subscribers, set pricing within their margins, and track their revenues.

Frequently Asked Questions

Q: What percentage of revenue leakage is typical in VoIP operations?

Industry estimates suggest that 5 to 15 percent of VoIP revenue is lost to leakage in operations without dedicated real-time billing controls. Operations with robust real-time billing systems typically keep leakage below 1 percent.

Q: How does real-time billing differ from batch billing?

Batch billing processes CDRs in scheduled runs, typically hourly or daily. Real-time billing processes each CDR within seconds of call completion. For prepaid, real-time billing is non-negotiable. For postpaid, near-real-time processing catches issues before they compound across a full billing cycle.

Q: What database technology is best for a high-volume VoIP billing system?

For CDR storage at high volumes, columnar databases (ClickHouse, Apache Cassandra) offer better read performance for reporting queries than row-oriented databases. For rating tables and subscriber data, PostgreSQL or MySQL work well. Separating CDR storage from subscriber data storage is a common pattern in high-volume deployments.

Q: How do we handle CDR disputes with carriers?

Your billing platform should maintain a complete CDR archive at the raw, pre-rated level. Carrier dispute resolution requires comparing your CDR records against the carrier’s invoice at the individual record level. Automated reconciliation tools that flag discrepancies above a defined threshold save significant manual work.

Q: Can open-source billing platforms handle carrier-grade volumes?

Yes. Platforms like CGRateS, FreeRADIUS, and custom-built solutions on PostgreSQL or Cassandra backends can handle very high CDR volumes. The architecture and tuning matter more than whether the platform is commercial or open-source.

Build a Revenue-Tight VoIP Billing System with Dialiqo

Dialiqo develops bespoke VoIP billing systems and telecom billing software that are engineered to be free from revenue leaks right from their inception. Our engineering team specializes in working with real-time rating engines, OCS integration, carrier reconciliations, and reseller billing portals.

Contact Dialiqo now for the start of your billing platform development project. Learn more about Dialiqo’s expertise at dialiqo.com.

Author

Chetan Patel