|
@@ -11,36 +11,36 @@ Henning Westerholt
|
|
|
1&1 Internet AG
|
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright 2009 1&1 Internet AG
|
|
|
+ Copyright © 2009 1&1 Internet AG
|
|
|
Revision History
|
|
|
- Revision $Revision: 4863 $ $Date: 2008-09-05 13:11:33 +0200
|
|
|
- (Fri, 05 Sep 2008) $
|
|
|
- __________________________________________________________
|
|
|
+ Revision $Revision: 4863 $ $Date: 2008-09-05 13:11:33 +0200 (Fri, 05
|
|
|
+ Sep 2008) $
|
|
|
+ __________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
|
|
|
|
1. Admin Guide
|
|
|
|
|
|
- 1.1. Overview
|
|
|
- 1.2. Dependencies
|
|
|
+ 1. Overview
|
|
|
+ 2. Dependencies
|
|
|
|
|
|
- 1.2.1. Kamailio Modules
|
|
|
- 1.2.2. External Libraries or Applications
|
|
|
+ 2.1. Kamailio Modules
|
|
|
+ 2.2. External Libraries or Applications
|
|
|
|
|
|
- 1.3. Exported Parameters
|
|
|
+ 3. Exported Parameters
|
|
|
|
|
|
- 1.3.1. timeout (integer)
|
|
|
- 1.3.2. server (string)
|
|
|
+ 3.1. timeout (integer)
|
|
|
+ 3.2. server (string)
|
|
|
|
|
|
- 1.4. Exported Functions
|
|
|
+ 4. Exported Functions
|
|
|
|
|
|
- 1.4.1. pdb_query (string query, string dstavp)
|
|
|
+ 4.1. pdb_query (string query, string dstavp)
|
|
|
|
|
|
- 1.5. MI Commands
|
|
|
+ 5. MI Commands
|
|
|
|
|
|
- 1.5.1. pdb_status
|
|
|
- 1.5.2. pdb_activate
|
|
|
- 1.5.3. pdb_deactivate
|
|
|
+ 5.1. pdb_status
|
|
|
+ 5.2. pdb_activate
|
|
|
+ 5.3. pdb_deactivate
|
|
|
|
|
|
List of Examples
|
|
|
|
|
@@ -53,31 +53,60 @@ Henning Westerholt
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
|
|
|
|
-1.1. Overview
|
|
|
+ Table of Contents
|
|
|
+
|
|
|
+ 1. Overview
|
|
|
+ 2. Dependencies
|
|
|
+
|
|
|
+ 2.1. Kamailio Modules
|
|
|
+ 2.2. External Libraries or Applications
|
|
|
+
|
|
|
+ 3. Exported Parameters
|
|
|
+
|
|
|
+ 3.1. timeout (integer)
|
|
|
+ 3.2. server (string)
|
|
|
+
|
|
|
+ 4. Exported Functions
|
|
|
+
|
|
|
+ 4.1. pdb_query (string query, string dstavp)
|
|
|
|
|
|
- The pdb module allows Kamailio to send queries to a list of
|
|
|
- servers and store the answer in an AVP. The idea is to ask all
|
|
|
- servers in parallel and use the first answer, that comes back.
|
|
|
- A timeout for the query can be defined in milliseconds. The
|
|
|
- queying can be activated and deactivated using FIFO commands.
|
|
|
+ 5. MI Commands
|
|
|
|
|
|
-1.2. Dependencies
|
|
|
+ 5.1. pdb_status
|
|
|
+ 5.2. pdb_activate
|
|
|
+ 5.3. pdb_deactivate
|
|
|
|
|
|
-1.2.1. Kamailio Modules
|
|
|
+1. Overview
|
|
|
|
|
|
- The module depends on the following modules (in the other words
|
|
|
- the listed modules must be loaded before this module):
|
|
|
+ The pdb module allows Kamailio to send queries to a list of servers and
|
|
|
+ store the answer in an AVP. The idea is to ask all servers in parallel
|
|
|
+ and use the first answer, that comes back. A timeout for the query can
|
|
|
+ be defined in milliseconds. The queying can be activated and
|
|
|
+ deactivated using FIFO commands.
|
|
|
+
|
|
|
+2. Dependencies
|
|
|
+
|
|
|
+ 2.1. Kamailio Modules
|
|
|
+ 2.2. External Libraries or Applications
|
|
|
+
|
|
|
+2.1. Kamailio Modules
|
|
|
+
|
|
|
+ The module depends on the following modules (in the other words the
|
|
|
+ listed modules must be loaded before this module):
|
|
|
* none
|
|
|
|
|
|
-1.2.2. External Libraries or Applications
|
|
|
+2.2. External Libraries or Applications
|
|
|
|
|
|
- The following libraries or applications must be installed
|
|
|
- before running Kamailio with this module loaded:
|
|
|
+ The following libraries or applications must be installed before
|
|
|
+ running Kamailio with this module loaded:
|
|
|
* none
|
|
|
|
|
|
-1.3. Exported Parameters
|
|
|
+3. Exported Parameters
|
|
|
|
|
|
-1.3.1. timeout (integer)
|
|
|
+ 3.1. timeout (integer)
|
|
|
+ 3.2. server (string)
|
|
|
+
|
|
|
+3.1. timeout (integer)
|
|
|
|
|
|
This is the timeout in milliseconds for the pdb_query function.
|
|
|
|
|
@@ -88,28 +117,29 @@ Chapter 1. Admin Guide
|
|
|
modparam("pdb", "timeout", 10)
|
|
|
...
|
|
|
|
|
|
-1.3.2. server (string)
|
|
|
+3.2. server (string)
|
|
|
|
|
|
- This is the list of servers to be used by the pdb_query
|
|
|
- function. Queries will be sent in parallel to all servers
|
|
|
- configured in this list. This parameter is mandatory.
|
|
|
+ This is the list of servers to be used by the pdb_query function.
|
|
|
+ Queries will be sent in parallel to all servers configured in this
|
|
|
+ list. This parameter is mandatory.
|
|
|
|
|
|
Example 1.2. Set server parameter
|
|
|
...
|
|
|
-modparam("pdb", "server", "localhost:10001,host.name:10001,192.168.1.
|
|
|
-7:10002")
|
|
|
+modparam("pdb", "server", "localhost:10001,host.name:10001,192.168.1.7:10002")
|
|
|
...
|
|
|
|
|
|
-1.4. Exported Functions
|
|
|
+4. Exported Functions
|
|
|
+
|
|
|
+ 4.1. pdb_query (string query, string dstavp)
|
|
|
|
|
|
-1.4.1. pdb_query (string query, string dstavp)
|
|
|
+4.1. pdb_query (string query, string dstavp)
|
|
|
|
|
|
- Sends the query string to all configured servers and stores the
|
|
|
- answer in dstavp. If it takes more than the configured timeout,
|
|
|
- false is returned. Pseudo-variables or AVPs can be used for the
|
|
|
- query string. The answer must consist of the null terminated
|
|
|
- query string followed by a two byte integer value in network
|
|
|
- byte order. The integer value will be stored in the given AVP.
|
|
|
+ Sends the query string to all configured servers and stores the answer
|
|
|
+ in dstavp. If it takes more than the configured timeout, false is
|
|
|
+ returned. Pseudo-variables or AVPs can be used for the query string.
|
|
|
+ The answer must consist of the null terminated query string followed by
|
|
|
+ a two byte integer value in network byte order. The integer value will
|
|
|
+ be stored in the given AVP.
|
|
|
|
|
|
Example 1.3. pdb_query usage
|
|
|
...
|
|
@@ -120,9 +150,13 @@ if (!pdb_query("$rU", "$avp(i:82)"))
|
|
|
cr_route("$avp(i:82)", "$rd", "$rU", "$rU", "call_id");
|
|
|
...
|
|
|
|
|
|
-1.5. MI Commands
|
|
|
+5. MI Commands
|
|
|
+
|
|
|
+ 5.1. pdb_status
|
|
|
+ 5.2. pdb_activate
|
|
|
+ 5.3. pdb_deactivate
|
|
|
|
|
|
-1.5.1. pdb_status
|
|
|
+5.1. pdb_status
|
|
|
|
|
|
Prints the status of the module. This can either be "active" or
|
|
|
"deactivated".
|
|
@@ -132,21 +166,20 @@ cr_route("$avp(i:82)", "$rd", "$rU", "$rU", "call_id");
|
|
|
kamctl fifo pdb_status
|
|
|
...
|
|
|
|
|
|
-1.5.2. pdb_activate
|
|
|
+5.2. pdb_activate
|
|
|
|
|
|
- Activates the module. This is the default after loading the
|
|
|
- module.
|
|
|
+ Activates the module. This is the default after loading the module.
|
|
|
|
|
|
Example 1.5. pdb_activate usage
|
|
|
...
|
|
|
kamctl fifo pdb_activate
|
|
|
...
|
|
|
|
|
|
-1.5.3. pdb_deactivate
|
|
|
+5.3. pdb_deactivate
|
|
|
|
|
|
- Deactivates the module. No more queries are performed until it
|
|
|
- is activated again. As long as the module is deactivated, the
|
|
|
- pdb_query function will return -1.
|
|
|
+ Deactivates the module. No more queries are performed until it is
|
|
|
+ activated again. As long as the module is deactivated, the pdb_query
|
|
|
+ function will return -1.
|
|
|
|
|
|
Example 1.6. pdb_deactivate usage
|
|
|
...
|