[OpenSIPS-Users] redis HMGET nil value problem

Jayesh Nambiar jayesh1017 at gmail.com
Thu May 28 15:21:02 CEST 2015


Hi,
I'm using cache_raw queries to get data from redis and I have a problem
with accessing nil values that gets returned from it.
For eg I do the following:
cache_raw_query("redis:myRedis HMGET one two three", "$avp(result)");

Here the value of one is abc, two is not present in redis and three is xyz.
Now if I access the values, I ideally expect it to be the following:
$(avp(result)[0]) = xyz, $(avp(result)[1]) = <null> and $(avp(result)[2]) =
abc.
But since key two is not present in redis for whatever reasons, the result
I get back is:
$(avp(result)[0]) = xyz
$(avp(result)[1]) = abc
$(avp(result)[2]) = <null>

This actually makes my value matching go for a toss. Is there a better
solution to access the array that is returned back from redis or at least
store the value as NULL in that array element of avp. Any help is greatly
appreciated.

Thanks,

- Jayesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150528/a750261e/attachment.htm>


More information about the Users mailing list