[OpenSIPS-Users] Localcache issue

Yaniv Vaknin yaniv at shahar-tech.com
Sun Sep 12 13:12:28 CEST 2010


Hi,
I'm using localcache module to store some variables, the module works great
but i noticed an issue when performing value check on the AVP's.
I'm trying to check if the value of the AVP is bigger then a value:

if(!cache_fetch("local","a_$fd",$avp(s:a))){
avp_db_query("select `a` from table where domain='$fd'","$avp(s:a)");
cache_store("local","a_$fd","$avp(s:a)",3600)

}else{
cache_fetch("local","a_$fd",$avp(s:a))
avp_db_query("select count(*)  FROM `location` WHERE `domain`= '$fd'
","$avp(s:cur-reg);");
if(avp_check("$avp(s:cur-reg)","ge/$avp(s:a)")){

On the first time that I run the check, everything works fine, but on the
second time, when the server uses the cache_fetch value the avp_check fails
(give the wrong result)
I tried setting the avp to int and also played with the avp_check command
(add /g or /i to the command), I even tried :
 if($avp(s:cur-reg) > $avp(s:a))
But the result is always the same, I guess that I'm doing something the
wrong way, but I can't figure what...
the version I'm using is 1.6.2...

Thanks,
Yaniv Vaknin
-- 
View this message in context: http://opensips-open-sip-server.1449251.n2.nabble.com/Localcache-issue-tp5523216p5523216.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list