Need help with extension with time quota setting

hi all ,
i want to create a sip extension with quota of time

as an example , i want to set a quota for that extension to call only 5 minutes on a specific trunk.
how could i dont that ??

ive installed a2billling but i need you help how do achieve my needs ?
how will frepbx help me ? or how will both of asterisk or freepbx and a2billing will help me?

regards

i did something similar for a customer using the PHPAGI class. I assigned an amount of time for outbound calls daily or monthly , the value is saved in a MYSQL db which is query every time before asterisk make the Dial()