Adrian Georgescu wrote:
It does not require a b2bua. It can be done in the proxy call control module that send out the BYEs and the rating engine. Just the algorithm need to be defined.
I profess ignorance as to how the rating engine works, but I presume that it involves an outside process that updates the call duration frequently?
If so, I would say that the algorithm should check if there is enough credit available for at least a minute of call time at the new rate based on the last known temporal position of all existing calls. This threshold should, perhaps, be a configurable parameter.
It won't get it right every time; that depends on where the polling / update interval for call duration falls. If the update interval is known, perhaps the wisest thing to do is to build padding into the threshold that rounds up the time consumed by the existing tracked calls to what it would be when the next duration tracking interval comes, as a fraction of the per-minute rate.
For instance, if there are 3 existing calls open at 2.9c/min and the polling interval is 10 seconds, and the new call is 5c/min, then the available credit threshold required to complete the new call should be:
0.05 + (3 * (0.029 / 6))