implement hash table for tracking RTPEngine node allocations #3563
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This change allows RTP instances to be disabled safely without causing recalculation of allocations for existing dialogs, improving maintainability. The main driver is that I want to be able to disable instances to drain calls and perform maintenance on a 24 hour system (i.e. patching)
Details
The code was ported from Kamailio (kamailio/kamailio#390) which offers this implementation, and then modifications were required to work correctly with the latest OpenSIPs codebase.
Note that this is a work in process I am submitting for initial review as I need to deliver this for my network, I'm not sure if you accept "Kamilio inspired" code but would appreciate a review and I can see this being useful to others. Documentation will be added as I continue work..
Solution
By implementing a hash table the module will now track all connected calls in a hash table of configurable size. This will be reviewed for all subsequent RTPEngine interactions and when found the existing allocation is preserved.
Compatibility
This should work as normal and the hash table has been made optional.
Closing issues
closes #3036