tsilo_admin.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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 xmlns:xi="http://www.w3.org/2001/XInclude">
  10. <title>&adminguide;</title>
  11. <section>
  12. <title>Overview</title>
  13. <para>
  14. This modules provides transaction storage for the &kamailioname;. It
  15. stores in an internal table transactions for an user and add branches
  16. to them if new contacts are added.
  17. </para>
  18. <para>
  19. For each message, the modules stores <quote>Request-URI</quote>
  20. (<quote>R-URI</quote>), &uri; and the internal transaction index
  21. and label.
  22. </para>
  23. <para>
  24. When the transaction is destroyed (by the <emphasis>TM</emphasis> module,
  25. the transaction is removed from the module table.
  26. </para>
  27. </section>
  28. <section>
  29. <title>Dependencies</title>
  30. <section>
  31. <title>&kamailio; modules</title>
  32. <para>
  33. The following modules must be loaded before this module:
  34. <itemizedlist>
  35. <listitem>
  36. <para>
  37. <emphasis>REGISTRAR</emphasis>--registrar module-- used to lookup
  38. for new contacts and update the dset for the r-uri.
  39. </para>
  40. </listitem>
  41. <listitem>
  42. <para>
  43. <emphasis>TM</emphasis>--transaction module-- used to
  44. send &sip; requests.
  45. </para>
  46. </listitem>
  47. </itemizedlist>
  48. </para>
  49. </section>
  50. <section>
  51. <title>External libraries or applications</title>
  52. <para>
  53. The following libraries or applications must be installed before
  54. running &kamailio; with this module:
  55. <itemizedlist>
  56. <listitem>
  57. <para>
  58. <emphasis>none</emphasis>.
  59. </para>
  60. </listitem>
  61. </itemizedlist>
  62. </para>
  63. </section>
  64. </section>
  65. <section>
  66. <title>Parameters</title>
  67. <section>
  68. <title><varname>hash_size</varname> (integer)</title>
  69. <para>
  70. The size of the hash table internally used to keep the transaction. A
  71. larger table is much faster but consumes more memory. The hash size
  72. must be a power of two, otherwise it will be rounded down to the nearest
  73. power of two.
  74. </para>
  75. <para>
  76. <emphasis>
  77. Default value is <quote>2048</quote>.
  78. </emphasis>
  79. </para>
  80. <example>
  81. <title>Set <varname>hash_size</varname> parameter</title>
  82. <programlisting format="linespecific">
  83. ...
  84. modparam("tsilo", "hash_size", 1024)
  85. ...
  86. </programlisting>
  87. </example>
  88. </section>
  89. </section>
  90. <section>
  91. <title>Functions</title>
  92. <section>
  93. <title><function moreinfo="none">ts_store()</function></title>
  94. <para>
  95. The method stores r-uri, tindex and tlabel of the current transaction.
  96. </para>
  97. <para>
  98. This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
  99. </para>
  100. <example>
  101. <title><function>ts_store</function> usage</title>
  102. <programlisting format="linespecific">
  103. ...
  104. if (is_method("INVITE")) {
  105. if (t_newtran()) {
  106. ts_store();
  107. }
  108. }
  109. ...
  110. </programlisting>
  111. </example>
  112. </section>
  113. <section>
  114. <title><function moreinfo="none">ts_append(domain, ruri)</function></title>
  115. <para>
  116. The method add branches to all the stored transactions for the &sip;
  117. ruri passed as parameter, performing a contact lookup on the table specified by
  118. the domain parameter. The method should be called when a REGISTER
  119. request is received.
  120. </para>
  121. <para>Meaning of the parameters is as follows:</para>
  122. <itemizedlist>
  123. <listitem>
  124. <para>
  125. <emphasis>domain</emphasis> - Name of table that should be used for looking
  126. up new contacts for r-uri.
  127. </para>
  128. </listitem>
  129. <listitem>
  130. <para>
  131. <emphasis>ruri</emphasis> - The r-uri for which we want to check existing
  132. transactions and add them new branches. Can be a static string value or a
  133. dynamic string with pseudo-variables.
  134. </para>
  135. </listitem>
  136. </itemizedlist>
  137. <para>
  138. This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
  139. </para>
  140. <example>
  141. <title><function>ts_append</function> usage</title>
  142. <programlisting format="linespecific">
  143. ...
  144. if (is_method("REGISTER")) {
  145. ts_append("location", "$tu");
  146. }
  147. ...
  148. </programlisting>
  149. </example>
  150. </section>
  151. <section>
  152. <title><function moreinfo="none">ts_append_to(tindex, tlabel, domain)</function></title>
  153. <para>
  154. The method add branches to the transaction identified by tindex and tlabel,
  155. performing a contacts lookup on the table specified by the domain parameter.
  156. The method should be called when a REGISTER request is received.
  157. </para>
  158. <para>Meaning of the parameters is as follows:</para>
  159. <itemizedlist>
  160. <listitem>
  161. <para>
  162. <emphasis>tindex</emphasis> - internal index of transaction.
  163. Can be an integer or a pseudo-variable.
  164. </para>
  165. </listitem>
  166. <listitem>
  167. <para>
  168. <emphasis>tlabel</emphasis> - internal label of transaction.
  169. Can be an integer or a pseudo-variable.
  170. </para>
  171. </listitem>
  172. <listitem>
  173. <para>
  174. <emphasis>domain</emphasis> - Name of table that should be used for looking
  175. up new contacts for r-uri.
  176. </para>
  177. </listitem>
  178. </itemizedlist>
  179. <para>
  180. This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
  181. </para>
  182. <example>
  183. <title><function>ts_append_to</function> usage</title>
  184. <programlisting format="linespecific">
  185. ...
  186. if (is_method("REGISTER")) {
  187. $var(tindex) = ...
  188. $var(tlabel) = ...
  189. ts_append_to("$var(tindex)", "$var(tlabel", "location");
  190. }
  191. ...
  192. </programlisting>
  193. </example>
  194. </section>
  195. </section>
  196. <section>
  197. <title>Statistics</title>
  198. </section>
  199. </chapter>