Hi
The system works as follows:-
Call made,
match dialled digits to dialcodes, and discover rate
Check balance and calculate maximum total duration
Send dial command to Asterisk, containing the total duration of the call with the L parameter
Calls hangs up, either forcibly, or because customer hangs up.
Calculate cost of call.
Update balance.
So with a single call, there is no way (unless you have made some "improvements") that the balance can go into negative balance.
However, you will notice that the balance is updated at the end of the call. Therefore calls on the same account that start during the first call will be given the same maximum time duration as the first.
This problem can be alleviated with the dial balance reservation setting in the agi-conf.
Joe