2
0

db_postgres_admin.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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>The module is an implementation of the internal DB API v1 and v2
  14. connector for PostgreSQL server. It has support for reconnecting
  15. when the connection is broken.</para>
  16. </section>
  17. <section>
  18. <title>Dependencies</title>
  19. <section>
  20. <title>&kamailio; Modules</title>
  21. <para>
  22. The following modules must be loaded before this module:
  23. <itemizedlist>
  24. <listitem>
  25. <para>
  26. <emphasis>No dependencies on other &kamailio; modules</emphasis>.
  27. </para>
  28. </listitem>
  29. </itemizedlist>
  30. </para>
  31. </section>
  32. <section>
  33. <title>External Libraries or Applications</title>
  34. <para>
  35. The following libraries or applications must be installed before running
  36. &kamailio; with this module loaded:
  37. <itemizedlist>
  38. <listitem>
  39. <para>
  40. <emphasis>PostgreSQL library</emphasis> - e.g., libpq5.
  41. </para>
  42. </listitem>
  43. <listitem>
  44. <para>
  45. <emphasis>PostgreSQL devel library</emphasis> - to compile
  46. the module (e.g., libpq-dev).
  47. </para>
  48. </listitem>
  49. </itemizedlist>
  50. </para>
  51. </section>
  52. </section>
  53. <section>
  54. <title>Parameters</title>
  55. <section>
  56. <title><varname>retries</varname> (integer)</title>
  57. <para>
  58. How many retries to attept to reconnect if connection to Postgres
  59. server becomes broken.
  60. </para>
  61. <para>
  62. <emphasis>
  63. Default value is 2 (that means three attepts to submit the query,
  64. first will triger the connection error and two more (the value
  65. of this parameter) after resetting the connection).
  66. </emphasis>
  67. </para>
  68. <example>
  69. <title>Set <varname>retries</varname> parameter</title>
  70. <programlisting format="linespecific">
  71. ...
  72. modparam("db_postgres", "retries", 3)
  73. ...
  74. </programlisting>
  75. </example>
  76. </section>
  77. <section>
  78. <title><varname>timeout</varname> (integer)</title>
  79. <para>
  80. Setting this variable to any value larger than zero (which is the
  81. default value) enables both a connection timeout and a query
  82. timeout. If a connection attempt or a query takes longer than this
  83. many seconds, the operation will be aborted and an error will be
  84. returned.
  85. </para>
  86. <para>
  87. Note that this timeout is applied to each underlying operation
  88. (i.e. for each connection attempt), so depending on circumstances
  89. and on the value of the <quote>retries</quote> variable, a single
  90. query from the &sip; proxy's point of view can take longer than the
  91. <quote>timeout</quote>.
  92. </para>
  93. <example>
  94. <title>Set <varname>timeout</varname> parameter</title>
  95. <programlisting format="linespecific">
  96. ...
  97. modparam("db_postgres", "timeout", 10)
  98. ...
  99. </programlisting>
  100. </example>
  101. </section>
  102. <section>
  103. <title><varname>tcp_keepalive</varname> (integer)</title>
  104. <para>
  105. Enable the TCP keepalive timer and set the number of seconds the
  106. connection must be idle before to start sending keepalive packets.
  107. Defaults to zero, which disables TCP keepalive packets.
  108. </para>
  109. <para>
  110. <emphasis>
  111. Only supported on platforms which understand and support the
  112. <quote>TCP_KEEPIDLE</quote> socket option.
  113. </emphasis>
  114. </para>
  115. <example>
  116. <title>Set <varname>tcp_keepalive</varname> parameter</title>
  117. <programlisting format="linespecific">
  118. ...
  119. modparam("db_postgres", "tcp_keepalive", 600)
  120. ...
  121. </programlisting>
  122. </example>
  123. </section>
  124. </section>
  125. <section>
  126. <title>Functions</title>
  127. <para>
  128. NONE
  129. </para>
  130. </section>
  131. </chapter>