Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[acc] introducing new extra/leg engine; module redesign
Redesigning accounting module extra values engine raised new problems which in the end were solved by redesigning the whole accounting module. First of all an accounting module context was created which is available for the whole dialog lifetime. Having this mechanism all values that were stored in avps or dialog values are now being held in this context. Using the new dialog callback that is triggered at shutdown, extra and leg values are not abusing anymore of dialog values. We store them there only when OpenSIPS closes by any means. This made the code look a lot cleaner and the program faster by not creating a dialog value for all INVITEs and restoring it for each BYE. Accounting module extra values new engine are the main purpose of this commit. There are only two variables now, called $acc_extra and $acc_leg. They are visible during the whole lifetime of a dialog and provide a much cleaner and easier way to use this powerful engine. New parameters have been defined, extra_fields and leg_fields through which one can define tags and log values. The tags are used to reference $acc_extra and $acc_leg variables, whereas the leg_fields will be the value that you will see in the logs. As concerning the acc_leg variable, new legs can be created using acc_new_leg() function. The value of the current leg can be retrieved using $acc_current_leg. It's the script writer the one who has to decide when is the moment to jump to a new leg. Also from this commit diameter support from acc module has been removed. Diameter didn't have any support and it wasn't compatible with a diameter server.
- Loading branch information