On 5/24/11 8:45 PM, Bret McDanel wrote:
On Tue, 2011-05-24 at 12:38 +0200, Daniel-Constantin Mierla wrote:
exit is not a function exported by a module, it is implemented in core.
On the other hand, you try to stop the kamailio cfg interpreter when lua interpreter is executing the Lua script, so it won't work straightforward. Set a variable in kamailio from Lua, then check it after executing the lua script to decide to further exit or not.
How does one set a variable and subsequently access it outside of lua? I tried what I thought was correct, but absent any documentation I can find I cant seem to get that to work.
For example, setting $var(exit) to 1 from Lua:
sr.pv.seti("$var(exit)", 1)
The function is listed in the Lua API:
http://sip-router.org/wiki/api/lua/devel#srpvseti
Then you can check in Kamailio config:
if($var(exit)==1) exit;
Cheers, Daniel