[sr-dev] Kamailio jwt module or Lua script

Henning Westerholt hw at skalatan.de
Mon Oct 14 17:38:24 CEST 2019


Hello Joey,

The lua script will block (like native Kamailio cfg) the specific child if you do time consuming operations.

But you can use the asynchronous support also for app_lua (and other languages). You can also implement e.g. a queue and a dedicated worker process, like in this (older) presentation:

https://www.kamailio.org/events/2014-KamailioWorld/day2/26-Daniel-Constantin.Mierla-Kamailio.cfg-Async.pdf

The blocking of the dedicated worker should not affect your main network processes.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services

From: sr-dev <sr-dev-bounces at lists.kamailio.org> On Behalf Of Joey Golan
Sent: Sunday, October 13, 2019 8:34 AM
To: miconda at gmail.com; Kamailio (SER) - Development Mailing List <sr-dev at lists.kamailio.org>
Subject: Re: [sr-dev] Kamailio jwt module or Lua script

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<mailto: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/20191014/b2fba97b/attachment-0001.html>


More information about the sr-dev mailing list