As no one else has picked this up I will respond, but I know nothing about ASTPP or PyFreeBilling.
I wrote my own billing platform in pure PHP back in 2006 when there was nothing available that would do what I wanted. The system still remains fit for purpose so I see no need to change it for something more modern.
I adopted the approach of taking .CSV file downloads extracted from CDR data. The concept is basically very simple, all one needs to know is who made the call, to what destination, on what date, and how long the call lasted. With these four pieces of information one can produce a bill.
I have to maintain a database table of destination number prefixes, that shows the destination and the call cost per minute (for weekday, evening and weekends) and any fixed charges or surcharges for the destination in addition to the cost per minute charge. My table is currently running at about 65000 records, per carrier route - yes different carriers have different charges, and I need this data to not only bill my customers but to also check that my carriers are billing me correctly. Typical destinations look like this:
Code:
0088299 AEROMOBILE
0093 AFGHANISTAN
009377 AFGHANISTAN AREEBA MOBILE
...
00263 ZIMBABWE
0026378 ZIMBABWE ECONET MOBILE
0026386 ZIMBABWE VOIP
The process gets more complicated where we have calls that we are charged for but we are not allowed to charge the customer, like calls to the emergency services. This is further complicated by the fact that we will be charged £2.90 for an emergency call if the customer address associated with the number is correct or £5.00 if the address is wrong. There are some calls that we are not even allowed to show on a customers bill, for example calls to Childline in the UK.
You can also make your billing system more complicated, by configuring it to do bundles for certain customers, like 5000 free minutes or by introducing affinity groups whereby calls to certain numbers are cheaper. I also have multiple tariffs, so customers can choose a tariff that best fits their needs, I also have "at cost" tariff for customers who would rather pay a fixed monthly charge.
I also use the billing system for non call related recurring charges, like line rental, ADSL, fibre, or lease lines etc.
If you take CDR data from multiple sources, the format will not always be the same so you will need a process to normalise that data in to a format that will load into your billing CDR database table.
The system needs to be fully automated, so it collects CDR data daily, and emails bills in a PDF format to the customer, at a frequency of their choice, eg. weekly, monthly etc. The system also needs to send you notifications, especially if something is going wrong, like it can't find a destination number, or you are selling at a loss for any given destination.
Finally, its nice to give customers a little more than just a bill. Pie charts showing call types, and a list of the most frequently called numbers/ most expensive calls etc. always go down well.
That has probably given you enough to think about for now!
Cheers, Adrian.