|
@@ -10,7 +10,7 @@ Emmanuel Schmidbauer
|
|
|
|
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright © 2016 Weave Communications
|
|
|
+ Copyright © 2016 Weave Communications
|
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
@@ -30,31 +30,24 @@ Emmanuel Schmidbauer
|
|
|
|
|
|
4. Parameters
|
|
|
|
|
|
- 4.1. NSQ related
|
|
|
-
|
|
|
- 4.1.1. lookupd_address(str)
|
|
|
- 4.1.2. lookupd_port(int)
|
|
|
- 4.1.3. nsqd_address(str)
|
|
|
- 4.1.4. nsqd_port(int)
|
|
|
- 4.1.5. consumer_use_nsqd(int)
|
|
|
- 4.1.6. consumer_event_key(str)
|
|
|
- 4.1.7. consumer_event_sub_key(str)
|
|
|
- 4.1.8. max_in_flight(int)
|
|
|
- 4.1.9. consumer_workers(int)
|
|
|
- 4.1.10. topic_channel(str)
|
|
|
-
|
|
|
- 4.2. Presence Related
|
|
|
-
|
|
|
- 4.2.1. db_url(str)
|
|
|
- 4.2.2. presentity_table(str)
|
|
|
+ 4.1. lookupd_address(str)
|
|
|
+ 4.2. lookupd_port(int)
|
|
|
+ 4.3. nsqd_address(str)
|
|
|
+ 4.4. nsqd_port(int)
|
|
|
+ 4.5. consumer_use_nsqd(int)
|
|
|
+ 4.6. consumer_event_key(str)
|
|
|
+ 4.7. consumer_event_sub_key(str)
|
|
|
+ 4.8. max_in_flight(int)
|
|
|
+ 4.9. consumer_workers(int)
|
|
|
+ 4.10. topic_channel(str)
|
|
|
+ 4.11. db_url(str)
|
|
|
+ 4.12. presentity_table(str)
|
|
|
|
|
|
5. Functions
|
|
|
|
|
|
- 5.1. Presence Pelated
|
|
|
-
|
|
|
- 5.1.1. nsq_pua_publish(json_payload)
|
|
|
+ 5.1. nsq_pua_publish(json_payload)
|
|
|
|
|
|
- 6. Exported pseudo-variables
|
|
|
+ 6. Pseudo Variables
|
|
|
7. Transformations
|
|
|
|
|
|
List of Examples
|
|
@@ -92,31 +85,24 @@ Chapter 1. Admin Guide
|
|
|
|
|
|
4. Parameters
|
|
|
|
|
|
- 4.1. NSQ related
|
|
|
-
|
|
|
- 4.1.1. lookupd_address(str)
|
|
|
- 4.1.2. lookupd_port(int)
|
|
|
- 4.1.3. nsqd_address(str)
|
|
|
- 4.1.4. nsqd_port(int)
|
|
|
- 4.1.5. consumer_use_nsqd(int)
|
|
|
- 4.1.6. consumer_event_key(str)
|
|
|
- 4.1.7. consumer_event_sub_key(str)
|
|
|
- 4.1.8. max_in_flight(int)
|
|
|
- 4.1.9. consumer_workers(int)
|
|
|
- 4.1.10. topic_channel(str)
|
|
|
-
|
|
|
- 4.2. Presence Related
|
|
|
-
|
|
|
- 4.2.1. db_url(str)
|
|
|
- 4.2.2. presentity_table(str)
|
|
|
+ 4.1. lookupd_address(str)
|
|
|
+ 4.2. lookupd_port(int)
|
|
|
+ 4.3. nsqd_address(str)
|
|
|
+ 4.4. nsqd_port(int)
|
|
|
+ 4.5. consumer_use_nsqd(int)
|
|
|
+ 4.6. consumer_event_key(str)
|
|
|
+ 4.7. consumer_event_sub_key(str)
|
|
|
+ 4.8. max_in_flight(int)
|
|
|
+ 4.9. consumer_workers(int)
|
|
|
+ 4.10. topic_channel(str)
|
|
|
+ 4.11. db_url(str)
|
|
|
+ 4.12. presentity_table(str)
|
|
|
|
|
|
5. Functions
|
|
|
|
|
|
- 5.1. Presence Pelated
|
|
|
+ 5.1. nsq_pua_publish(json_payload)
|
|
|
|
|
|
- 5.1.1. nsq_pua_publish(json_payload)
|
|
|
-
|
|
|
- 6. Exported pseudo-variables
|
|
|
+ 6. Pseudo Variables
|
|
|
7. Transformations
|
|
|
|
|
|
1. Overview
|
|
@@ -232,30 +218,25 @@ event_route[nsq:consumer-event]
|
|
|
|
|
|
4. Parameters
|
|
|
|
|
|
- 4.1. NSQ related
|
|
|
-
|
|
|
- 4.1.1. lookupd_address(str)
|
|
|
- 4.1.2. lookupd_port(int)
|
|
|
- 4.1.3. nsqd_address(str)
|
|
|
- 4.1.4. nsqd_port(int)
|
|
|
- 4.1.5. consumer_use_nsqd(int)
|
|
|
- 4.1.6. consumer_event_key(str)
|
|
|
- 4.1.7. consumer_event_sub_key(str)
|
|
|
- 4.1.8. max_in_flight(int)
|
|
|
- 4.1.9. consumer_workers(int)
|
|
|
- 4.1.10. topic_channel(str)
|
|
|
-
|
|
|
- 4.2. Presence Related
|
|
|
-
|
|
|
- 4.2.1. db_url(str)
|
|
|
- 4.2.2. presentity_table(str)
|
|
|
-
|
|
|
-4.1. NSQ related
|
|
|
-
|
|
|
-4.1.1. lookupd_address(str)
|
|
|
+ 4.1. lookupd_address(str)
|
|
|
+ 4.2. lookupd_port(int)
|
|
|
+ 4.3. nsqd_address(str)
|
|
|
+ 4.4. nsqd_port(int)
|
|
|
+ 4.5. consumer_use_nsqd(int)
|
|
|
+ 4.6. consumer_event_key(str)
|
|
|
+ 4.7. consumer_event_sub_key(str)
|
|
|
+ 4.8. max_in_flight(int)
|
|
|
+ 4.9. consumer_workers(int)
|
|
|
+ 4.10. topic_channel(str)
|
|
|
+ 4.11. db_url(str)
|
|
|
+ 4.12. presentity_table(str)
|
|
|
+
|
|
|
+4.1. lookupd_address(str)
|
|
|
|
|
|
The nsqlookupd address.
|
|
|
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
Default value is 127.0.0.1
|
|
|
|
|
|
Example 1.2. Set lookupd_address parameter
|
|
@@ -263,10 +244,12 @@ event_route[nsq:consumer-event]
|
|
|
modparam("nsq", "lookupd_address", "nsqlookupd.mydomain.com")
|
|
|
...
|
|
|
|
|
|
-4.1.2. lookupd_port(int)
|
|
|
+4.2. lookupd_port(int)
|
|
|
|
|
|
The nsqlookupd TCP port.
|
|
|
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
Default value is 4161.
|
|
|
|
|
|
Example 1.3. Set lookupd_port parameter
|
|
@@ -274,11 +257,13 @@ modparam("nsq", "lookupd_address", "nsqlookupd.mydomain.com")
|
|
|
modparam("nsq", "lookupd_port", 4161)
|
|
|
...
|
|
|
|
|
|
-4.1.3. nsqd_address(str)
|
|
|
+4.3. nsqd_address(str)
|
|
|
|
|
|
The nsqd address. You can specify connecting directly to nsqd instead
|
|
|
of using nsqlookupd.
|
|
|
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
Default value is 127.0.0.1
|
|
|
|
|
|
Example 1.4. Set nsqd_address parameter
|
|
@@ -286,10 +271,12 @@ modparam("nsq", "lookupd_port", 4161)
|
|
|
modparam("nsq", "nsqd_address", "nsqd.mydomain.com")
|
|
|
...
|
|
|
|
|
|
-4.1.4. nsqd_port(int)
|
|
|
+4.4. nsqd_port(int)
|
|
|
|
|
|
The nsqd TCP port.
|
|
|
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
Default value is 4150.
|
|
|
|
|
|
Example 1.5. Set nsqd_port parameter
|
|
@@ -297,10 +284,12 @@ modparam("nsq", "nsqd_address", "nsqd.mydomain.com")
|
|
|
modparam("nsq", "nsqd_port", 4150)
|
|
|
...
|
|
|
|
|
|
-4.1.5. consumer_use_nsqd(int)
|
|
|
+4.5. consumer_use_nsqd(int)
|
|
|
|
|
|
Set to 1 if you'd like to connect to nsqd instead of nsqlookupd.
|
|
|
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
Default value is 0.
|
|
|
|
|
|
Example 1.6. Set consumer_use_nsqd parameter
|
|
@@ -308,35 +297,41 @@ modparam("nsq", "nsqd_port", 4150)
|
|
|
modparam("nsq", "consumer_use_nsqd", 1)
|
|
|
...
|
|
|
|
|
|
-4.1.6. consumer_event_key(str)
|
|
|
+4.6. consumer_event_key(str)
|
|
|
|
|
|
The default name of the field in json payload to compose the event name
|
|
|
1st part
|
|
|
|
|
|
- Default value is “Event-Category�.
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
+ Default value is "Event-Category".
|
|
|
|
|
|
Example 1.7. Set consumer_event_key parameter
|
|
|
...
|
|
|
modparam("nsq", "consumer_event_key", "My-JSON-Field-Name")
|
|
|
...
|
|
|
|
|
|
-4.1.7. consumer_event_sub_key(str)
|
|
|
+4.7. consumer_event_sub_key(str)
|
|
|
|
|
|
The default name of the field in json payload to compose the event name
|
|
|
2nd part
|
|
|
|
|
|
- Default value is “Event-Name�.
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
+ Default value is "Event-Name".
|
|
|
|
|
|
Example 1.8. Set consumer_event_sub_key parameter
|
|
|
...
|
|
|
modparam("nsq", "consumer_event_sub_key", "My-JSON-SubField-Name")
|
|
|
...
|
|
|
|
|
|
-4.1.8. max_in_flight(int)
|
|
|
+4.8. max_in_flight(int)
|
|
|
|
|
|
The number of messages the consumer can receive before nsqd expects a
|
|
|
response.
|
|
|
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
Default value is 1.
|
|
|
|
|
|
Example 1.9. Set max_in_flight parameter
|
|
@@ -344,10 +339,12 @@ modparam("nsq", "consumer_event_sub_key", "My-JSON-SubField-Name")
|
|
|
modparam("nsq", "max_in_flight", 2)
|
|
|
...
|
|
|
|
|
|
-4.1.9. consumer_workers(int)
|
|
|
+4.9. consumer_workers(int)
|
|
|
|
|
|
Number of consumer connections to NSQ per topic_channel.
|
|
|
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
Default value is 4.
|
|
|
|
|
|
Example 1.10. Set consumer_workers parameter
|
|
@@ -355,13 +352,15 @@ modparam("nsq", "max_in_flight", 2)
|
|
|
modparam("nsq", "consumer_workers", 2)
|
|
|
...
|
|
|
|
|
|
-4.1.10. topic_channel(str)
|
|
|
+4.10. topic_channel(str)
|
|
|
|
|
|
- The NSQ Topic and Channel. Delimiter-separated by “:�. It be set
|
|
|
+ The NSQ Topic and Channel. Delimiter-separated by ":". It be set
|
|
|
multiple times to subscribe to multiple topics and channels. The value
|
|
|
of consumer_workers is allocated per topic_channel.
|
|
|
|
|
|
- Default value is “Kamailio-Topic:Kamailio-Channel�.
|
|
|
+ Usage: nsq related.
|
|
|
+
|
|
|
+ Default value is "Kamailio-Topic:Kamailio-Channel".
|
|
|
|
|
|
Example 1.11. Set topic_channel parameter
|
|
|
...
|
|
@@ -369,27 +368,27 @@ modparam("nsq", "topic_channel", "My-NSQ-Topic:My-NSQ-Channel")
|
|
|
modparam("nsq", "topic_channel", "My-NSQ-Topic-2:My-NSQ-Channel-2")
|
|
|
...
|
|
|
|
|
|
-4.2. Presence Related
|
|
|
-
|
|
|
-4.2.1. db_url(str)
|
|
|
+4.11. db_url(str)
|
|
|
|
|
|
The database for the presentity table.
|
|
|
|
|
|
If set, the nsq_pua_publish function will update the presentity status
|
|
|
in the database.
|
|
|
|
|
|
- Default value is “NULL�.
|
|
|
+ Usage: presence related.
|
|
|
+
|
|
|
+ Default value is "NULL".
|
|
|
|
|
|
Example 1.12. Set db_url parameter
|
|
|
...
|
|
|
modparam("nsq", "db_url", "mysql://kamailio:kamailiorw@localhost/kamailio")
|
|
|
...
|
|
|
|
|
|
-4.2.2. presentity_table(str)
|
|
|
+4.12. presentity_table(str)
|
|
|
|
|
|
The name of the presentity table in the database.
|
|
|
|
|
|
- Default value is “presentity�.
|
|
|
+ Default value is "presentity".
|
|
|
|
|
|
Example 1.13. Set presentity_table parameter
|
|
|
...
|
|
@@ -398,17 +397,15 @@ modparam("nsq", "presentity_table", "my_presentity_table")
|
|
|
|
|
|
5. Functions
|
|
|
|
|
|
- 5.1. Presence Pelated
|
|
|
+ 5.1. nsq_pua_publish(json_payload)
|
|
|
|
|
|
- 5.1.1. nsq_pua_publish(json_payload)
|
|
|
-
|
|
|
-5.1. Presence Pelated
|
|
|
-
|
|
|
-5.1.1. nsq_pua_publish(json_payload)
|
|
|
+5.1. nsq_pua_publish(json_payload)
|
|
|
|
|
|
The function build presentity state from json_payload and updates
|
|
|
presentity table.
|
|
|
|
|
|
+ Usage: presence related.
|
|
|
+
|
|
|
This function can be used from ANY ROUTE.
|
|
|
|
|
|
Example 1.14. nsq_pua_publish usage
|
|
@@ -423,7 +420,7 @@ ackage})", 1);
|
|
|
}
|
|
|
...
|
|
|
|
|
|
-6. Exported pseudo-variables
|
|
|
+6. Pseudo Variables
|
|
|
|
|
|
* $nsqE Contains the payload of a consumed message
|
|
|
|