OpenSIPS / opensips-cli

OpenSIPS CLI tool - an interactive command line tool that can be used to control and monitor OpenSIPS servers.
GNU General Public License v3.0
86 stars 48 forks source link

Add a subtle OpenSIPS version detection mechanism #75

Open liviuchircu opened 3 years ago

liviuchircu commented 3 years ago

Opening up this issue just for accounting purposes, so we start monitoring the core problem. In short: the CLI was originally written for OpenSIPS 3.0, and already there seem to be a few MI incompatibilities between 3.0 and 3.1. Along with the B2B module changes in 3.2, the incompatibility list grows, so this seems like a good time to start documenting all problems, so we can solve them as part of one solution.

MI Incompatibilities

3.0 -> 3.1: the "event_jsonrpc" module has been renamed to "event_stream". This affects the diagnose command, which is currently detecting the version by itself, so it can recommend users to load the correct module for their OpenSIPS version 3.1 -> 3.2: the b2b_trigger_scenario MI command of the "b2b_logic" module has been reworked, both with different parameters and extra flavors (combinations) of them TODO: other ones?

Implementation Ideas

3.0 -> 3.1+: this transition may be inferred by simply checking for the presence of the raise_event command in the typical mi which command which is already internally performed by opensips-cli on startup. raise_event was added in OpenSIPS 3.1.

liviuchircu commented 3 years ago

As of today, the user module is distinguishing whether the OpenSIPS version is "3.2 or newer" by looking at the subscriber table version. With this information, it is able to insert the appropriate data in the table.