[sr-dev] Websocket module: Suggestions

Olle E. Johansson oej at edvina.net
Sat Mar 30 18:32:57 CET 2013


30 mar 2013 kl. 13:29 skrev "Peter Dunkley" <peter.dunkley at crocodile-rcs.com>:

> Hello Olle,
> 
>> In addition, I would like to be able to discover sub-protocols used (msrp,
>> sip). I fail to see how I can do that now.
>> Do we have a Core API for publishing read-only data from modules? I guess
>> we maybe could use PVs or XAVPs for that.
>> An ugly way would be to implement RPC in SNMPstats and issue RPC commands
>> internally to fetch data, but that
>> means a lot of serializing that really is not needed as SNMPstats
>> generally fetches one parameter (OID) at a time, not complete
>> sets.
>> 
> 
> I've added a whole slew of new counters so you can see what is going on at
> the sub-protocol level.  Feel free to add them to SNMP if they will help.
Cool. I will add them.

> 
> Note that the frames received and transmitted counters for SIP and MSRP
> only count frames containing SIP and MSRP messages.  So the existing total
> frames received and transmitted counters will contain larger numbers as
> they include control frames too.
I'll implement them as counters that can roll around.
> 
> I have also added the sub-protocol used to the dump MI command, but not
> sure that is really useful.  The WebSocket MI commands were only really
> added to help with testing.  For example, the dump command won't help much
> on a system with thousands of active connections - simply too much data.
Right. 

> 
> The WebSocket module doesn't actually contain any RPC commands at all. 
> Not sure what use they would be for this module anyway.
> 
>> Also, some of the modparam parameters could be exposed as cfg params -
>> which would make it easier to change them at runtime with
>> sercmd, but also expose them in SNMPstats. I think keepalive_interval and
>> keepalive_timeout are candidates for this.
>> 
> 
> If you can point me at a clear example of where this done elsewhere I'll
> be happy to add it.
Look at dispatcher - config.c and dispacher.c. 
http://sip-router.org/docbook/sip-router/branch/master/cfg_list/cfg_var_list.html#dispatcher.ping_reply_codes

That page also gives more examples. I don't see a callback when variables in the config fw changes,
so you need to get them with cfg_get before using if I understand it right.

I will experiment and see if I can expose this in the snmp module. I don't see any Dispatcher-related
variables in the MIBs, so that needs to be added. Time for me to learn about tables in NET-SNMP 
and MIBs.

/O

> 
> 
> Regards,
> 
> Peter
> 
> -- 
> Peter Dunkley
> Technical Director
> Crocodile RCS Ltd




More information about the sr-dev mailing list