Module: kamailio
Branch: master
Commit: f1f6c303baab87523d54b97af38c0a5718cf0d2f
URL:
https://github.com/kamailio/kamailio/commit/f1f6c303baab87523d54b97af38c0a5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-08-13T13:22:59+02:00
app_lua: docs - more details about lua_run() params
---
Modified: src/modules/app_lua/doc/app_lua_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/f1f6c303baab87523d54b97af38c0a5…
Patch:
https://github.com/kamailio/kamailio/commit/f1f6c303baab87523d54b97af38c0a5…
---
diff --git a/src/modules/app_lua/doc/app_lua_admin.xml
b/src/modules/app_lua/doc/app_lua_admin.xml
index 45ed3e29c1..74ea68e460 100644
--- a/src/modules/app_lua/doc/app_lua_admin.xml
+++ b/src/modules/app_lua/doc/app_lua_admin.xml
@@ -334,11 +334,12 @@ if(!lua_dostring("sr.log([[err]], [[----------- Hello World
from $fU\n]])"))
<section id="app_lua.f.lua_run">
<title>
- <function moreinfo="none">lua_run(function, params)</function>
+ <function moreinfo="none">lua_run(func [, params])</function>
</title>
<para>
- Execute the Lua function 'func' giving params as parameters. There
- can be up to 3 string parameters. The function must exist in the
+ Execute the Lua function 'func' giving 'params' as parameters. There
+ can be up to 3 string parameters after 'func' (overall, max 4 params,
+ first is the function). The function must exist in the Lua
script loaded at startup via parameter 'load'. Parameters can be
strings with pseudo-variables that are evaluated at runtime.
</para>
@@ -346,12 +347,14 @@ if(!lua_dostring("sr.log([[err]], [[----------- Hello World
from $fU\n]])"))
<title><function>lua_run</function> usage</title>
<programlisting format="linespecific">
...
-if(!lua_run("sr_append_fu_to_reply"))
-{
+if(!lua_run("sr_append_fu_to_reply")) {
xdbg("SCRIPT: failed to execute lua function!\n");
}
...
-lua_run("lua_funcx", "$rU", "2");
+lua_run("lua_funcx0");
+lua_run("lua_funcx1", "$rU");
+lua_run("lua_funcx2", "$rU", "2");
+lua_run("lua_funcx3", "$rU", "2", "$si");
...
</programlisting>
</example>