[sr-dev] git:master:666656c2: rtimer: doc - updated examples, enhancements for use with kemi

Daniel-Constantin Mierla miconda at gmail.com
Sun Oct 29 09:14:43 CET 2017


Module: kamailio
Branch: master
Commit: 666656c27b8d01d490523f0a7e15de57ff42bad5
URL: https://github.com/kamailio/kamailio/commit/666656c27b8d01d490523f0a7e15de57ff42bad5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-10-29T09:13:31+01:00

rtimer: doc - updated examples, enhancements for use with kemi

---

Modified: src/modules/rtimer/doc/rtimer_admin.xml

---

Diff:  https://github.com/kamailio/kamailio/commit/666656c27b8d01d490523f0a7e15de57ff42bad5.diff
Patch: https://github.com/kamailio/kamailio/commit/666656c27b8d01d490523f0a7e15de57ff42bad5.patch

---

diff --git a/src/modules/rtimer/doc/rtimer_admin.xml b/src/modules/rtimer/doc/rtimer_admin.xml
index c70a4e5b23..92422c5f3e 100644
--- a/src/modules/rtimer/doc/rtimer_admin.xml
+++ b/src/modules/rtimer/doc/rtimer_admin.xml
@@ -10,9 +10,9 @@
 <!-- Module User's Guide -->
 
 <chapter>
-	
+
 	<title>&adminguide;</title>
-	
+
 	<section>
 	<title>Overview</title>
 	<para>
@@ -136,7 +136,10 @@ modparam("rtimer", "timer", "name=ta;interval=100000u;mode=1;")
 		</listitem>
 		<listitem>
 		<para>
-		<emphasis>route</emphasis> - the index of the route to be executed.
+		<emphasis>route</emphasis> - 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.
 		</para>
 		</listitem>
 		</itemizedlist>
@@ -150,9 +153,9 @@ modparam("rtimer", "timer", "name=ta;interval=100000u;mode=1;")
 		<programlisting format="linespecific">
 ...
 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");
@@ -160,6 +163,22 @@ route[8] {
 ...
 </programlisting>
 		</example>
+		<example>
+		<title>Use <varname>exec</varname> parameter with a Kemi engine</title>
+		<programlisting format="linespecific">
+...
+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
+...
+</programlisting>
+		</example>
+
 	</section>
 	</section>
 




More information about the sr-dev mailing list