|
@@ -94,6 +94,9 @@ Chapter 1. Admin Guide
|
|
To read more about KEMI exports and available KSR submodules, see:
|
|
To read more about KEMI exports and available KSR submodules, see:
|
|
* http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/
|
|
* http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/
|
|
|
|
|
|
|
|
+ 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
|
|
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
|
|
language. Exported API from SIP router to Lua is documented in the
|
|
dokuwiki.
|
|
dokuwiki.
|
|
@@ -203,7 +206,7 @@ lua_dofile("/usr/local/etc/kamailio/lua/myscript.lua");
|
|
|
|
|
|
Example 1.6. lua_dostring usage
|
|
Example 1.6. lua_dostring 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");
|
|
xdbg("SCRIPT: failed to execute lua script!\n");
|
|
}
|
|
}
|
|
@@ -237,7 +240,7 @@ lua_run("lua_func3", "$rU", "2", "$si");
|
|
|
|
|
|
Example 1.8. lua_runstring usage
|
|
Example 1.8. lua_runstring 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");
|
|
xdbg("SCRIPT: failed to execute lua script!\n");
|
|
}
|
|
}
|
|
@@ -297,7 +300,7 @@ if(!lua_runstring("sr.log([[err]], [[----------- Hello World from $fU\n]])"))
|
|
'/usr/local/etc/kamailio/lua/myscript.lua'.
|
|
'/usr/local/etc/kamailio/lua/myscript.lua'.
|
|
...
|
|
...
|
|
function sr_append_fu_to_reply()
|
|
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
|
|
end
|
|
...
|
|
...
|
|
|
|
|