[SR-Users] lua_dostring sr vs KSR
Daniel-Constantin Mierla
miconda at gmail.com
Fri Jul 31 22:27:41 CEST 2020
Do you keep float numbers as strings in avps?
Cheers,
Daniel
On 30.07.20 21:43, Julien Chavanton wrote:
> Yes, this was an example I have for float comparison ...
>
> good, we will use KSR latest greatest !
>
> On Thu, Jul 30, 2020 at 11:37 AM Daniel-Constantin Mierla
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
> Thanks for spotting it, I pushed a commit adding a note about
> availability of sr Lua module by loading app_lua_sr Kamailio
> module as well as updated the Lua script examples to use KSR
> instead of sr.
>
> But, on the other hand, the example in the docs for lua_dostring()
> does not have the line you pasted:
>
> lua_dostring("KSR.pv.seti(\"$$var(var1)\", $avp(var1) < $avp(var3)
> and 1 or 0)");
>
> just assuming is was on your local testing.
>
> Cheers,
> Daniel
>
> On 30.07.20 18:50, Julien Chavanton wrote:
>>
>> lua_dostring("sr.pv.seti(\"$$var(var1)\", $avp(var1) < $avp(var3)
>> and 1 or 0)");
>>
>> results in error :
>> kamailio app lual_dostring(): error from Lua: attempt to index
>> global 'sr' (a nil value)
>>
>> replacing sr with KSR is working :
>>
>> lua_dostring("KSR.pv.seti(\"$$var(var1)\", $avp(var1) <
>> $avp(var3) and 1 or 0)");
>>
>> Shall we update the docs for
>> https://kamailio.org/docs/modules/devel/modules/app_lua.html#app_lua.f.lua_dostring
>> ?
>>
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org <mailto:sr-users at lists.kamailio.org>
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
> www.twitter.com/miconda <http://www.twitter.com/miconda> -- www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
> Funding: https://www.paypal.me/dcmierla
>
--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200731/c92752b3/attachment.htm>
More information about the sr-users
mailing list