Browse Source

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

Kamailio Dev 7 năm trước cách đây
mục cha
commit
80a78412d6
1 tập tin đã thay đổi với 18 bổ sung3 xóa
  1. 18 3
      src/modules/rtimer/README

+ 18 - 3
src/modules/rtimer/README

@@ -33,6 +33,7 @@ Daniel-Constantin Mierla
 
    1.1. Set timer parameter
    1.2. Set exec parameter
+   1.3. Use exec parameter with a Kemi engine
 
 Chapter 1. Admin Guide
 
@@ -113,18 +114,32 @@ modparam("rtimer", "timer", "name=ta;interval=100000u;mode=1;")
    The parameter can be set multiple times to get more routes executed on
    same timer.
      * timer - name of the timer.
-     * route - the index of the route to be executed.
+     * route - the name of the route block to be executed, or the name of
+       the function from kemi script. The kemi function receives a string
+       parameter with the value being the name of the module.
 
    Default value is NULL.
 
    Example 1.2. Set exec parameter
 ...
 modparam("rtimer", "timer", "name=ta;interval=10;mode=1;")
-modparam("rtimer", "exec", "timer=ta;route=8")
+modparam("rtimer", "exec", "timer=ta;route=ONTIMER")
 
-route[8] {
+route[ONTIMER] {
     xlog("timer routine: time is $TF\n");
     # delete from my sql cache table entries older than 2H
     sql_query("delete from kamailio_cache where last_updated<$TS-3600");
 }
+...
+
+   Example 1.3. Use exec parameter with a Kemi engine
+...
+modparam("rtimer", "timer", "name=ta;interval=10;mode=1;")
+modparam("rtimer", "exec", "timer=ta;route=ksr_rtimer")
+...
+-- rtimer event callback function implemented in Lua
+function ksr_rtimer(evname)
+        KSR.info("===== rtimer module triggered event\n");
+        return 1;
+end
 ...