[sr-dev] Kamailio jwt module or Lua script

Joey Golan joeygo at gmail.com
Sun Oct 13 08:34:18 CEST 2019


My question is, while making the call to the app_lua does the context of the sip call hangs and wait for the Lua script to end or It can handle other calls in that time and the route script will get invoked and resume from that point?
I hope it is more clear now.


________________________________
From: Daniel-Constantin Mierla <miconda at gmail.com>
Sent: Monday, October 7, 2019 4:02 PM
To: Joey Golan; Kamailio (SER) - Development Mailing List
Subject: Re: [sr-dev] Kamailio jwt module or Lua script



On 07.10.19 14:36, Joey Golan wrote:
I’ve implemented the token verification in Lua script and I’m using app_lua module to call the script from the configuration script inside the [AUTH] block.
It works fine but I want to be sure that I will not face performance degradation.
I’ve used the benchmark module to the log the execution duration. The results shows 130~ microseconds avg.
Do you think it will have impact on performance?
If you get the numbers you want (calls per second or registrations per second), then it is fine.
Regarding app_lua, is it running on the same call context or a different one?


What do you mean here? Like "sip/voip call context", or "function call context"?

Cheers,
Daniel

Thanks

________________________________
From: Daniel-Constantin Mierla <miconda at gmail.com><mailto:miconda at gmail.com>
Sent: Monday, October 7, 2019 12:29 PM
To: Kamailio (SER) - Development Mailing List; Joey Golan
Subject: Re: [sr-dev] Kamailio jwt module or Lua script


Hello,

On 05.10.19 16:07, Joey Golan wrote:
Hi all,

I would like to authenticate subscribers using JWT tokens and I wonder which approach is better:
1. Writhing a dedicated kamailio module.
2. Writing a Lua script.

What would work better performance wise?

In terms of executing the same Kamailio C function exported to kamailio.cfg routing blocks or to Lua API/kemi, there is not any significant difference.

However, if you execute Lua code written by third party, it is not easy to say if it matches the same performances as an equivalent C function that you write.

You can go with the option you consider faster for development and then see if you are pleased with the results.

Cheers,
Daniel

-- 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>Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat

--
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>
Kamailio Advanced Training, Oct 21-23, 2019, Berlin, Germany -- https://asipto.com/u/kat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20191013/dc25d203/attachment-0001.html>


More information about the sr-dev mailing list