Hello,

have you tried with KSR.ndb_redis.redis_cmd_p1() which should be the equivalent of next function with additional parameter:

  * https://www.kamailio.org/docs/modules/stable/modules/ndb_redis.html#ndb_redis.f.redis_cmd

like the one in the example:

redis_cmd("srvN", "GET %s", "foo", "r");

Practically:

 KSR.ndb_redis.redis_cmd("srvN", "SET var %s", testvar, "r");

Cheers,
Daniel

On 19.01.22 04:58, Muhammad Danish Moosa wrote:
Hi Guys,

I am trying to do following code


 KSR.ndb_redis.redis_cmd("srvN", "SET var " .. testvar, "r");

it works fine but if testvar has special character like SPACE or % , it does not work. For example when testvar="asdsada%Dasda"; it starts considering %D as place holder and does not add key to redis (does not raise error as well)

With Space I tried to use delimeters like "" or '' but none of them work.

For now I have got it working through , search and replace but thats not a clean solution.

Any suggestions?

--
Muhammad Danish Moosa

" The core of mans' spirit comes from new experiences. "___ Christopher McCandless

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online
  Feb 21-24, 2022 (America Timezone)
  * https://www.asipto.com/sw/kamailio-advanced-training-online/