From 34efa83569bedb1f36c3661ee063ff6334633e4a Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Thu, 30 Jul 2020 20:32:02 +0200 Subject: [PATCH] app_lua: docs - note about availability of 'sr' Lua module - use KSR in the examples --- src/modules/app_lua/doc/app_lua_admin.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/app_lua/doc/app_lua_admin.xml b/src/modules/app_lua/doc/app_lua_admin.xml index 91015da55f8..de6567135c3 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 @@ + + Note: to have the old Lua module 'sr' available, load the 'app_lua_sr' + &kamailio; module. + 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"); <function>lua_dostring</function> usage ... -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"); <function>lua_runstring</function> usage ... -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]])")) ... 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 ...