Module: kamailio
Branch: master
Commit: 34efa83569bedb1f36c3661ee063ff6334633e4a
URL:
https://github.com/kamailio/kamailio/commit/34efa83569bedb1f36c3661ee063ff6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-07-30T20:33:06+02:00
app_lua: docs - note about availability of 'sr' Lua module
- use KSR in the examples
---
Modified: src/modules/app_lua/doc/app_lua_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/34efa83569bedb1f36c3661ee063ff6…
Patch:
https://github.com/kamailio/kamailio/commit/34efa83569bedb1f36c3661ee063ff6…
---
diff --git a/src/modules/app_lua/doc/app_lua_admin.xml
b/src/modules/app_lua/doc/app_lua_admin.xml
index 91015da55f..de6567135c 100644
--- a/src/modules/app_lua/doc/app_lua_admin.xml
+++ b/src/modules/app_lua/doc/app_lua_admin.xml
@@ -30,6 +30,10 @@
</listitem>
</itemizedlist>
</para>
+ <para>
+ Note: to have the old Lua module 'sr' available, load the 'app_lua_sr'
+ &kamailio; module.
+ </para>
<para>
Lua (
http://www.lua.org) is a fast and easy to embed scripting
language. Exported API from SIP router to Lua is documented in the
@@ -207,7 +211,7 @@ lua_dofile("/usr/local/etc/kamailio/lua/myscript.lua");
<title><function>lua_dostring</function> usage</title>
<programlisting format="linespecific">
...
-if(!lua_dostring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
+if(!lua_dostring("KSR.log([[err]], [[----------- Hello World from $fU\n]])"))
{
xdbg("SCRIPT: failed to execute lua script!\n");
}
@@ -257,7 +261,7 @@ lua_run("lua_func3", "$rU", "2",
"$si");
<title><function>lua_runstring</function> usage</title>
<programlisting format="linespecific">
...
-if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
+if(!lua_runstring("KSR.log([[err]], [[----------- Hello World from $fU\n]])"))
{
xdbg("SCRIPT: failed to execute lua script!\n");
}
@@ -346,7 +350,7 @@ if(!lua_runstring("sr.log([[err]], [[----------- Hello World from
$fU\n]])"))
<programlisting format="linespecific">
...
function sr_append_fu_to_reply()
- sr.hdr.append_to_reply("P-From: " .. sr.pv.get("$fu") ..
"\r\n");
+ KSR.hdr.append_to_reply("P-From: " .. KSR.pv.get("$fu") ..
"\r\n");
end
...
</programlisting>