Browse code

modules: readme files regenerated - app_lua ... [skip ci]

Kamailio Dev authored on 30/07/2020 18:46:13
Showing 1 changed files
... ...
@@ -94,6 +94,9 @@ Chapter 1. Admin Guide
94 94
    To read more about KEMI exports and available KSR submodules, see:
95 95
      * http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/
96 96
 
97
+   Note: to have the old Lua module 'sr' available, load the 'app_lua_sr'
98
+   Kamailio module.
99
+
97 100
    Lua (http://www.lua.org) is a fast and easy to embed scripting
98 101
    language. Exported API from SIP router to Lua is documented in the
99 102
    dokuwiki.
... ...
@@ -203,7 +206,7 @@ lua_dofile("/usr/local/etc/kamailio/lua/myscript.lua");
203 206
 
204 207
    Example 1.6. lua_dostring usage
205 208
 ...
206
-if(!lua_dostring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
209
+if(!lua_dostring("KSR.log([[err]], [[----------- Hello World from $fU\n]])"))
207 210
 {
208 211
     xdbg("SCRIPT: failed to execute lua script!\n");
209 212
 }
... ...
@@ -237,7 +240,7 @@ lua_run("lua_func3", "$rU", "2", "$si");
237 240
 
238 241
    Example 1.8. lua_runstring usage
239 242
 ...
240
-if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
243
+if(!lua_runstring("KSR.log([[err]], [[----------- Hello World from $fU\n]])"))
241 244
 {
242 245
     xdbg("SCRIPT: failed to execute lua script!\n");
243 246
 }
... ...
@@ -297,7 +300,7 @@ if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
297 300
    '/usr/local/etc/kamailio/lua/myscript.lua'.
298 301
 ...
299 302
 function sr_append_fu_to_reply()
300
-        sr.hdr.append_to_reply("P-From: " .. sr.pv.get("$fu") .. "\r\n");
303
+        KSR.hdr.append_to_reply("P-From: " .. KSR.pv.get("$fu") .. "\r\n");
301 304
 end
302 305
 ...
303 306