<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
from a thread in sip-router user mailing list:
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/pipermail/sr-users/2012-March/072657.html">http://lists.sip-router.org/pipermail/sr-users/2012-March/072657.html</a><br>
<br>
This thread talks about reloading lua scripts in runtime context.<br>
<br>
<pre>>><i> I'm starting to play with lua scripting in Kamailio. It's really cool,
</i>>><i> some complex stuff in the script becomes really easy this way. The
</i>>><i> script is becoming quite big, therefore I'd like to use lua_run
</i>>><i> instead of lua_dofile. My doubt is pretty basic: if i load a script
</i>>><i> in memory at startup via the "load" parameter and the script is
</i>>><i> modifed afterwards, is there any way to reload the module so the
</i>>><i> script is reread?
</i>>the two contexts created by app_lua were designed one for loading at
>startup and the other for reloading every time. Reloading on demand at
>runtime is not possible. I thought of checking the timestamp of the
>script, but can be a bit risky if saving on intermediary state during
>updates. The scripts are loaded in each process, sending a mi/rpc
>command will require to do some inter-process signaling. Both doable,
>not in my short term plans, though, if someone is contributing, will be
>appreciated.</pre>
<br>
I have attached a test patch to start playing with this task.<br>
<br>
A new function app_lua.runfile is created, and called via sercmd
tool to load some lua script in runtime context.<br>
<br>
Some signaling is needed so every kamailio child process would
reload the script too.<br>
<br>
Could you give some clues about performing this interprocess
signaling suitably for kamailio?<br>
<br>
Best regards,<br>
Vicente.<br>
<br>
<br>
</body>
</html>