How to connect asterisk to a accounting like IBS

i want to give some PIN or user/pass to some sip user thar are in my city
so,to give calling cost and have some rate for difrent location,i want to have a accounting
i specialy need to check the user credit befor starting caal,if he hasnt credit dont allow him to call, and during a call if credit be 0 accuounting should say asterisk to terminate the call i usually use cisco whith IBS and it work good but here i want to run over asterisk can anyone tell my how can,or its maybe in asterisk word to simply run this project?
and if yes please tell me about installation and configuration tip to run that
thankyou for your attention

hi there is no any solution?

This should be eazily done in the Asterisk diaplan. You should use a database for storing your customer credentials and check the database entry for every call the customer makes.

i have a accunting like IBS,then i can have user&pass,can you explane how and where i can use ibs as accunting for starting a call,and also during a call if user credit be low asterisk should hangup the call
can you explane an example and configuration sample

Type “core show application dial” at the CLI prompt and look for the options that set time limits on calls.