[sr-dev] Websocket module: Suggestions

Peter Dunkley peter.dunkley at crocodile-rcs.com
Sat Mar 30 21:33:29 CET 2013


Done.  I think.

I don't have a system here to test WebSockets at the moment, but the
changes looked pretty straight-forward and it all compiles OK :-)

Can you take a look and tell me if it is what you were thinking?  If
anyone has any problems with it I'll roll back the changes.

There are two configuration variables, one for keepalive_timeout and one
for enabled.  This means the keepalive_timeout can be changed live and the
WebSocket enabled/disabled state (previously just settable through MI
commands) can be changed using the cfg framework.

The keepalive_interval that you suggested is used during module init to
set how often the extra processes for sending keep-alives runs.  I can't
see how to change this once Kamailio has started.

Regards,

Peter

>
> 30 mar 2013 kl. 18:32 skrev "Olle E. Johansson" <oej at edvina.net>:
>
>>>> 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.
>
> Looking at the _cfg_def structure there is a callback. I was wrong. This
> framework could also
> be used for read-only variables, like "SIP Outbound enabled",
> "Websockets/SIP enabled", "Websockets/TLS/SIP enabled".
>
>
> /O


-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd




More information about the sr-dev mailing list