Hi Yurig,

 

Yes, GET/SET is working normally from kamailio if not using JSON.

 

Honestly, I didn’t get what do you mean by the below. Can you please elaborate how to fix the issue?

 

Regards,

 

From: Yuriy G <ovoshlook@gmail.com>
Sent: Thursday, November 9, 2023 10:55 AM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Cc: Ali Taher <ataher@vanrise.com>
Subject: Re: [SR-Users] Re: Redis issue when getting results in Kamailio

 

Did you try to use not JSON but usual GET/SET? Do you have the same issue?

AFAIK - ndb_redis is a wrapper oven hiredis wrapper and doesn't implement serialisation protocol for redis, so, whatever you send delivered to redis being only wrapped via hirer's client library.

 

Btw if uou use lua < 5.2 you may try redis-lua library. It is easier to use with lua.

 

On Thu, 9 Nov 2023, 09:34 Ali Taher via sr-users, <sr-users@lists.kamailio.org> wrote:

I’m still stuck… I appreciate any assistance here.

 

From: Ali Taher via sr-users <sr-users@lists.kamailio.org>
Sent: Tuesday, November 7, 2023 12:47 PM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Cc: Ali Taher <ataher@vanrise.com>
Subject: [SR-Users] Redis issue when getting results in Kamailio

 

Hello all,

 

I have redis database where the data is inserted in JSON format:

 

#Redis Command

 

JSON.GET Index1J:12345678

 

#Redis Result

[

  {

    "SupplierID": "7",

    "BCode": "987654",

    "Rate": 0.159

  },

  {

    "SupplierID": "7",

    "BCode": "765432",

    "Rate": 0.159

  },

  {

    "SupplierID": "7",

    "BCode": "5432159",

    "Rate": 0.159

  }

]

 

When I try to get the result using Lua script in Kamailio like the following:

#kamailio command

  if KSR.ndb_redis.redis_cmd("srvN", "JSON.GET pricelistJ:441246890", "ra") then

            KSR.xlog.xinfo("array size: $redis(ra=>size)\n");

            KSR.xlog.xinfo("Redis Response: " .. tostring(ra) .. "\n")

            KSR.xlog.xinfo("first values: $redis(ra=>value[0]) , $redis(ra=>value[1])\n");

        end

                               

Nov 7 07:58:15 868d08ee318d /usr/sbin/kamailio[72]: INFO: LUA {INVITE}: <script>: array size: <null>

Nov  7 07:58:15 868d08ee318d /usr/sbin/kamailio[72]: INFO: LUA {INVITE}: <script>: Redis Response: nil

Nov  7 07:58:15 868d08ee318d /usr/sbin/kamailio[72]: INFO: LUA {INVITE}: <script>: first values: <null> , <null>

 

I’m getting null results.

 

I don’t know what I’m doing wrong here. Can you please assist?

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: