[sr-dev] mi_rpc and xmlrpc modules - explanation?

Andrei Pelinescu-Onciul andrei at iptel.org
Thu Oct 15 09:50:59 CEST 2009


On Oct 15, 2009 at 02:32, Olle E. Johansson <oej at edvina.net> wrote:
> 
> 15 okt 2009 kl. 02.09 skrev Olle E. Johansson:
> 
> >Hi folks!
> >
> >Klaus and I are trying to organize some documentation efforts here  
> >at Astricon, but we have been sidetracked by all the fun people  
> >around... :-)
> >
> >Anyway, I was spending a few minutes looking at mi_rpc and xmlrpc  
> >and don't really get what's up with these modules. We must lack some  
> >serious documentation here, on why we have two modules. mi_rpc is  
> >poorly documented, too.

No, they are completey different.

> >
> >Anyone that can explain if these are just the same modules or if the  
> >case is that they are totally different and tell me that I'm stupid  
> >and totally forgot to read documentation?
> 
> Continued digging, since this bothers me...
> 
> Seems like we have an RPC interface in the core, use by serctl, using  
> something called "binrpc"
> http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=utils/sercmd/README

No, the RPC is the generic interface (something similar to MI) and
binrpc is one protocol for one "driver" that uses that interface.
binrpc is used by the ctl module (similar in its function to
mi_datagram+mi_fifo, but it supports unix sockets, udp, tcp and fifo in
 the same time) and by sercmd (which is the tool used for invoking the
rpc from the command line, probably similar to kamunix, but besides
supporting udp, tcp and unix sockets, it also have an interactive mode
with command completion, history a.s.o)

There are 2 "drivers" or transports that implement the RPC interface:
the ctl modules (see above) and xmlrpc (to continue the MI analogy,
similar to mi_xmlrpc in its function).

See
http://sip-router.org/docbook/sip-router/branch/master/rpc/ser_rpc.html
http://sip-router.org/docbook/sip-router/branch/master/modules/ctl/ctl.html
http://sip-router.org/docbook/sip-router/branch/master/modules/xmlrpc/xmlrpc.html

> 
> mi_rpc exports Kamailio's MI interface over RPC.

Yes, all the mi commands can now be accessed from the RPC interface
(binrpc/ctl/sercmd or xmlrpc + some xmlrpc client).

> 
> XMLRPC seems to be a an XMLRPC wrapper to the RPC core interface.

Yes.

> 
> Which means that using mi_rpc *and* xmlrpc I can send mi commands over  
> xmlrpc, right?

Yes.

> 
> Now, will we have the ser "raw" RPCs and Kamailio's mi commands side  
> by side? Any official plan for the future?

For this release and the next one yes.

The official plan agreed at the meeting (but seems to be missing in the
minutes) is that we will move to RPC and slowly obsolete MIs.

This means that any new module that implements a rpcs/management
interface _must_ support RPC. It can support MI too, but MI support is
optional.
Existing MIs can be slowly migrated (if we have volunteers, most of them
would be only a few lines of RPC code), but it's something that can wait
(one can access them with mi_rpc).
No existing MIs will be deleted for at least 2 releases.


See http://lists.sip-router.org/pipermail/sr-dev/2009-July/002968.html
for the reasons of moving to RPC.


Andrei



More information about the sr-dev mailing list