Telecom billing and real-time charging is the software that charges you for every call, SMS and megabyte you use on a mobile network. For a prepaid SIM, it checks your balance in real time, while you use the network. For a postpaid SIM, it collects a month of usage and turns it into a bill. It is the largest part of the operator's business software, described in telecom OSS and BSS.
Real-time charging is done by a system called the online charging system, or OCS. In 5G networks, the same job is done by the charging function. Each use is priced according to the customer's plan. Working out this price is called rating.
Take, for example, a hotel-management student in Dehradun on a prepaid plan of ₹299 for 28 days, with 1.5 GB of data a day. She opens a video app. Before letting her data through, the packet core asks the charging system for permission. The charging system checks her plan, finds 1.5 GB left for the day, and grants a slice of it, say 50 MB. The packet core lets her use those 50 MB and then asks for the next slice. This is why your data counter drops the moment you use data. By 9 p.m. she has used the full 1.5 GB, and the charging system grants nothing more. Her plan says that her speed then drops to 64 kbps until midnight. So the packet core slows her connection instead of cutting it off.
Postpaid works differently. The network writes a usage record for each call, SMS and data session. These records are called call detail records, or CDRs. At the end of the month, the billing system adds up the records and applies the plan. It adds extras, such as international calls, and then adds 18% GST. Then it produces the bill.
Charging must be fast and exact. The charging system must answer each request for a slice within milliseconds, for crores of subscribers at the same time. If it stops working, the operator must choose between blocking everyone's data and giving it away free. So operators run several copies of it in different data centres.
The same system charges many other things. It bills SIMs inside machines, home broadband over fixed wireless access, and extras such as cloud storage bundled with a plan. Roaming and settlement sends it the charges for use abroad. A new subscriber's account is first created by SIM activation. Brands that sell plans on another operator's network, called MVNOs, often rent billing software as a service instead of buying it.