[OpenSIPS-Devel] Accounting enhancement proposal

Dan Pascu dan at ag-projects.com
Thu Apr 11 10:02:42 EDT 2019


On 10 Apr 2019, at 15:57, Ben Newlin wrote:

> We have employed 2 methods to decrease the pain of setting all of these variables:
> * For as many values as possible, we removed the script variable and use only the acc_extra variable. It is a r/w variable after all. This means that for these variables we do not have to worry about copying the value from an avp or dlg_val into acc_extra as it is just always there.
> * We use wrapper functions extensively. In fact, we have had to patch OpenSIPS to increase the number of allowed routes. For Dan's example with t_relay, our approach would be to wrap the t_relay call in another route, which always sets the acc_extra before calling t_relay.

Both of these are just workarounds that should not be needed. Holding values in $acc_extra only doesn't improve readability and t_relay is not the only call that can result in accounting being generated. If you only use t_relay, then wrapping it might work for you, but it doesn't scale well and makes reasoning about the code harder. The core idea of my proposal is to get notified when accounting is generated and given the opportunity to fill in the values for the extra accounting.

--
Dan







More information about the Devel mailing list