[prev in list] [next in list] [prev in thread] [next in thread] 

List:       semsdev
Subject:    [Semsdev] new XMLRPC2DI example module
From:       Stefan Sayer <stefan.sayer () iptego ! de>
Date:       2007-05-28 23:34:28
Message-ID: 465B6704.7040608 () iptego ! de
[Download RAW message or body]

Hello,

for those not reading the commit logs xmlrpc2di.Readme from the just 
commited new xmlrpc2di module. Together with the authenticated dial-out 
from di_dial this makes for example click-to-xyz very simple to implement.

Stefan

xmlrpc2di: DI call via XMLRPC

This module makes the Dynamic Invocation (DI) Interfaces exported
by component modules accessible from XMLRPC. Additionaly the methods
calls, get_loglevel and set_loglevel are implemented (like in the
stats UDP server).

This module uses the XmlRpc++ library (http://xmlrpcpp.sourceforge.net/).
In order to compile it, the xmlrpc library is needed:
cd apps/examples/xmlrpc2di
wget 
http://switch.dl.sourceforge.net/sourceforge/xmlrpcpp/xmlrpc++0.7.tar.gz 
&& tar xzvf xmlrpc++0.7.tar.gz
If xmlrpcpp is extracted to a different directory, the path in
the Makefile needs to be adapted.

The first parameter to 'di' is alway the factory name, the second the
function name. Further parameters to XMLRPC calls are converted to DI
ArgArray structure, and result of DI calls are converted back to XMLRPC
parameters. At the moment only string, int and double types are implemented
(no DateTime, struct, binary, ...).


Examples (that hopefully trigger some creativity in the reader ;)
-----------------------------------------------------------------

Register fritz at iptel.org using registrar client over XMLRPC
from python:

import xmlrpclib
server = ServerProxy("http://127.0.0.1:8090")
server.di('registrar_client', 'createRegistration',
     'iptel.org',  'fritz', 'Frotz',
     'fritz', 'secretpass', '')

To call someone into conference over an account at sparvoip.de
using di_dial:

import xmlrpclib
server = ServerProxy("http://127.0.0.1:8090")
server.di('di_dial', 'dial_auth','conference', 'roomname',
  'sip:myuser@sparvoip.de', 'sip:0049301234567@sparvoip.de',
  'sparvoip.de','myuser','passwd')

-- 
Stefan Sayer
Media Services Development

stefan.sayer@iptego.de
www.iptego.de

iptego GmbH
Am Borsigturm 40
13507 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann
_______________________________________________
Semsdev mailing list
Semsdev@lists.iptel.org
http://lists.iptel.org/mailman/listinfo/semsdev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic