[Kamailio-Devel] cfgutils api

Juha Heinanen jh at tutpro.com
Tue Aug 26 17:40:48 CEST 2008


Elena-Ramona Modroiu writes:

 > shv variables are registered when config is parsed or via modparam. Are 
 > you using the $shv(enum_domains) anywhere in config file?

ramona,

yes, i have in config file:

	xlog("L_INFO", "enum_domains: $shv(enum_domains)\n");

but still, if i don't give $shv(enum_domains) as cfgutils module param,
i get

Aug 26 18:23:21 localhost /usr/sbin/kamailio[23144]: ERROR:core:pv_parse_spec: error searching pvar "shv" 
Aug 26 18:23:21 localhost /usr/sbin/kamailio[23144]: ERROR:core:pv_parse_spec: wrong char [e/101] in [$shv(enum_domains)] at [5 (5)] 

so it looks like it $shv(enum_domains) must be given as cfgutils module
param, which calls a complicated init_shvars function to create
the shared variables.

 > If not, the workaround is to set a value via modparam. For the future I 
 > will see what can be done to have such variables even they are not used 
 > in the config file.

what i would like to get implemented is a new avpops function
shv_db_load that works exactly as avp_db_load, but that loads the values
to shared variables.  the function would be first time called from
mod_init and subsequently via a mi command.  so the name, value, and
type of shared variable would come from database.  also, it should be
possible to load many values to a shared variable of the same name as in
case of avps.

-- juha



More information about the Devel mailing list