End multiple calls when no credit

Hello everyone

glad to be a part of community)

Would appreciate any suggestions to my question for my current project

i am trying to build a simple prepaid system that will run in Realtime mode , the task is to end a calls when the credit is depleted. The initial call ending is not a problem doing with timeout or L.
exten => 123,1,Set(foo=${TIMEOUT(absolute)})

but when i have multiple concurrent calls that all withdraw credit from the main account and start at different time. Is there a way how to check on the credit and end the call / all calls if it’s depleted ?

the only was i can think of right now is to check the session each second and use asterisk monitor to end calls , but in this way the system will generate huge load when the amount of calls will increase.

please share your experience or thoughts

thx in advance