rtimer_admin.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?xml version="1.0" encoding='ISO-8859-1'?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  4. <!-- Include general documentation entities -->
  5. <!ENTITY % docentities SYSTEM "../../../docbook/entities.xml">
  6. %docentities;
  7. ]>
  8. <!-- Module User's Guide -->
  9. <chapter>
  10. <title>&adminguide;</title>
  11. <section>
  12. <title>Overview</title>
  13. <para>
  14. The module executes route blocks on a timer base. It can create new
  15. timer processes and execute many route blocks on same timer.
  16. </para>
  17. <para>
  18. A static faked SIP message is given as parameter to called functions,
  19. so all functions available for REQUEST_ROUTE can be used.
  20. </para>
  21. </section>
  22. <section>
  23. <title>Dependencies</title>
  24. <section>
  25. <title>&kamailio; Modules</title>
  26. <para>
  27. The following modules must be loaded before this module:
  28. <itemizedlist>
  29. <listitem>
  30. <para>
  31. <emphasis>No dependencies on other &kamailio; modules</emphasis>.
  32. </para>
  33. </listitem>
  34. </itemizedlist>
  35. </para>
  36. </section>
  37. <section>
  38. <title>External Libraries or Applications</title>
  39. <para>
  40. The following libraries or applications must be installed before running
  41. &kamailio; with this module loaded:
  42. <itemizedlist>
  43. <listitem>
  44. <para>
  45. <emphasis>None</emphasis>.
  46. </para>
  47. </listitem>
  48. </itemizedlist>
  49. </para>
  50. </section>
  51. </section>
  52. <section>
  53. <title>Parameters</title>
  54. <section>
  55. <title><varname>timer</varname> (str)</title>
  56. <para>
  57. The definition of a timer. The value of the parameter must have the
  58. following format:
  59. </para>
  60. <itemizedlist>
  61. <listitem>
  62. <para>
  63. "name=_string_;mode=_number_;interval=_number_"
  64. </para>
  65. </listitem>
  66. </itemizedlist>
  67. <para>
  68. The parameter can be set multiple times to get more timers in
  69. same configuration file.
  70. </para>
  71. <itemizedlist>
  72. <listitem>
  73. <para>
  74. <emphasis>name</emphasis> - name of the timer.
  75. </para>
  76. </listitem>
  77. <listitem>
  78. <para>
  79. <emphasis>mode</emphasis> - if set to 1, will create a new timer
  80. process.
  81. </para>
  82. </listitem>
  83. <listitem>
  84. <para>
  85. <emphasis>interval</emphasis> - timer interval in seconds or
  86. micro-seconds (the value must be ended in 'u'). For micro-seconds
  87. intervals, mode is set always to 1.
  88. </para>
  89. </listitem>
  90. </itemizedlist>
  91. <para>
  92. <emphasis>
  93. Default value is NULL.
  94. </emphasis>
  95. </para>
  96. <example>
  97. <title>Set <varname>timer</varname> parameter</title>
  98. <programlisting format="linespecific">
  99. ...
  100. # time interval set to 10 seconds
  101. modparam("rtimer", "timer", "name=ta;interval=10;mode=1;")
  102. # time interval set to 100 mili-seconds
  103. modparam("rtimer", "timer", "name=ta;interval=100000u;mode=1;")
  104. ...
  105. </programlisting>
  106. </example>
  107. </section>
  108. <section>
  109. <title><varname>exec</varname> (str)</title>
  110. <para>
  111. Specify route to be executed on timer. The value of the parameter
  112. must have the following format:
  113. </para>
  114. <itemizedlist>
  115. <listitem>
  116. <para>
  117. "timer=_string_;route=_number_"
  118. </para>
  119. </listitem>
  120. </itemizedlist>
  121. <para>
  122. The parameter can be set multiple times to get more routes
  123. executed on same timer.
  124. </para>
  125. <itemizedlist>
  126. <listitem>
  127. <para>
  128. <emphasis>timer</emphasis> - name of the timer.
  129. </para>
  130. </listitem>
  131. <listitem>
  132. <para>
  133. <emphasis>route</emphasis> - the index of the route to be executed.
  134. </para>
  135. </listitem>
  136. </itemizedlist>
  137. <para>
  138. <emphasis>
  139. Default value is NULL.
  140. </emphasis>
  141. </para>
  142. <example>
  143. <title>Set <varname>exec</varname> parameter</title>
  144. <programlisting format="linespecific">
  145. ...
  146. modparam("rtimer", "timer", "name=ta;interval=10;mode=1;")
  147. modparam("rtimer", "exec", "timer=ta;route=8")
  148. route[8] {
  149. xlog("timer routine: time is %TF\n");
  150. # delete from my sql cache table entries older than 2H
  151. sql_query("delete from kamailio_cache where last_updated&lt;$TS-3600");
  152. }
  153. ...
  154. </programlisting>
  155. </example>
  156. </section>
  157. </section>
  158. </chapter>