Browse code

app_lua: docs - note about availability of 'sr' Lua module

- use KSR in the examples

(cherry picked from commit 34efa83569bedb1f36c3661ee063ff6334633e4a)
(cherry picked from commit c98d9e8c6687f2311f51016ed9cc2e089d4eb242)

Daniel-Constantin Mierla authored on 30/07/2020 18:32:02
Showing 1 changed files
... ...
@@ -30,6 +30,10 @@
30 30
 		    </listitem>
31 31
     	</itemizedlist>
32 32
 	</para>
33
+	<para>
34
+		Note: to have the old Lua module 'sr' available, load the 'app_lua_sr'
35
+		&kamailio; module.
36
+	</para>
33 37
 	<para>
34 38
 		Lua (http://www.lua.org) is a fast and easy to embed scripting
35 39
 		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");
207 211
 		<title><function>lua_dostring</function> usage</title>
208 212
 		<programlisting format="linespecific">
209 213
 ...
210
-if(!lua_dostring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
214
+if(!lua_dostring("KSR.log([[err]], [[----------- Hello World from $fU\n]])"))
211 215
 {
212 216
     xdbg("SCRIPT: failed to execute lua script!\n");
213 217
 }
... ...
@@ -257,7 +261,7 @@ lua_run("lua_func3", "$rU", "2", "$si");
257 261
 		<title><function>lua_runstring</function> usage</title>
258 262
 		<programlisting format="linespecific">
259 263
 ...
260
-if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
264
+if(!lua_runstring("KSR.log([[err]], [[----------- Hello World from $fU\n]])"))
261 265
 {
262 266
     xdbg("SCRIPT: failed to execute lua script!\n");
263 267
 }
... ...
@@ -346,7 +350,7 @@ if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
346 350
 <programlisting format="linespecific">
347 351
 ...
348 352
 function sr_append_fu_to_reply()
349
-	sr.hdr.append_to_reply("P-From: " .. sr.pv.get("$fu") .. "\r\n");
353
+	KSR.hdr.append_to_reply("P-From: " .. KSR.pv.get("$fu") .. "\r\n");
350 354
 end
351 355
 ...
352 356
 </programlisting>