[OpenSIPS-Users] using pseudo-variables while assigning keys to memcache

Bogdan-Andrei Iancu bogdan at voice-system.ro
Thu Jul 29 16:21:50 CEST 2010


Hi Jayesh,

because when seeing "$fU_passwd", opensips cannot make difference 
(syntax-based only) between variable named "fU_passwd " or var "fU" + 
string "passwd".

So you need to clarify a bit the syntax to delimit the exact name of the 
variable:

    cache_store("local", "$(fU)_passwd", "$avp(passwd)", 1800) ;

Regards,
Bogdan



Jayesh Nambiar wrote:
> Hello All,
> I have been experimenting with the localcache and memcache module for 
> a while and came across a strange problem while defining keys for 
> cache using the pseudo-variables.
> For eg: If i wish to use a key name which starts with a 
> pseudo-variable or if I wish to use two pseudo-variables in a key, it 
> is not possible. Like if I try to use function like:
> cache_store("local", "$fU_passwd", "$avp(passwd)", 1800), this does 
> not work since opensips does not start because of syntax error invalid 
> pseudo-variable "$fU_".
> Also if I wish to use something like cache_store("local", 
> "status_$fU_$si", "$avp(status)", 1800), even this does not work with 
> same syntax error.
> Whereas if I use cache_store("local", "status_$fU$si", "$avp(status)", 
> 1800), this will work.
>
> I think there should be some character to be introduced which 
> indicates the end of pseudo-variable so that the script writer has the 
> flexibility to define the variables according to his/her requirement. 
> Also this might be affecting other areas where pseudo-variables are 
> allowed in the functions etc.
>
> Just thought to get this into the notice.
>
> --- Jayesh
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
20 - 24 September 2010, Frankfurt, Germany
www.voice-system.ro




More information about the Users mailing list