[sr-dev] Question about config framework (ser)

marius zbihlei marius.zbihlei at 1and1.ro
Tue Feb 16 11:47:20 CET 2010


Hello

In cfg/cfg_ctx.c : 888 there is the definition of the function 
cfg_get_by_name which gets called in case of a "sercmd cfg.get" command

...
if (var->def->on_change_cb) {
        /* The variable cannot be retrieved, because the fixup
        function may have changed it, and it is better to return
        an error than an incorrect value */
        return 1;
    }
...

The "problem" is that if  a use a fixup callback(or a on_change 
callback) , this function returns an error and the value cannot be read 
anymore via sercmd.
What is the best way to proceed in this case? I am currently working on 
the modules_k/registrar module and if STATISTICS are used (default in 
kamailio build), I need to register some callbacks to be called when 
sercmd cfg.set_now_int (set_delayed_int) are called so I update 
kamailio's statistics framework with the new values passed from ser cfg 
framework. (for example min_expires, max_expires and others)

Is there a way for the cfg framework to specify that the callback 
doesn't change the value (like in the case above)?

Any ideas welcome.

Cheers
Marius



More information about the sr-dev mailing list