[Kamailio-Devel] [Kamailio-Users] SIREMIS v0.9.1 Released

Stefan Sayer stefan.sayer at iptego.com
Thu Feb 12 12:37:12 CET 2009


Hi,
(taken users' list out of the loop)

o Elena-Ramona Modroiu [02/12/09 10:32]:
>> SEMS uses xmlrpc++, with the addition of multi threaded server (and 
>> client with failover fallback).
> are this extensions by you?
yes, based on a patch floating aroung the xmlrpc++ forum.

>>  There is also a UDP server, but it is little used, also due to that 
>> encoding/decoding of data structures is much more straight forward 
>> with xmlrpc. Things on my list to try out are also json-rpc (for 
>> easier integration with web apps) to DI, and protocol 
>> buffers+libevent, for more performance.
> siremis uses json to create charts, so it may become seamless integration.
so you would say that I should first write json-rpc interface? or do you 
think xmlrpc is suitable/easy enough?

>> Similarly, monitoring data that the SEMS application can add to the 
>> call info is variable - applications can add string/int attributes, or 
>> arbitrary data structures, referenced by an attribute name. If 
>> accessed via XMLRPC, they should be available just as the application 
>> added it; int as int, strings as strings, arrays as arrays (struct 
>> support for xmlrpc coming soon). If we can come up with a generic way 
>> to represent that on the web page, it can be used for many diverse 
>> monitoring purposes.
>>   
> 
> Interesting approach, not sure if I understood correctly, but you are 
> saying that if I know the name of a variable/function, I can get the 
> value/execute it via DI?
if you know the name of a DI function, you can execute it via XMLRPC. So 
you can call for example the 'get' function, a function exported by the 
'monitoring' module. You can also execute the log function, which is 
used by the applications to add monitoring info, from xmlrpc - see an 
example below.

But thats a good idea - a function to only get one variable for a list 
of sessions. I will implement that soon.

Stefan

sorry it is python...but you get the idea.

 >>> from xmlrpclib import *
 >>> s = ServerProxy("http://localhost:8090")
 >>> s.list()
['3c2f51fcc15f-axiemknkiy98']
 >>> s.listFinished()
''
 >>> s.listUnfinished()
['3c2f51fcc15f-axiemknkiy98']
 >>> s.get('3c2f51fcc15f-axiemknkiy98')
[{'from': '"2 at stefan-lap.office.iptego.de" 
<sip:2 at stefan-lap.office.iptego.de>', 'app': 'conference', 'to': 
'<sip:35 at stefan-lap.office.iptego.de;user=phone>', 'conf_id': '35', 
'ruri': 'sip:35 at stefan-lap.office.iptego.de;user=phone', 'dir': 'in'}]
 >>> # now i hang up the phone
 >>> s.listFinished()
['3c2f51fcc15f-axiemknkiy98']
 >>> s.listUnfinished()
''
 >>> s.get('3c2f51fcc15f-axiemknkiy98')
[{'from': '"2 at stefan-lap.office.iptego.de" 
<sip:2 at stefan-lap.office.iptego.de>', 'app': 'conference', 'to': 
'<sip:35 at stefan-lap.office.iptego.de;user=phone>', 'conf_id': '35', 
'ruri': 'sip:35 at stefan-lap.office.iptego.de;user=phone', 'dir': 'in'}]
 >>> # now i add some logging info - usually this only happens from 
inside SEMS, but I can do that from outside as well
...
 >>> s.log('3c2f51fcc15f-axiemknkiy98', 'some_key', 'some_value')
[0, 'OK']
 >>> s.get('3c2f51fcc15f-axiemknkiy98')
[{'from': '"2 at stefan-lap.office.iptego.de" 
<sip:2 at stefan-lap.office.iptego.de>', 'app': 'conference', 'some_key': 
'some_value', 'to': '<sip:35 at stefan-lap.office.iptego.de;user=phone>', 
'conf_id': '35', 'ruri': 
'sip:35 at stefan-lap.office.iptego.de;user=phone', 'dir': 'in'}]
 >>> s.logAdd('3c2f51fcc15f-axiemknkiy98', 'some_key', 'some other value')
[0, 'OK']
 >>> s.get('3c2f51fcc15f-axiemknkiy98')
[{'from': '"2 at stefan-lap.office.iptego.de" 
<sip:2 at stefan-lap.office.iptego.de>', 'app': 'conference', 'some_key': 
['some_value', 'some other value'], 'to': 
'<sip:35 at stefan-lap.office.iptego.de;user=phone>', 'conf_id': '35', 
'ruri': 'sip:35 at stefan-lap.office.iptego.de;user=phone', 'dir': 'in'}]
 >>> s.log('3c2f51fcc15f-axiemknkiy98', 'fancy list', ['a','b','c'])
[0, 'OK']
 >>> s.get('3c2f51fcc15f-axiemknkiy98')
[{'fancy list': ['a', 'b', 'c'], 'from': 
'"2 at stefan-lap.office.iptego.de" <sip:2 at stefan-lap.office.iptego.de>', 
'app': 'conference', 'some_key': ['some_value', 'some other value'], 
'to': '<sip:35 at stefan-lap.office.iptego.de;user=phone>', 'conf_id': 
'35', 'ruri': 'sip:35 at stefan-lap.office.iptego.de;user=phone', 'dir': 'in'}]
 >>> s.log('3c2f51fcc15f-axiemknkiy98', 'multi type list', ['a','b','c', 
1, 2, 3])
[0, 'OK']
 >>> s.get('3c2f51fcc15f-axiemknkiy98')
[{'fancy list': ['a', 'b', 'c'], 'from': 
'"2 at stefan-lap.office.iptego.de" <sip:2 at stefan-lap.office.iptego.de>', 
'app': 'conference', 'some_key': ['some_value', 'some other value'], 
'to': '<sip:35 at stefan-lap.office.iptego.de;user=phone>', 'conf_id': 
'35', 'multi type list': ['a', 'b', 'c', 1, 2, 3], , 'ruri': 
'sip:35 at stefan-lap.office.iptego.de;user=phone', 'dir': 'in'}]

> 
> Regards,
> Ramona

-- 
Stefan Sayer
VoIP Services

stefan.sayer at iptego.com
www.iptego.com

IPTEGO GmbH
Wittenbergplatz 1
10789 Berlin
Germany

Amtsgericht Charlottenburg, HRB 101010
Geschaeftsfuehrer: Alexander Hoffmann



More information about the Devel mailing list