Commit
ba812f7e86e8bb1cb9cabad1546eacd5d3809cc0
by Pau Espin Pedrol
mgw: Introduce struct mgcp_codecset struct
We do tons of operations on 3 fields (array of codecs, len of array, selected code) which can be isolated. Right now, we are using APIs which somehow require structs 2-3 levels of encapsulation above the ones really required, which makes all code totally entangled, difficult to understand and prone to errors when changing stuff in deeply nested structs. A prove of this is how this patch affects a lot of lines in lots of places.
Commit
71f313749e4cf7ed4300ea6f72d9491d0431b818
by Pau Espin Pedrol
mgw: Move force_ptime logic outside of main CRCX func handler
Apply the forced value automatically during init, and then only override it based on received input from MGCP when it has not been forced by VTY config.
Commit
3ea3a69821c6701984f22b8e97fd1fafb1e47792
by Pau Espin Pedrol
mgw: Simplify and redo code around ssrc patch feature
The previous logic to configure SSRC patching was over complex and confusing, with even some broken logic like "patch only once", which is not really needed. Hence, simplify the internal logic to either patch SSRC always or don't do it, based on VTY configuration.
The "force SSRC" feature was added in db2d431697609d473de433b7028f81ce499a02c0 and further changed in e2292f3aa1e9ae1faf5521a9cb108775f1ac0540, due to the need for nanoBTS to always keep the same SSRC on received packets. However, it makes no sense that is actually needed only once: if remote end changed several times, then we should keep patching in that case.
This change allows getting rid of confusing applying of settings at a later time through mgcp_rtp_end_config(), which is no longer needed and can be dropped, simplifying steps during CRCX/MDCX/DLCX.