Browse code

kazoo: Allow optional AMQP-headers in kazoo_query and kazoo_publish - implements GH #2895

mihovilkolaric authored on 09/11/2021 22:25:02 • Henning Westerholt committed on 19/11/2021 11:43:16
Showing 1 changed files
... ...
@@ -560,10 +560,10 @@ modparam("kazoo", "pua_mode", 0)
560 560
 			<section>
561 561
 				<title>
562 562
 					<function moreinfo="none">kazoo_publish(exchange, routing_key,
563
-						json_payload)</function>
563
+						json_payload [, amqp_headers])</function>
564 564
 				</title>
565 565
 				<para>The function publishes a json payload to rabbitmq. The routing_key parameter
566
-					should be encoded.</para>
566
+					should be encoded. Optional AMQP-Headers are specified in the format key1=value1;key2=value2</para>
567 567
 				<para>This function can be used from ANY ROUTE.</para>
568 568
 
569 569
 				<example>
... ...
@@ -581,12 +581,12 @@ kazoo_publish("callmgr", $var(amqp_routing_key), $var(amqp_payload_request));
581 581
 			<section>
582 582
 				<title>
583 583
 					<function moreinfo="none">kazoo_query(exchange, routing_key, json_payload [,
584
-						target_var])</function>
584
+						target_var] [, amqp_headers])</function>
585 585
 				</title>
586 586
 				<para>The function publishes a json payload to rabbitmq, waits for a correlated
587 587
 					messageand puts the result in target_var. The routing_key parameter should be
588 588
 					encoded. target_var is optional as the function also puts the result in
589
-					pseudo-variable $kzR.</para>
589
+					pseudo-variable $kzR. Optional AMQP-Headers are specified in the format key1=value1;key2=value2</para>
590 590
 				<para>This function can be used from ANY ROUTE.</para>
591 591
 
592 592
 				<example>
Browse code

kazoo: docbook files space formating

for formating used oXygen XML Editor 13.2

Sergey Safarov authored on 16/09/2021 08:01:23 • Daniel-Constantin Mierla committed on 21/09/2021 18:56:55
Showing 1 changed files
... ...
@@ -14,79 +14,65 @@
14 14
 
15 15
 <chapter xmlns:xi="http://www.w3.org/2001/XInclude">
16 16
 	<title>&adminguide;</title>
17
+	<section>
18
+		<title>Overview</title>
19
+		<para>The Kazoo is a general purpose AMQP connector (tested with rabbitmq-server). It
20
+			exposes publish/consume capabilities into Kamailio.</para>
21
+		<para>From a high-level, the purpose of the module might be for things like: <itemizedlist>
22
+				<listitem>
23
+					<para>Integrate to an AMQP application to make real-time routing decisions
24
+						(instead of using, say, a SQL database)</para>
25
+				</listitem>
26
+				<listitem>
27
+					<para>Provide a real-time integration into your program, instead of your
28
+						database, so you can overlay additional logic in your preferred language
29
+						while also utilizing a message bus</para>
30
+				</listitem>
31
+				<listitem>
32
+					<para>Utilize messaging to have a distributed messaging layer, such that
33
+						machines processing requests/responses/events can go up/down or share the
34
+						workload and your Kamailio node will still be happy</para>
35
+				</listitem>
36
+			</itemizedlist>
37
+		</para>
38
+
17 39
 
18
-    
19
-    <section>
20
-    <title>Overview</title>
21
-    <para> The Kazoo is a general purpose AMQP connector (tested with rabbitmq-server). It exposes publish/consume capabilities into Kamailio.
22
-    </para>
23
-<para>
24
-From a high-level, the purpose of the module might be for things like:
25
-<itemizedlist>
26
-<listitem>
27
-<para>
28
-Integrate to an AMQP application to make real-time routing decisions (instead of using, say, a SQL database)
29
-</para>
30
-</listitem>
31
-<listitem>
32
-<para>
33
-Provide a real-time integration into your program, instead of your database, so you can overlay additional logic in your preferred language while also utilizing a message bus
34
-</para>
35
-</listitem>
36
-<listitem>
37
-<para>
38
-Utilize messaging to have a distributed messaging layer, such that machines processing requests/responses/events can go up/down or share the workload and your Kamailio node will still be happy
39
-</para>
40
-</listitem>
41
-</itemizedlist>
42
-</para>
43
-
44
-
45
-<para>
46
-supported operations are:
47
-<itemizedlist>
48
-<listitem>
49
-<para>
50
-publish json payloads to rabbitmq
51
-</para>
52
-</listitem>
53
-<listitem>
54
-<para>
55
-publish json payloads to rabbitmq and wait for correlated response message
56
-</para>
57
-</listitem>
58
-<listitem>
59
-<para>
60
-subscribe to an exchange with a routing key
61
-</para>
62
-</listitem>
63
-</itemizedlist>
64
-</para>
65
-<para>
66
-The Kazoo module also has support to publish updates to presence module thru the kazoo_pua_publish function
67
-</para>
68
-
69
-</section>
70
-    <section>
71
-    <title>How it works</title>
72
-<para>  
73
-The module works with a main forked process that does the communication with rabbitmq for issuing publishes, waiting for replies and consuming messages. When it consumes a message it defers the process to a worker process so that it doesn't block this main process.
74
-</para>
75
-    <section>
76
-    <title>event routes</title>
77
-    <para>
78
-The worker process issues an event-route where we can act on the received payload. The name of the event-route is composed by values extracted from the payload.
79
-    </para>
80
-    <para>
81
-    Kazoo module will try to execute the event route from most significant to less significant. 
82
-    define the event route like event_route[kazoo:consumer-event[-payload_key_value[-payload_subkey_value]]]
83
-    </para>
84
-    <para>
85
-    we can set the key/subkey pair on a subscription base. check the payload on subscribe.
86
-    </para>
87
-        <example>
88
-        <title>define the event route</title>
89
-        <programlisting format="linespecific">
40
+		<para>supported operations are: <itemizedlist>
41
+				<listitem>
42
+					<para>publish json payloads to rabbitmq</para>
43
+				</listitem>
44
+				<listitem>
45
+					<para>publish json payloads to rabbitmq and wait for correlated response
46
+						message</para>
47
+				</listitem>
48
+				<listitem>
49
+					<para>subscribe to an exchange with a routing key</para>
50
+				</listitem>
51
+			</itemizedlist>
52
+		</para>
53
+		<para>The Kazoo module also has support to publish updates to presence module thru the
54
+			kazoo_pua_publish function</para>
55
+
56
+	</section>
57
+	<section>
58
+		<title>How it works</title>
59
+		<para>The module works with a main forked process that does the communication with rabbitmq
60
+			for issuing publishes, waiting for replies and consuming messages. When it consumes a
61
+			message it defers the process to a worker process so that it doesn't block this main
62
+			process.</para>
63
+		<section>
64
+			<title>event routes</title>
65
+			<para>The worker process issues an event-route where we can act on the received
66
+				payload. The name of the event-route is composed by values extracted from the
67
+				payload.</para>
68
+			<para>Kazoo module will try to execute the event route from most significant to less
69
+				significant. define the event route like
70
+				event_route[kazoo:consumer-event[-payload_key_value[-payload_subkey_value]]]</para>
71
+			<para>we can set the key/subkey pair on a subscription base. check the payload on
72
+				subscribe.</para>
73
+			<example>
74
+				<title>define the event route</title>
75
+				<programlisting format="linespecific">
90 76
 ...
91 77
 modparam("kazoo", "amqp_consumer_event_key", "Event-Category")
92 78
 modparam("kazoo", "amqp_consumer_event_subkey", "Event-Name")
... ...
@@ -128,402 +114,367 @@ event_route[kazoo:consumer-event]
128 114
 }
129 115
 
130 116
 </programlisting>
131
-        </example>
132
-</section>
133
-    <section>
134
-    <title>acknowledge messages</title>
135
-<para>
136
-Consumed messages have the option of being acknowledge in two ways:
137
-<itemizedlist>
138
-<listitem>
139
-<para>
140
-immediately when received 
141
-</para>
142
-</listitem>
143
-<listitem>
144
-<para>
145
-after processing by the worker 
146
-</para>
147
-</listitem>
148
-</itemizedlist>
149
-
150
-    </para>
151
-    
152
-</section>
153
-    </section>
154
-
155
-    <section>
156
-    <title>Dependencies</title>
157
-    <section>
158
-        <title>&kamailio; Modules</title>
159
-        <para>
160
-        The following modules must be loaded before this module:
161
-            <itemizedlist>
162
-            <listitem>
163
-            <para>
164
-                <emphasis>none</emphasis>.
165
-            </para>
166
-            </listitem>
167
-            </itemizedlist>
168
-        </para>
169
-    </section>
170
-    <section>
171
-        <title>External Libraries or Applications</title>
172
-        <itemizedlist>
173
-            <listitem>
174
-            <para>
175
-                <emphasis>librabbitmq</emphasis>.
176
-            </para>
177
-            </listitem>
178
-            <listitem>
179
-            <para>
180
-                <emphasis>libjson</emphasis>.
181
-            </para>
182
-            </listitem>
183
-            <listitem>
184
-            <para>
185
-                <emphasis>libuuid</emphasis>.
186
-            </para>
187
-            </listitem>
188
-        </itemizedlist>
189
-
190
-        </section>
191
-    </section>
192
-    
193
-    
194
-    <section>
195
-    <title>Parameters</title>
196
-    <section>
197
-    <title>amqp related</title>
198
-    <section>
199
-        <title><varname>node_hostname</varname>(str)</title>
200
-        <para>
201
-        The name of this host to register in rabbitmq.
202
-        </para>
203
-        <para>
204
-        <emphasis>Default value is NULL. you must set this parameter value for the module to work</emphasis>
205
-        </para>
206
-        <example>
207
-        <title>Set <varname>node_hostname</varname> parameter</title>
208
-        <programlisting format="linespecific">
117
+			</example>
118
+		</section>
119
+		<section>
120
+			<title>acknowledge messages</title>
121
+			<para>Consumed messages have the option of being acknowledge in two ways: <itemizedlist>
122
+					<listitem>
123
+						<para>immediately when received</para>
124
+					</listitem>
125
+					<listitem>
126
+						<para>after processing by the worker</para>
127
+					</listitem>
128
+				</itemizedlist>
129
+			</para>
130
+
131
+		</section>
132
+	</section>
133
+
134
+	<section>
135
+		<title>Dependencies</title>
136
+		<section>
137
+			<title>&kamailio; Modules</title>
138
+			<para>The following modules must be loaded before this module: <itemizedlist>
139
+					<listitem>
140
+						<para>
141
+							<emphasis>none</emphasis>.</para>
142
+					</listitem>
143
+				</itemizedlist>
144
+			</para>
145
+		</section>
146
+		<section>
147
+			<title>External Libraries or Applications</title>
148
+			<itemizedlist>
149
+				<listitem>
150
+					<para>
151
+						<emphasis>librabbitmq</emphasis>.</para>
152
+				</listitem>
153
+				<listitem>
154
+					<para>
155
+						<emphasis>libjson</emphasis>.</para>
156
+				</listitem>
157
+				<listitem>
158
+					<para>
159
+						<emphasis>libuuid</emphasis>.</para>
160
+				</listitem>
161
+			</itemizedlist>
162
+
163
+		</section>
164
+	</section>
165
+
166
+
167
+	<section>
168
+		<title>Parameters</title>
169
+		<section>
170
+			<title>amqp related</title>
171
+			<section>
172
+				<title><varname>node_hostname</varname>(str)</title>
173
+				<para>The name of this host to register in rabbitmq.</para>
174
+				<para>
175
+					<emphasis>Default value is NULL. you must set this parameter value for the
176
+						module to work</emphasis>
177
+				</para>
178
+				<example>
179
+					<title>Set <varname>node_hostname</varname> parameter</title>
180
+					<programlisting format="linespecific">
209 181
 ...
210 182
 modparam("kazoo", "node_hostname", "sipproxy.mydomain.com")
211 183
 ...
212 184
 </programlisting>
213
-        </example>
214
-    </section>
215
-    <section>
216
-        <title><varname>amqp_consumer_processes</varname>(int)</title>
217
-        <para>
218
-        The number of worker processes to handle messages consumption.
219
-        </para>
220
-        <para>
221
-        <emphasis>Default value is 4.</emphasis>
222
-        </para>
223
-        <example>
224
-        <title>Set <varname>amqp_consumer_processes</varname> parameter</title>
225
-        <programlisting format="linespecific">
185
+				</example>
186
+			</section>
187
+			<section>
188
+				<title><varname>amqp_consumer_processes</varname>(int)</title>
189
+				<para>The number of worker processes to handle messages consumption.</para>
190
+				<para>
191
+					<emphasis>Default value is 4.</emphasis>
192
+				</para>
193
+				<example>
194
+					<title>Set <varname>amqp_consumer_processes</varname> parameter</title>
195
+					<programlisting format="linespecific">
226 196
 ...
227 197
 modparam("kazoo", "amqp_consumer_processes", 10)
228 198
 ...
229 199
 </programlisting>
230
-        </example>
231
-    </section>
232
-
233
-    <section>
234
-        <title><varname>amqp_consumer_event_key</varname>(str)</title>
235
-        <para>
236
-        The default name of the field in json payload to compose the event name 1st part
237
-        </para>
238
-        <para>
239
-        <emphasis>Default value is <quote>Event-Category</quote>.</emphasis>
240
-        </para>
241
-        <example>
242
-        <title>Set <varname>amqp_consumer_event_key</varname> parameter</title>
243
-        <programlisting format="linespecific">
200
+				</example>
201
+			</section>
202
+
203
+			<section>
204
+				<title><varname>amqp_consumer_event_key</varname>(str)</title>
205
+				<para>The default name of the field in json payload to compose the event name 1st
206
+					part</para>
207
+				<para>
208
+					<emphasis>Default value is <quote>Event-Category</quote>.</emphasis>
209
+				</para>
210
+				<example>
211
+					<title>Set <varname>amqp_consumer_event_key</varname> parameter</title>
212
+					<programlisting format="linespecific">
244 213
 ...
245 214
 modparam("kazoo", "amqp_consumer_event_key", "My-JSON-Field-Name")
246 215
 ...
247 216
 </programlisting>
248
-        </example>
249
-    </section>
250
-
251
-    <section>
252
-        <title><varname>amqp_consumer_event_subkey</varname>(str)</title>
253
-        <para>
254
-        The default name of the field in json payload to compose the event name 2nd part
255
-        </para>
256
-        <para>
257
-        <emphasis>Default value is <quote>Event-Name</quote>.</emphasis>
258
-        </para>
259
-        <example>
260
-        <title>Set <varname>amqp_consumer_event_subkey</varname> parameter</title>
261
-        <programlisting format="linespecific">
217
+				</example>
218
+			</section>
219
+
220
+			<section>
221
+				<title><varname>amqp_consumer_event_subkey</varname>(str)</title>
222
+				<para>The default name of the field in json payload to compose the event name 2nd
223
+					part</para>
224
+				<para>
225
+					<emphasis>Default value is <quote>Event-Name</quote>.</emphasis>
226
+				</para>
227
+				<example>
228
+					<title>Set <varname>amqp_consumer_event_subkey</varname> parameter</title>
229
+					<programlisting format="linespecific">
262 230
 ...
263 231
 modparam("kazoo", "amqp_consumer_event_subkey", "My-JSON-SubField-Name")
264 232
 ...
265 233
 </programlisting>
266
-        </example>
267
-    </section>
268
-
269
-    <section>
270
-        <title><varname>amqp_max_channels</varname>(str)</title>
271
-        <para>
272
-        The number of pre allocated channels for the connection.
273
-        </para>
274
-        <para>
275
-        <emphasis>Default value is 50.</emphasis>
276
-        </para>
277
-        <example>
278
-        <title>Set <varname>amqp_max_channels</varname> parameter</title>
279
-        <programlisting format="linespecific">
234
+				</example>
235
+			</section>
236
+
237
+			<section>
238
+				<title><varname>amqp_max_channels</varname>(str)</title>
239
+				<para>The number of pre allocated channels for the connection.</para>
240
+				<para>
241
+					<emphasis>Default value is 50.</emphasis>
242
+				</para>
243
+				<example>
244
+					<title>Set <varname>amqp_max_channels</varname> parameter</title>
245
+					<programlisting format="linespecific">
280 246
 ...
281 247
 modparam("kazoo", "amqp_max_channels", 100)
282 248
 ...
283 249
 </programlisting>
284
-        </example>
285
-    </section>
286
-
287
-    <section>
288
-        <title><varname>amqp_connection</varname>(str)</title>
289
-        <para>
290
-        The connection url to rabbitmq. can be set multiple times for failover.
291
-        </para>
292
-        <example>
293
-        <title>Set <varname>amqp_connection</varname> parameter</title>
294
-        <programlisting format="linespecific">
250
+				</example>
251
+			</section>
252
+
253
+			<section>
254
+				<title><varname>amqp_connection</varname>(str)</title>
255
+				<para>The connection url to rabbitmq. can be set multiple times for failover.</para>
256
+				<example>
257
+					<title>Set <varname>amqp_connection</varname> parameter</title>
258
+					<programlisting format="linespecific">
295 259
 ...
296 260
 modparam("kazoo", "amqp_connection", "amqp://guest:guest@localhost:5672")
297 261
 modparam("kazoo", "amqp_connection", "kazoo://guest:guest@otherhost:5672")
298 262
 ...
299 263
 </programlisting>
300
-        </example>
301
-    </section>
302
-
303
-<section>
304
-  <title><varname>event_callback</varname>(str)</title>
305
-    <para>
306
-        The name of the function in the kemi configuration file (embedded
307
-        scripting language such as Lua, Python, ...) to be executed instead
308
-        of event_route[...] blocks.
309
-    </para>
310
-    <para>
311
-        The function receives a string parameter with the name of the event,
312
-        the values can be: 'kazoo:mod-init', 'kazoo:consumer-event'.
313
-    </para>
314
-
315
-  <example>
316
-    <title>Set <varname>event_callback</varname> parameter</title>
317
-    <programlisting format="linespecific">
264
+				</example>
265
+			</section>
266
+
267
+			<section>
268
+				<title><varname>event_callback</varname>(str)</title>
269
+				<para>The name of the function in the kemi configuration file (embedded scripting
270
+					language such as Lua, Python, ...) to be executed instead of event_route[...]
271
+					blocks.</para>
272
+				<para>The function receives a string parameter with the name of the event, the
273
+					values can be: 'kazoo:mod-init', 'kazoo:consumer-event'.</para>
274
+
275
+				<example>
276
+					<title>Set <varname>event_callback</varname> parameter</title>
277
+					<programlisting format="linespecific">
318 278
     ...
319 279
     modparam("kazoo", "event_callback", "ksr_kazoo_event")
320 280
     ...
321 281
     </programlisting>
322
-  </example>
323
-</section>
282
+				</example>
283
+			</section>
284
+
285
+
324 286
 
325
-    
326 287
 
327
-    
328 288
 
329 289
 
330
-    </section>
290
+		</section>
331 291
 
332
-    <section>
333
-    <title>execution control</title>
334
-    <para>execution control of main loop can be controlled by changing the parameter values in this section.</para>
335
-    <para>The main loop has 3 sub-loops were it listen for actions to execute with a timeout. These group of parameters allow to set the maximum number of times the sub-loop is executed if it doesn't timeout.</para>
336
-    <para>On busy systems, we may have a condition where a sub-loop never times out because it always has data to process. The purpose of these parameters is to set a maximum number of times it executes before it handles control to the next sub-loop.</para>
337
-        <programlisting format="linespecific">
292
+		<section>
293
+			<title>execution control</title>
294
+			<para>execution control of main loop can be controlled by changing the parameter values
295
+				in this section.</para>
296
+			<para>The main loop has 3 sub-loops were it listen for actions to execute with a
297
+				timeout. These group of parameters allow to set the maximum number of times the
298
+				sub-loop is executed if it doesn't timeout.</para>
299
+			<para>On busy systems, we may have a condition where a sub-loop never times out because
300
+				it always has data to process. The purpose of these parameters is to set a maximum
301
+				number of times it executes before it handles control to the next sub-loop.</para>
302
+			<programlisting format="linespecific">
338 303
 ...
339 304
 while(true) // main  loop
340
- while(ACK or timeout)  // acknowledge from worker process
341
- while(SEND or timeout) // anything to send ?
342
- while(CONSUME or timeout) // any data on consumed exchanges ?
305
+while(ACK or timeout)  // acknowledge from worker process
306
+while(SEND or timeout) // anything to send ?
307
+while(CONSUME or timeout) // any data on consumed exchanges ?
343 308
 ...
344 309
 </programlisting>
345 310
 
346
-    <section>
347
-        <title><varname>amqp_consumer_loop_count</varname>(int)</title>
348
-        <para>
349
-        The consumer loop count.
350
-        </para>
351
-        <para>
352
-        <emphasis>Default value is 10.</emphasis>
353
-        </para>
354
-        <example>
355
-        <title>Set <varname>amqp_consumer_loop_count</varname> parameter</title>
356
-        <programlisting format="linespecific">
311
+			<section>
312
+				<title><varname>amqp_consumer_loop_count</varname>(int)</title>
313
+				<para>The consumer loop count.</para>
314
+				<para>
315
+					<emphasis>Default value is 10.</emphasis>
316
+				</para>
317
+				<example>
318
+					<title>Set <varname>amqp_consumer_loop_count</varname> parameter</title>
319
+					<programlisting format="linespecific">
357 320
 ...
358 321
 modparam("kazoo", "amqp_consumer_loop_count", 3)
359 322
 ...
360 323
 </programlisting>
361
-        </example>
362
-    </section>    
363
-    
364
-    <section>
365
-        <title><varname>amqp_internal_loop_count</varname>(int)</title>
366
-        <para>
367
-        The internal listen for commands loop count.
368
-        </para>
369
-        <para>
370
-        <emphasis>Default value is 5.</emphasis>
371
-        </para>
372
-        <example>
373
-        <title>Set <varname>amqp_internal_loop_count</varname> parameter</title>
374
-        <programlisting format="linespecific">
324
+				</example>
325
+			</section>
326
+
327
+			<section>
328
+				<title><varname>amqp_internal_loop_count</varname>(int)</title>
329
+				<para>The internal listen for commands loop count.</para>
330
+				<para>
331
+					<emphasis>Default value is 5.</emphasis>
332
+				</para>
333
+				<example>
334
+					<title>Set <varname>amqp_internal_loop_count</varname> parameter</title>
335
+					<programlisting format="linespecific">
375 336
 ...
376 337
 modparam("kazoo", "amqp_internal_loop_count", 1)
377 338
 ...
378 339
 </programlisting>
379
-        </example>
380
-    </section>    
381
-    
382
-    <section>
383
-        <title><varname>amqp_consumer_ack_loop_count</varname>(int)</title>
384
-        <para>
385
-        The work ack loop count.
386
-        </para>
387
-        <para>
388
-        <emphasis>Default value is 20.</emphasis>
389
-        </para>
390
-        <example>
391
-        <title>Set <varname>amqp_consumer_ack_loop_count</varname> parameter</title>
392
-        <programlisting format="linespecific">
340
+				</example>
341
+			</section>
342
+
343
+			<section>
344
+				<title><varname>amqp_consumer_ack_loop_count</varname>(int)</title>
345
+				<para>The work ack loop count.</para>
346
+				<para>
347
+					<emphasis>Default value is 20.</emphasis>
348
+				</para>
349
+				<example>
350
+					<title>Set <varname>amqp_consumer_ack_loop_count</varname> parameter</title>
351
+					<programlisting format="linespecific">
393 352
 ...
394 353
 modparam("kazoo", "amqp_consumer_ack_loop_count", 5)
395 354
 ...
396 355
 </programlisting>
397
-        </example>
398
-    </section><section>
399
-        <title><varname>consume_messages_on_reconnect</varname>(int)</title>
400
-        <para>
401
-        This parameter indicates if the module ignores the loop counters on reconnect and consumes all the pending messages ready to be consumed.
402
-        </para>
403
-        <para>
404
-        <emphasis>Default value is 1.</emphasis>
405
-        </para>
406
-        <example>
407
-        <title>Set <varname>consume_messages_on_reconnect</varname> parameter</title>
408
-        <programlisting format="linespecific">
356
+				</example>
357
+			</section>
358
+			<section>
359
+				<title><varname>consume_messages_on_reconnect</varname>(int)</title>
360
+				<para>This parameter indicates if the module ignores the loop counters on reconnect
361
+					and consumes all the pending messages ready to be consumed.</para>
362
+				<para>
363
+					<emphasis>Default value is 1.</emphasis>
364
+				</para>
365
+				<example>
366
+					<title>Set <varname>consume_messages_on_reconnect</varname> parameter</title>
367
+					<programlisting format="linespecific">
409 368
 ...
410 369
 modparam("kazoo", "consume_messages_on_reconnect", 0)
411 370
 ...
412 371
 </programlisting>
413
-        </example>
414
-    </section><section>
415
-        <title><varname>single_consumer_on_reconnect</varname>(int)</title>
416
-        <para>
417
-        When the main loop receives a message from rabbitmq it will defer the execution to a worker in a round-robin manner. this parameter allows to use the same worker when kazoo reconnects to rabbitmq.
418
-        </para>
419
-        <para>
420
-        <emphasis>Default value is 1.</emphasis>
421
-        </para>
422
-        <example>
423
-        <title>Set <varname>single_consumer_on_reconnect</varname> parameter</title>
424
-        <programlisting format="linespecific">
372
+				</example>
373
+			</section>
374
+			<section>
375
+				<title><varname>single_consumer_on_reconnect</varname>(int)</title>
376
+				<para>When the main loop receives a message from rabbitmq it will defer the
377
+					execution to a worker in a round-robin manner. this parameter allows to use the
378
+					same worker when kazoo reconnects to rabbitmq.</para>
379
+				<para>
380
+					<emphasis>Default value is 1.</emphasis>
381
+				</para>
382
+				<example>
383
+					<title>Set <varname>single_consumer_on_reconnect</varname> parameter</title>
384
+					<programlisting format="linespecific">
425 385
 ...
426 386
 modparam("kazoo", "single_consumer_on_reconnect", 0)
427 387
 ...
428 388
 </programlisting>
429
-        </example>
430
-    </section>    
431
-    
432
-    
433
-    </section>
434
-
435
-    <section>
436
-    <title>timers</title>
437
-    <para>
438
-    each functional parameter related to timers come with 2 reflected parameters. name_sec and name_micro 
439
-    </para>
440
-    <section>
441
-        <title><varname>amqp_consumer_ack_timeout</varname>(str)</title>
442
-        <para>
443
-        Timeout when checking for acknowledge from workers.
444
-        </para>
445
-        <para>
446
-        <emphasis>Default value is 100000 micro.</emphasis>
447
-        </para>
448
-        <example>
449
-        <title>Set <varname>amqp_consumer_ack_timeout</varname> parameter</title>
450
-        <programlisting format="linespecific">
389
+				</example>
390
+			</section>
391
+
392
+
393
+		</section>
394
+
395
+		<section>
396
+			<title>timers</title>
397
+			<para>each functional parameter related to timers come with 2 reflected parameters.
398
+				name_sec and name_micro</para>
399
+			<section>
400
+				<title><varname>amqp_consumer_ack_timeout</varname>(str)</title>
401
+				<para>Timeout when checking for acknowledge from workers.</para>
402
+				<para>
403
+					<emphasis>Default value is 100000 micro.</emphasis>
404
+				</para>
405
+				<example>
406
+					<title>Set <varname>amqp_consumer_ack_timeout</varname> parameter</title>
407
+					<programlisting format="linespecific">
451 408
 ...
452 409
 modparam("kazoo", "amqp_consumer_ack_timeout_sec", 1)
453 410
 modparam("kazoo", "amqp_consumer_ack_timeout_micro", 200000)
454 411
 ...
455 412
 </programlisting>
456
-        </example>
457
-    </section>    
458
-
459
-    <section>
460
-        <title><varname>amqp_interprocess_timeout</varname>(str)</title>
461
-        <para>
462
-        Timeout when checking for commands (publish/query) for sending to rabbitmq.
463
-        </para>
464
-        <para>
465
-        <emphasis>Default value is 100000 micro.</emphasis>
466
-        </para>
467
-        <example>
468
-        <title>Set <varname>amqp_interprocess_timeout</varname> parameter</title>
469
-        <programlisting format="linespecific">
413
+				</example>
414
+			</section>
415
+
416
+			<section>
417
+				<title><varname>amqp_interprocess_timeout</varname>(str)</title>
418
+				<para>Timeout when checking for commands (publish/query) for sending to rabbitmq.</para>
419
+				<para>
420
+					<emphasis>Default value is 100000 micro.</emphasis>
421
+				</para>
422
+				<example>
423
+					<title>Set <varname>amqp_interprocess_timeout</varname> parameter</title>
424
+					<programlisting format="linespecific">
470 425
 ...
471 426
 modparam("kazoo", "amqp_interprocess_timeout_sec", 1)
472 427
 modparam("kazoo", "amqp_interprocess_timeout_micro", 200000)
473 428
 ...
474 429
 </programlisting>
475
-        </example>
476
-    </section>    
477
-
478
-    <section>
479
-        <title><varname>amqp_waitframe_timeout</varname>(str)</title>
480
-        <para>
481
-        Timeout when checking for messages from rabbitmq.
482
-        </para>
483
-        <para>
484
-        <emphasis>Default value is 100000 micro.</emphasis>
485
-        </para>
486
-        <example>
487
-        <title>Set <varname>amqp_waitframe_timeout</varname> parameter</title>
488
-        <programlisting format="linespecific">
430
+				</example>
431
+			</section>
432
+
433
+			<section>
434
+				<title><varname>amqp_waitframe_timeout</varname>(str)</title>
435
+				<para>Timeout when checking for messages from rabbitmq.</para>
436
+				<para>
437
+					<emphasis>Default value is 100000 micro.</emphasis>
438
+				</para>
439
+				<example>
440
+					<title>Set <varname>amqp_waitframe_timeout</varname> parameter</title>
441
+					<programlisting format="linespecific">
489 442
 ...
490 443
 modparam("kazoo", "amqp_waitframe_timeout_sec", 1)
491 444
 modparam("kazoo", "amqp_waitframe_timeout_micro", 200000)
492 445
 ...
493 446
 </programlisting>
494
-        </example>
495
-    </section>    
496
-
497
-    <section>
498
-        <title><varname>amqp_query_timeout</varname>(str)</title>
499
-        <para>
500
-        Timeout when checking for reply messages from rabbitmq for kazoo_query commands.
501
-        </para>
502
-        <para>
503
-        <emphasis>Default value is 2 sec.</emphasis>
504
-        </para>
505
-        <example>
506
-        <title>Set <varname>amqp_query_timeout</varname> parameter</title>
507
-        <programlisting format="linespecific">
447
+				</example>
448
+			</section>
449
+
450
+			<section>
451
+				<title><varname>amqp_query_timeout</varname>(str)</title>
452
+				<para>Timeout when checking for reply messages from rabbitmq for kazoo_query
453
+					commands.</para>
454
+				<para>
455
+					<emphasis>Default value is 2 sec.</emphasis>
456
+				</para>
457
+				<example>
458
+					<title>Set <varname>amqp_query_timeout</varname> parameter</title>
459
+					<programlisting format="linespecific">
508 460
 ...
509 461
 modparam("kazoo", "amqp_query_timeout_sec", 1)
510 462
 modparam("kazoo", "amqp_query_timeout_micro", 200000)
511 463
 ...
512 464
 </programlisting>
513
-        </example>
514
-    </section>    
515
- 
516
-     <section>
517
-        <title><varname>amqp_query_timeout_avp</varname>(str)</title>
518
-        <para>
519
-        avp holding the value in seconds for Timeout when checking for reply messages from rabbitmq for kazoo_query commands.
520
-        </para>
521
-        <para>
522
-        <emphasis>Default value is NULL (no value).</emphasis>
523
-        </para>
524
-        <example>
525
-        <title>>Set <varname>amqp_query_timeout_avp</varname> parameter</title>
526
-        <programlisting format="linespecific">
465
+				</example>
466
+			</section>
467
+
468
+			<section>
469
+				<title><varname>amqp_query_timeout_avp</varname>(str)</title>
470
+				<para>avp holding the value in seconds for Timeout when checking for reply messages
471
+					from rabbitmq for kazoo_query commands.</para>
472
+				<para>
473
+					<emphasis>Default value is NULL (no value).</emphasis>
474
+				</para>
475
+				<example>
476
+					<title>>Set <varname>amqp_query_timeout_avp</varname> parameter</title>
477
+					<programlisting format="linespecific">
527 478
 ...
528 479
 modparam("kazoo", "amqp_query_timeout_avp", "$var(kz_timeout)")
529 480
 
... ...
@@ -535,121 +486,112 @@ route[SOME_ROUTE]
535 486
 
536 487
 ...
537 488
 </programlisting>
538
-        </example>
539
-    </section>    
540
- 
541
- 
542
-    </section>
543
-        
544
-    <section>
545
-    <title>presence related</title>
546
-    <section>
547
-        <title><varname>db_url</varname>(str)</title>
548
-        <para>
549
-        The database for the presentity table.
550
-        </para>
551
-        <para>If set, the kazoo_ppua_publish function will update the presentity status in the database.
552
-        </para>
553
-        <para>
554
-        <emphasis>Default value is <quote>NULL</quote>.</emphasis>
555
-        </para>
556
-        <example>
557
-        <title>Set <varname>db_url</varname> parameter</title>
558
-        <programlisting format="linespecific">
489
+				</example>
490
+			</section>
491
+
492
+
493
+		</section>
494
+
495
+		<section>
496
+			<title>presence related</title>
497
+			<section>
498
+				<title><varname>db_url</varname>(str)</title>
499
+				<para>The database for the presentity table.</para>
500
+				<para>If set, the kazoo_ppua_publish function will update the presentity status in
501
+					the database.</para>
502
+				<para>
503
+					<emphasis>Default value is <quote>NULL</quote>.</emphasis>
504
+				</para>
505
+				<example>
506
+					<title>Set <varname>db_url</varname> parameter</title>
507
+					<programlisting format="linespecific">
559 508
 ...