ref: 240b3444466fb458b517d84c83bd6a782a21934e jmp-schemas/deploy/cdr_charge.sql -rw-r--r-- 1.4 KiB
Do not bill over user limit without consent

If the user has no configured limit in Redis, limit is 0
If the CDR would cost less than their limit, bill normally
If they have already spent more than within buffer of their limit, bill normally
Else, bill only enough to get up to their limit
Function to compute the amount to charge a customer for a given cdr

This takes into account how much of their "included" minute credit has already
been used in the calendar month.