|
@@ -10,7 +10,7 @@ Daniel-Constantin Mierla
|
|
|
|
|
|
<[email protected]>
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright © 2010 Daniel-Constantin Mierla (asipto.com)
|
|
|
|
|
|
+ Copyright © 2010 Daniel-Constantin Mierla (asipto.com)
|
|
__________________________________________________________________
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
Table of Contents
|
|
@@ -116,7 +116,7 @@ Chapter 1. Admin Guide
|
|
use lua_run(function, params) to execute a function from the script at
|
|
use lua_run(function, params) to execute a function from the script at
|
|
runtime.
|
|
runtime.
|
|
|
|
|
|
- Default value is “null�.
|
|
|
|
|
|
+ Default value is "null".
|
|
|
|
|
|
Example 1.1. Set load parameter
|
|
Example 1.1. Set load parameter
|
|
...
|
|
...
|
|
@@ -144,7 +144,7 @@ modparam("app_lua", "load", "/usr/local/etc/kamailio/lua/myscript.lua")
|
|
Note that 'sr', 'sr.hdr' and 'sr.pv' modules are always registered to
|
|
Note that 'sr', 'sr.hdr' and 'sr.pv' modules are always registered to
|
|
Lua.
|
|
Lua.
|
|
|
|
|
|
- Default value is “null�.
|
|
|
|
|
|
+ Default value is "null".
|
|
|
|
|
|
Example 1.2. Set register parameter
|
|
Example 1.2. Set register parameter
|
|
...
|
|
...
|
|
@@ -158,7 +158,7 @@ modparam("app_lua", "register", "sl")
|
|
4.3. lua_run(function, params)
|
|
4.3. lua_run(function, params)
|
|
4.4. lua_runstring(script)
|
|
4.4. lua_runstring(script)
|
|
|
|
|
|
-4.1. lua_dofile(path)
|
|
|
|
|
|
+4.1. lua_dofile(path)
|
|
|
|
|
|
Execute the Lua script stored in 'path'. The parameter can be a string
|
|
Execute the Lua script stored in 'path'. The parameter can be a string
|
|
with pseudo-variables evaluated at runtime.
|
|
with pseudo-variables evaluated at runtime.
|
|
@@ -168,9 +168,9 @@ modparam("app_lua", "register", "sl")
|
|
lua_dofile("/usr/local/etc/kamailio/lua/myscript.lua");
|
|
lua_dofile("/usr/local/etc/kamailio/lua/myscript.lua");
|
|
...
|
|
...
|
|
|
|
|
|
-4.2. lua_dostring(script)
|
|
|
|
|
|
+4.2. lua_dostring(script)
|
|
|
|
|
|
- i Execute the Lua script stored in parameter. The parameter can be a
|
|
|
|
|
|
+ Execute the Lua script stored in parameter. The parameter can be a
|
|
string with pseudo-variables.
|
|
string with pseudo-variables.
|
|
|
|
|
|
Example 1.4. lua_dostring usage
|
|
Example 1.4. lua_dostring usage
|
|
@@ -181,7 +181,7 @@ if(!lua_dostring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-4.3. lua_run(function, params)
|
|
|
|
|
|
+4.3. lua_run(function, params)
|
|
|
|
|
|
Execute the Lua function 'func' giving params as parameters. There can
|
|
Execute the Lua function 'func' giving params as parameters. There can
|
|
be up to 3 string parameters. The function must exist in the script
|
|
be up to 3 string parameters. The function must exist in the script
|
|
@@ -198,9 +198,9 @@ if(!lua_run("sr_append_fu_to_reply"))
|
|
lua_run("lua_funcx", "$rU", "2");
|
|
lua_run("lua_funcx", "$rU", "2");
|
|
...
|
|
...
|
|
|
|
|
|
-4.4. lua_runstring(script)
|
|
|
|
|
|
+4.4. lua_runstring(script)
|
|
|
|
|
|
- i Execute the Lua script stored in parameter. The parameter can be a
|
|
|
|
|
|
+ Execute the Lua script stored in parameter. The parameter can be a
|
|
string with pseudo-variables. The script is executed in Lua context
|
|
string with pseudo-variables. The script is executed in Lua context
|
|
specific to loaded Lua files at startup.
|
|
specific to loaded Lua files at startup.
|
|
|
|
|