Hi all,
We've been running CGRateS with OpenSIPS for prepaid billing and encountered a few interesting behaviors we wanted to share and get community input on.
Setup:- Accounts have two balances: Daily_Toll_Free_Topup (*voice, 20 min/day, Weight: 20) and Unified_Monetary_Balance (*monetary, Weight: 10, 0 value by default)
- AllowNegative: false on all accounts
- debit_interval: 0s
- 1-second call overage + default balance creation
With debit_interval: 0s, CGRateS authorizes the full MaxUsage (20 min) at call start. OpenSIPS cgrates module sets the dialog timeout accordingly. However if call runs for 20 minutes and 1 second, causing CGRateS to round up to 21 minutes, creating and charging $0.01 to a *default balance - even with AllowNegative: false. The *default balance is automatically created and goes negative.
Our question: is this expected behavior? We would expect AllowNegative: false to prevent any balance from going negative. Is the *default balance treated differently?
We believe this is due to SIP signaling delay between OpenSIPS sending BYE and the actual call termination. Has anyone found a clean way to handle this — either by subtracting a few seconds from MaxUsage, or via CGRateS configuration?
2. Blocker flag behavior
We set Blocker: true on Unified_Monetary_Balance thinking it would prevent the fallthrough to RP_ALL_DESTINATIONS. However we've since learned that Blocker simply stops CGRateS from evaluating any further balances after that balance — it does NOT prevent *default creation or the rating plan fallthrough per se. Can anyone confirm the exact mechanics of how Blocker interacts with rating plan fallthrough?
Any insights appreciated.
Thanks