[Kamailio-Devel] cfgutils api

Elena-Ramona Modroiu ramona at rosdev.ro
Wed Aug 27 18:27:54 CEST 2008


Hi,

Juha Heinanen wrote:
> 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)] 
>   
the fixup functions are executed after modules' initialization. So shv 
registration happens in this case after mod init. I will think about...

> 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.
>   
Will be pretty complex to be able to have arrays under same shv name, 
mainly because of concurrent access. The idea of global avps was 
discussed in the past, iirc.

Regards,
Ramona

> -- juha
>
>   




More information about the Devel mailing list