Pre pay minutes

Is there a feature in Asterisk to deal with pre paid minutes?

For example a user may buy 500 minutes to call into a service, when the mins run out the call is dropped?

if two callers dial in they only have 250 mins each or a proportion of what is left depending on when they dial in?

What tools do I have available?
Is it just a case ow referencing a database and updating it on exit? This potentially means a user may get more minutes than they have credit for as the database is only updated at the end.

Thanks

There wasn’t the last person asked about this. You will have to use AMI to monitor the budgets and close the calls, as the normal call time limits are only set at the start of a call.

If you want to build your own soluition from scratch start there are many tools avaible Like, AMI, Asterisk DB, Timeout function, in the other hard you could try a2billing