Billing in Asterisk

Hi I want to know how to do billing in asterisk . i can get the billsec from cdr what i want is to deduct the balance right when the call is triggered example :- if the call is pick up for 60 sec i want to charge 1 unit if it goes to 61 then 2nd unit is it possible to deduct the balance in realtime like it normally does in the telephone networks.

I think rolling your own solution will take a lot of your time. I would search for an implementation that already exists. One such option is A2Billing.

If you insist on making your own solution, I would base it on CEL rather on CDR.