ref: 240b3444466fb458b517d84c83bd6a782a21934e jmp-schemas/deploy/insert_charge_for_cdr.sql -rw-r--r-- 1015 bytes
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
Insert charge for CDR

Trigger to insert a transaction charging the customer for the amount owed for