|
@@ -17,21 +17,21 @@ Elena-Ramona Modroiu
|
|
|
|
|
|
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. mqueue (string)
|
|
|
+ 3.1. mqueue (string)
|
|
|
|
|
|
- 1.4. Exported Functions
|
|
|
+ 4. Exported Functions
|
|
|
|
|
|
- 1.4.1. mq_add(queue, key, value)
|
|
|
- 1.4.2. mq_fetch(queue)
|
|
|
- 1.4.3. mq_pv(queue)
|
|
|
+ 4.1. mq_add(queue, key, value)
|
|
|
+ 4.2. mq_fetch(queue)
|
|
|
+ 4.3. mq_pv_free(queue)
|
|
|
|
|
|
List of Examples
|
|
|
|
|
@@ -42,7 +42,25 @@ Elena-Ramona Modroiu
|
|
|
|
|
|
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. mqueue (string)
|
|
|
+
|
|
|
+ 4. Exported Functions
|
|
|
+
|
|
|
+ 4.1. mq_add(queue, key, value)
|
|
|
+ 4.2. mq_fetch(queue)
|
|
|
+ 4.3. mq_pv_free(queue)
|
|
|
+
|
|
|
+1. Overview
|
|
|
|
|
|
This module offers generic message queue system in shared memory for
|
|
|
inter-process communication via config file. One example of usage is to
|
|
@@ -52,22 +70,27 @@ Chapter 1. Admin Guide
|
|
|
There can be defined many queues, access to values being done via
|
|
|
pseudo variables.
|
|
|
|
|
|
-1.2. Dependencies
|
|
|
+2. Dependencies
|
|
|
+
|
|
|
+ 2.1. Kamailio Modules
|
|
|
+ 2.2. External Libraries or Applications
|
|
|
|
|
|
-1.2.1. Kamailio Modules
|
|
|
+2.1. Kamailio Modules
|
|
|
|
|
|
The following 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:
|
|
|
* None.
|
|
|
|
|
|
-1.3. Exported Parameters
|
|
|
+3. Exported Parameters
|
|
|
|
|
|
-1.3.1. mqueue (string)
|
|
|
+ 3.1. mqueue (string)
|
|
|
+
|
|
|
+3.1. mqueue (string)
|
|
|
|
|
|
Definition of memory queue
|
|
|
|
|
@@ -87,9 +110,13 @@ modparam("mqueue", "mqueue", "name=myq;size=20;")
|
|
|
modparam("mqueue", "mqueue", "name=qaz")
|
|
|
...
|
|
|
|
|
|
-1.4. Exported Functions
|
|
|
+4. Exported Functions
|
|
|
+
|
|
|
+ 4.1. mq_add(queue, key, value)
|
|
|
+ 4.2. mq_fetch(queue)
|
|
|
+ 4.3. mq_pv_free(queue)
|
|
|
|
|
|
-1.4.1. mq_add(queue, key, value)
|
|
|
+4.1. mq_add(queue, key, value)
|
|
|
|
|
|
Add a new item (key, value) in the queue. If max size of queue is
|
|
|
exceeded, the oldest one is removed.
|
|
@@ -99,20 +126,20 @@ modparam("mqueue", "mqueue", "name=qaz")
|
|
|
mq_add("myq", "$rU", "call from $fU");
|
|
|
...
|
|
|
|
|
|
-1.4.2. mq_fetch(queue)
|
|
|
+4.2. mq_fetch(queue)
|
|
|
|
|
|
Take oldest item from que and fill $mqk(queue) and $mqv(queue) pseudo
|
|
|
variables. Return true on success.
|
|
|
|
|
|
Example 1.3. mq_fetch usage
|
|
|
...
|
|
|
-while(mq_add("myq"))
|
|
|
+while(mq_fetch("myq"))
|
|
|
{
|
|
|
xlog("$mqk(myq) - $mqv(myq)\n");
|
|
|
}
|
|
|
...
|
|
|
|
|
|
-1.4.3. mq_pv(queue)
|
|
|
+4.3. mq_pv_free(queue)
|
|
|
|
|
|
Free the item fetched in pseudo-variables. It is optional, a new fetch
|
|
|
frees the old values.
|