Hello,
On 04/05/15 18:44, Nathan Angelacos wrote:
Hi,
On 05/04/2015 10:16 AM, Daniel-Constantin Mierla wrote:
One of my reasons of pushing this out was in the perspective of deprecating MI and working with JSONRPC fifo from command line -- I
I think I missed something here. Are you are planning of deprecating the entire MI (and all MI_* modules) in favor of a cli with JSONRPC? Or is this more to replace kamctl?
there are two control protocols at this moment: mi (which came via kamailio/openser) and rpc (which came via ser).
The rpc has more transports (fifo, unixsock, udp, tcp, xmlrpc and (recently added) jsonrpc) and it is mapping easier on the concept of RPC with structured output, with defined standards. MI was a custom protocol (line oriented), actually coming from the very first versions of ser. The output is nothing close to a standard, more or less specific for each command, not easy to parse and validate from external applications.
Not to duplicate the effort, the decision was to continue with rpc. However, deprecating mi is not going to happen that quickly -- the decision was made when merging kamailio and ser, so, couple of years ago. New control commands were added mainly on rpc control interface.
The idea for now is to get a tool that is using rpc. Kamcmd is using rpc, but via some binary encoding. Kamcli is using jsonrpc as encoding of the command, being easier to deal with from shell or external tools. Also, this should help people by having an example of implementation.
Kamctl can live further as well, maybe even wrapping kamcli in the future (now has the option to wrap kamcmd), but shell alone doesn't seem enough for building an advanced cli tool.
Cheers, Daniel