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
85 stars 48 forks source link

Diagnose depends on json_rpc no present on 3.1 #74

Closed flaviogoncalves closed 3 years ago

flaviogoncalves commented 3 years ago

On OpenSIPS 3.1 the module is event_stream.so

/usr/lib/python3/dist-packages/opensipscli/communication# opensips-cli -x diagnose sql ERROR: Failed to subscribe for JSON-RPC events ERROR: Is the event_jsonrpc.so OpenSIPS module loaded?

liviuchircu commented 3 years ago

Hey, @flaviogoncalves! It's an interesting problem, as we must bake some logic into the CLI so it figures out what kind of OpenSIPS it's working with ("- Is it a 3.0 or a 3.1?"). Let me prototype a fix and come back to you with more info.

liviuchircu commented 3 years ago

@flaviogoncalves, how did you install your opensips-cli? Packages or source? How old is it?

I suspect you're not running the latest version, because this exact issue was fixed by Alexey Vasilyev in commit f4072ed5, adding both version detection (3.0 vs 3.1+) and the proper "module to be loaded" suggestion: "event_jsonrpc" vs. "event_stream".

flaviogoncalves commented 3 years ago

I did both

flaviogoncalves commented 3 years ago

Unless is something really recent

liviuchircu commented 3 years ago

The commit is from Sep 1st, so somewhat recent. Try to place yourself in the opensips-cli project source code, then do:

sudo python3 setup.py install clean

The code basically does an mi version command early, then parses the version and decides which module to print. Unless there is something I'm terribly missing, it should show "event_stream.so" if you're pointing it to a 3.1 OpenSIPS instance.

flaviogoncalves commented 3 years ago

I tried with the nightly build and worked fine. I will close the ticket. Solved.