[SR-Users] Handling special characters - KEMI lua redis_ndb

Daniel-Constantin Mierla miconda at gmail.com
Thu Jan 20 13:15:06 CET 2022


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 at 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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220120/92f20c17/attachment.htm>


More information about the sr-users mailing list