%docentities; ]> &adminguide;
Overview The module is an implementation of the internal DB API v1 and v2 connector for PostgreSQL server. It has support for reconnecting when the connection is broken.
Dependencies
&kamailio; Modules The following modules must be loaded before this module: No dependencies on other &kamailio; modules.
External Libraries or Applications The following libraries or applications must be installed before running &kamailio; with this module loaded: PostgreSQL library - e.g., libpq5. PostgreSQL devel library - to compile the module (e.g., libpq-dev).
Parameters
<varname>retries</varname> (integer) How many retries to attept to reconnect if connection to Postgres server becomes broken. Default value is 2 (that means three attepts to submit the query, first will triger the connection error and two more (the value of this parameter) after resetting the connection). Set <varname>retries</varname> parameter ... modparam("db_postgres", "retries", 3) ...
<varname>timeout</varname> (integer) Setting this variable to any value larger than zero (which is the default value) enables both a connection timeout and a query timeout. If a connection attempt or a query takes longer than this many seconds, the operation will be aborted and an error will be returned. Note that this timeout is applied to each underlying operation (i.e. for each connection attempt), so depending on circumstances and on the value of the retries variable, a single query from the &sip; proxy's point of view can take longer than the timeout. Set <varname>timeout</varname> parameter ... modparam("db_postgres", "timeout", 10) ...
<varname>tcp_keepalive</varname> (integer) Enable the TCP keepalive timer and set the number of seconds the connection must be idle before to start sending keepalive packets. Defaults to zero, which disables TCP keepalive packets. Only supported on platforms which understand and support the TCP_KEEPIDLE socket option. Set <varname>tcp_keepalive</varname> parameter ... modparam("db_postgres", "tcp_keepalive", 600) ...
Functions NONE