Module: kamailio
Branch: master
Commit: a712dc3a256ab567b133e55d4331780f44d24123
URL:
https://github.com/kamailio/kamailio/commit/a712dc3a256ab567b133e55d4331780…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-04-27T16:42:57+02:00
examples/kemi: more comments to explain the lua routing script
---
Modified: examples/kemi/kamailio-basic-kemi-lua.lua
---
Diff:
https://github.com/kamailio/kamailio/commit/a712dc3a256ab567b133e55d4331780…
Patch:
https://github.com/kamailio/kamailio/commit/a712dc3a256ab567b133e55d4331780…
---
diff --git a/examples/kemi/kamailio-basic-kemi-lua.lua
b/examples/kemi/kamailio-basic-kemi-lua.lua
index 517346c..70593bb 100644
--- a/examples/kemi/kamailio-basic-kemi-lua.lua
+++ b/examples/kemi/kamailio-basic-kemi-lua.lua
@@ -1,8 +1,10 @@
-- Kamailio - equivalent of routing blocks in Lua
+--
-- KSR - the new dynamic object exporting Kamailio functions
-- sr - the old static object exporting Kamailio functions
--
+-- global variables corresponding to defined values (e.g., flags) in kamailio.cfg
FLT_ACC=1
FLT_ACCMISSED=2
FLT_ACCFAILED=3
@@ -322,6 +324,7 @@ function ksr_route_sipout()
end
-- Manage outgoing branches
+-- equivalent of branch_route[...]{}
function ksr_branch_manage()
KSR.dbg("new branch [".. KSR.pv.get("$T_branch_idx]")
.. " to ".. KSR.pv.get("$ru") .. "\n");
@@ -330,6 +333,7 @@ function ksr_branch_manage()
end
-- Manage incoming replies
+-- equivalent of onreply_route[...]{}
function ksr_onreply_manage()
KSR.dbg("incoming reply\n");
local scode = KSR.pv.get("$rs");
@@ -340,6 +344,7 @@ function ksr_onreply_manage()
end
-- Manage failure routing cases
+-- equivalent of failure_route[...]{}
function ksr_failure_manage()
if ksr_route_natmanage()==-255 then return 1; end
@@ -349,7 +354,7 @@ function ksr_failure_manage()
return 1;
end
--- SIP response routing
+-- SIP response handling
-- equivalent of reply_route{}
function ksr_reply_route()
KSR.info("===== response - from kamailio lua script\n");