Bläddra i källkod

timer: docs - split selects from functions section

Daniel-Constantin Mierla 8 år sedan
förälder
incheckning
25a775cf44
1 ändrade filer med 51 tillägg och 46 borttagningar
  1. 51 46
      src/modules/timer/doc/timer.xml

+ 51 - 46
src/modules/timer/doc/timer.xml

@@ -35,7 +35,6 @@
 		<para>
 		<para>
 		The module supports triggering a specific route block on a specific timer.
 		The module supports triggering a specific route block on a specific timer.
 		The timer can be activated and de-activated from the routing script at runtime.
 		The timer can be activated and de-activated from the routing script at runtime.
-
 		</para>
 		</para>
     </section>
     </section>
 
 
@@ -58,7 +57,7 @@
 		<title>External Libraries or Applications</title>
 		<title>External Libraries or Applications</title>
 		<para>
 		<para>
 		The following libraries or applications must be
 		The following libraries or applications must be
-		installed before  
+		installed before
 		running &kamailio; with this module loaded:
 		running &kamailio; with this module loaded:
 			<itemizedlist>
 			<itemizedlist>
 			<listitem>
 			<listitem>
@@ -74,11 +73,12 @@
 	<section id="timer.syntax">
 	<section id="timer.syntax">
 		<title>ABNF syntax</title>
 		<title>ABNF syntax</title>
 		<programlisting>
 		<programlisting>
+...
 	timer_id = alphanum
 	timer_id = alphanum
 	slow_fast = "slow" | "fast"
 	slow_fast = "slow" | "fast"
 	declare_timer_syntax = timer_id "=" (route#|route_name) "," interval "," slow_fast "," ["enable"]
 	declare_timer_syntax = timer_id "=" (route#|route_name) "," interval "," slow_fast "," ["enable"]
 	enable_disable = "0" | "1"
 	enable_disable = "0" | "1"
-
+...
 		</programlisting>
 		</programlisting>
 	</section>
 	</section>
 
 
@@ -113,20 +113,20 @@
 				<emphasis>slow_fast</emphasis> determines if handler will be
 				<emphasis>slow_fast</emphasis> determines if handler will be
 				hooked in slow or fast timer queue, fast timer handler returns
 				hooked in slow or fast timer queue, fast timer handler returns
 				as quickly as possible, slow timer handler may spend longer time,
 				as quickly as possible, slow timer handler may spend longer time,
-				see kamailio/doc/timers.txt documentation. 
+				see kamailio/doc/timers.txt documentation.
 				</listitem>
 				</listitem>
 				<listitem>
 				<listitem>
 				<emphasis>enable</emphasis> - enable timer when &kamailio; is starting,
 				<emphasis>enable</emphasis> - enable timer when &kamailio; is starting,
-				otherwise use <function>timer_enable</function> to start it later.		
+				otherwise use <function>timer_enable</function> to start it later.
 				</listitem>
 				</listitem>
 				</itemizedlist>
 				</itemizedlist>
 			</para>
 			</para>
 			<example>
 			<example>
 				<title>Example <varname>declare_timer</varname></title>
 				<title>Example <varname>declare_timer</varname></title>
 				<programlisting>
 				<programlisting>
-	...
-	modparam("timer", "declare_timer", "MY_TIMER=MY_TIMER_ROUTE,10,slow,enable");
-	...
+...
+modparam("timer", "declare_timer", "MY_TIMER=MY_TIMER_ROUTE,10,slow,enable");
+...
 				</programlisting>
 				</programlisting>
 			</example>
 			</example>
 		</section>
 		</section>
@@ -148,7 +148,7 @@
 				Disabling and enabling in sequence may be tricky.
 				Disabling and enabling in sequence may be tricky.
 				<itemizedlist>
 				<itemizedlist>
 				<listitem>
 				<listitem>
-				<emphasis>timer_id</emphasis> references to timer declared by 
+				<emphasis>timer_id</emphasis> references to timer declared by
 				<varname>declare_timer</varname>.
 				<varname>declare_timer</varname>.
 				</listitem>
 				</listitem>
 				<listitem>
 				<listitem>
@@ -161,14 +161,17 @@
 			<example>
 			<example>
 				<title><function>timer_enable</function> usage</title>
 				<title><function>timer_enable</function> usage</title>
 				<programlisting>
 				<programlisting>
-	...
-	timer_enable("MY_TIMER", 1);
-	...
+...
+timer_enable("MY_TIMER", 1);
+...
 				</programlisting>
 				</programlisting>
 			</example>
 			</example>
 		</section>
 		</section>
+	</section>
 
 
-		<section id="timer.timer.timer_id.enabled">
+	<section id="timer.selects">
+		<title>Selects</title>
+		<section id="timer.sel.timer_id.enabled">
 			<title>
 			<title>
 				<function>@timer.timer.timer_id.enabled</function>
 				<function>@timer.timer.timer_id.enabled</function>
 			</title>
 			</title>
@@ -180,36 +183,36 @@
 			<example>
 			<example>
 				<title><function>timer.timer.timer_id.enabled</function> usage</title>
 				<title><function>timer.timer.timer_id.enabled</function> usage</title>
 				<programlisting>
 				<programlisting>
-
-	if (@timer.timer.MY_TIMER.enabled == "1") {
-	....
-	}
+...
+if (@timer.timer.MY_TIMER.enabled == "1") {
+	...
+}
+...
 				</programlisting>
 				</programlisting>
 			</example>
 			</example>
 		</section>
 		</section>
 
 
-		<section id="timer.executed">
+		<section id="timer.sel.executed">
 			<title>
 			<title>
 				<function>@timer.executed</function>
 				<function>@timer.executed</function>
 			</title>
 			</title>
 			<para>
 			<para>
-				Returns name of timer which has been executed, i.e. non empty value is returned only 
+				Returns name of timer which has been executed, i.e. non empty value is returned only
 				when handler is being processed.
 				when handler is being processed.
 			</para>
 			</para>
 
 
 			<example>
 			<example>
 				<title><function>timer.executed</function> usage</title>
 				<title><function>timer.executed</function> usage</title>
 				<programlisting>
 				<programlisting>
-
-	if (@timer.executed != "") {
-		# timer is being handled
-	....
-	}
+...
+if (@timer.executed != "") {
+	# timer is being handled
+	...
+}
+...
 				</programlisting>
 				</programlisting>
 			</example>
 			</example>
 		</section>
 		</section>
-
-
 	</section>
 	</section>
 
 
     <section id="timer.examples">
     <section id="timer.examples">
@@ -217,10 +220,11 @@
 		<example>
 		<example>
 			<title>timer common example</title>
 			<title>timer common example</title>
 			<programlisting>
 			<programlisting>
+...
 loadmodule "modules/xprint/xprint.so"
 loadmodule "modules/xprint/xprint.so"
 loadmodule "modules/timer/timer.so"
 loadmodule "modules/timer/timer.so"
 
 
-modparam("timer", "declare_timer", "tmr1=ONTIMER,1000"); 
+modparam("timer", "declare_timer", "tmr1=ONTIMER,1000");
 modparam("timer", "declare_timer", "tmr2=ONTIMER2,2000,slow,enable");
 modparam("timer", "declare_timer", "tmr2=ONTIMER2,2000,slow,enable");
 
 
 route["print"] {
 route["print"] {
@@ -237,36 +241,37 @@ route["ONTIMER2"] {
 	timer_enable("tmr1", 0);
 	timer_enable("tmr1", 0);
 	route("print");
 	route("print");
 }
 }
-
+...
 			</programlisting>
 			</programlisting>
 
 
 		</example>
 		</example>
 		<example>
 		<example>
 			<title>Using timer module for testing a functionality</title>
 			<title>Using timer module for testing a functionality</title>
 			<para>
 			<para>
-				The timer module may be used to test a functionality being developed and 
+				The timer module may be used to test a functionality being developed and
 				not requiring real request. A developer may put tested code in route section
 				not requiring real request. A developer may put tested code in route section
 				which is called once after &kamailio; starts.
 				which is called once after &kamailio; starts.
 			</para>
 			</para>
 			<programlisting>
 			<programlisting>
-			
-loadmodule "timer"; 
-loadmodule "xprint";  
-
-modparam("timer", "declare_timer", "TIMER_TEST=TEST,100,,enable"); 
-
-route {  
-	xplog("L_E","main route"); 
-}  
-    
-route[TEST] {  
-	timer_enable("TIMER_TEST", "0");  
-	xplog("L_E","test start\n");    
-		
-	# add here tested functionality
-		
-	xplog("L_E","test end\n"); 
+...
+loadmodule "timer";
+loadmodule "xprint";
+
+modparam("timer", "declare_timer", "TIMER_TEST=TEST,100,,enable");
+
+request_route {
+	xplog("L_E","main route");
 }
 }
+
+route[TEST] {
+	timer_enable("TIMER_TEST", "0");
+	xplog("L_E","test start\n");
+
+	# add here tested functionality
+
+	xplog("L_E","test end\n");
+	}
+...
 			</programlisting>
 			</programlisting>
 
 
 		</example>
 		</example>