Browse code

Merge 039145a68ed40ccdc464250d172b933b6f9e9652 into 10b014b505080a918a8443ff83029a0155364661

sergey-safarov authored on 20/09/2021 18:15:23 • GitHub committed on 20/09/2021 18:15:23
Showing 1 changed files
... ...
@@ -1,89 +1,78 @@
1 1
 <?xml version="1.0" encoding='ISO-8859-1'?>
2
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
2
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 3
 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 4
 
5 5
 <!-- Include general documentation entities -->
6 6
 <!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
7 7
 %docentities;
8 8
 
9
+<!ENTITY % xinclude SYSTEM "http://www.docbook.org/xml/4.4/xinclude.mod" >
10
+%xinclude;
11
+
9 12
 ]>
10 13
 <!-- Module User's Guide -->
11 14
 
12 15
 <chapter xmlns:xi="http://www.w3.org/2001/XInclude">
13 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>
14 38
 
15
-    
16
-    <section>
17
-    <title>Overview</title>
18
-    <para> The Kazoo is a general purpose AMQP connector (tested with rabbitmq-server). It exposes publish/consume capabilities into Kamailio.
19
-    </para>
20
-<para>
21
-From a high-level, the purpose of the module might be for things like:
22
-<itemizedlist>
23
-<listitem>
24
-<para>
25
-Integrate to an AMQP application to make real-time routing decisions (instead of using, say, a SQL database)
26
-</para>
27
-</listitem>
28
-<listitem>
29
-<para>
30
-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
31
-</para>
32
-</listitem>
33
-<listitem>
34
-<para>
35
-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
36
-</para>
37
-</listitem>
38
-</itemizedlist>
39
-</para>
40
-
41
-
42
-<para>
43
-supported operations are:
44
-<itemizedlist>
45
-<listitem>
46
-<para>
47
-publish json payloads to rabbitmq
48
-</para>
49
-</listitem>
50
-<listitem>
51
-<para>
52
-publish json payloads to rabbitmq and wait for correlated response message
53
-</para>
54
-</listitem>
55
-<listitem>
56
-<para>
57
-subscribe to an exchange with a routing key
58
-</para>
59
-</listitem>
60
-</itemizedlist>
61
-</para>
62
-<para>
63
-The Kazoo module also has support to publish updates to presence module thru the kazoo_pua_publish function
64
-</para>
65
-
66
-</section>
67
-    <section>
68
-    <title>How it works</title>
69
-<para>  
70
-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.
71
-</para>
72
-    <section>
73
-    <title>event routes</title>
74
-    <para>
75
-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.
76
-    </para>
77
-    <para>
78
-    Kazoo module will try to execute the event route from most significant to less significant. 
79
-    define the event route like event_route[kazoo:consumer-event[-payload_key_value[-payload_subkey_value]]]
80
-    </para>
81
-    <para>
82
-    we can set the key/subkey pair on a subscription base. check the payload on subscribe.
83
-    </para>
84
-        <example>
85
-        <title>define the event route</title>
86
-        <programlisting format="linespecific">
39
+
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">
87 76
 ...
88 77
 modparam("kazoo", "amqp_consumer_event_key", "Event-Category")
89 78
 modparam("kazoo", "amqp_consumer_event_subkey", "Event-Name")
... ...
@@ -125,402 +114,367 @@ event_route[kazoo:consumer-event]
125 114
 }
126 115
 
127 116
 </programlisting>
128
-        </example>
129
-</section>
130
-    <section>
131
-    <title>acknowledge messages</title>
132
-<para>
133
-Consumed messages have the option of being acknowledge in two ways:
134
-<itemizedlist>
135
-<listitem>
136
-<para>
137
-immediately when received 
138
-</para>
139
-</listitem>
140
-<listitem>
141
-<para>
142
-after processing by the worker 
143
-</para>
144
-</listitem>
145
-</itemizedlist>
146
-
147
-    </para>
148
-    
149
-</section>
150
-    </section>
151
-
152
-    <section>
153
-    <title>Dependencies</title>
154
-    <section>
155
-        <title>&kamailio; Modules</title>
156
-        <para>
157
-        The following modules must be loaded before this module:
158
-            <itemizedlist>
159
-            <listitem>
160
-            <para>
161
-                <emphasis>none</emphasis>.
162
-            </para>
163
-            </listitem>
164
-            </itemizedlist>
165
-        </para>
166
-    </section>
167
-    <section>
168
-        <title>External Libraries or Applications</title>
169
-        <itemizedlist>
170
-            <listitem>
171
-            <para>
172
-                <emphasis>librabbitmq</emphasis>.
173
-            </para>
174
-            </listitem>
175
-            <listitem>
176
-            <para>
177
-                <emphasis>libjson</emphasis>.
178
-            </para>
179
-            </listitem>
180
-            <listitem>
181
-            <para>
182
-                <emphasis>libuuid</emphasis>.
183
-            </para>
184
-            </listitem>
185
-        </itemizedlist>
186
-
187
-        </section>
188
-    </section>
189
-    
190
-    
191
-    <section>
192
-    <title>Parameters</title>
193
-    <section>
194
-    <title>amqp related</title>
195
-    <section>
196
-        <title><varname>node_hostname</varname>(str)</title>
197
-        <para>
198
-        The name of this host to register in rabbitmq.
199
-        </para>
200
-        <para>
201
-        <emphasis>Default value is NULL. you must set this parameter value for the module to work</emphasis>
202
-        </para>
203
-        <example>
204
-        <title>Set <varname>node_hostname</varname> parameter</title>
205
-        <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">
206 181
 ...
207 182
 modparam("kazoo", "node_hostname", "sipproxy.mydomain.com")
208 183
 ...
209 184
 </programlisting>
210
-        </example>
211
-    </section>
212
-    <section>
213
-        <title><varname>amqp_consumer_processes</varname>(int)</title>
214
-        <para>
215
-        The number of worker processes to handle messages consumption.
216
-        </para>
217
-        <para>
218
-        <emphasis>Default value is 4.</emphasis>
219
-        </para>
220
-        <example>
221
-        <title>Set <varname>amqp_consumer_processes</varname> parameter</title>
222
-        <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">
223 196
 ...
224 197
 modparam("kazoo", "amqp_consumer_processes", 10)
225 198
 ...
226 199
 </programlisting>
227
-        </example>
228
-    </section>
229
-
230
-    <section>
231
-        <title><varname>amqp_consumer_event_key</varname>(str)</title>
232
-        <para>
233
-        The default name of the field in json payload to compose the event name 1st part
234
-        </para>
235
-        <para>
236
-        <emphasis>Default value is <quote>Event-Category</quote>.</emphasis>
237
-        </para>
238
-        <example>
239
-        <title>Set <varname>amqp_consumer_event_key</varname> parameter</title>
240
-        <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">
241 213
 ...
242 214
 modparam("kazoo", "amqp_consumer_event_key", "My-JSON-Field-Name")
243 215
 ...
244 216
 </programlisting>
245
-        </example>
246
-    </section>
247
-
248
-    <section>
249
-        <title><varname>amqp_consumer_event_subkey</varname>(str)</title>
250
-        <para>
251
-        The default name of the field in json payload to compose the event name 2nd part
252
-        </para>
253
-        <para>
254
-        <emphasis>Default value is <quote>Event-Name</quote>.</emphasis>
255
-        </para>
256
-        <example>
257
-        <title>Set <varname>amqp_consumer_event_subkey</varname> parameter</title>
258
-        <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">
259 230
 ...
260 231
 modparam("kazoo", "amqp_consumer_event_subkey", "My-JSON-SubField-Name")
261 232
 ...
262 233
 </programlisting>
263
-        </example>
264
-    </section>
265
-
266
-    <section>
267
-        <title><varname>amqp_max_channels</varname>(str)</title>
268
-        <para>
269
-        The number of pre allocated channels for the connection.
270
-        </para>
271
-        <para>
272
-        <emphasis>Default value is 50.</emphasis>
273
-        </para>
274
-        <example>
275
-        <title>Set <varname>amqp_max_channels</varname> parameter</title>
276
-        <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">
277 246
 ...
278 247
 modparam("kazoo", "amqp_max_channels", 100)
279 248
 ...
280 249
 </programlisting>
281
-        </example>
282
-    </section>
283
-
284
-    <section>
285
-        <title><varname>amqp_connection</varname>(str)</title>
286
-        <para>
287
-        The connection url to rabbitmq. can be set multiple times for failover.
288
-        </para>
289
-        <example>
290
-        <title>Set <varname>amqp_connection</varname> parameter</title>
291
-        <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">
292 259
 ...
293 260
 modparam("kazoo", "amqp_connection", "amqp://guest:guest@localhost:5672")
294 261
 modparam("kazoo", "amqp_connection", "kazoo://guest:guest@otherhost:5672")
295 262
 ...
296 263
 </programlisting>
297
-        </example>
298
-    </section>
299
-
300
-<section>
301
-  <title><varname>event_callback</varname>(str)</title>
302
-    <para>
303
-        The name of the function in the kemi configuration file (embedded
304
-        scripting language such as Lua, Python, ...) to be executed instead
305
-        of event_route[...] blocks.
306
-    </para>
307
-    <para>
308
-        The function receives a string parameter with the name of the event,
309
-        the values can be: 'kazoo:mod-init', 'kazoo:consumer-event'.
310
-    </para>
311
-
312
-  <example>
313
-    <title>Set <varname>event_callback</varname> parameter</title>
314
-    <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">
315 278
     ...
316 279
     modparam("kazoo", "event_callback", "ksr_kazoo_event")
317 280
     ...
318 281
     </programlisting>
319
-  </example>
320
-</section>
282
+				</example>
283
+			</section>
284
+
285
+
321 286
 
322
-    
323 287
 
324
-    
325 288
 
326 289
 
327
-    </section>
290
+		</section>
328 291
 
329
-    <section>
330
-    <title>execution control</title>
331
-    <para>execution control of main loop can be controlled by changing the parameter values in this section.</para>
332
-    <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>
333
-    <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>
334
-        <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">
335 303
 ...
336 304
 while(true) // main  loop
337
- while(ACK or timeout)  // acknowledge from worker process
338
- while(SEND or timeout) // anything to send ?
339
- 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 ?
340 308
 ...
341 309
 </programlisting>
342 310
 
343
-    <section>
344
-        <title><varname>amqp_consumer_loop_count</varname>(int)</title>
345
-        <para>
346
-        The consumer loop count.
347
-        </para>
348
-        <para>
349
-        <emphasis>Default value is 10.</emphasis>
350
-        </para>
351
-        <example>
352
-        <title>Set <varname>amqp_consumer_loop_count</varname> parameter</title>
353
-        <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">
354 320
 ...
355 321
 modparam("kazoo", "amqp_consumer_loop_count", 3)
356 322
 ...
357 323
 </programlisting>
358
-        </example>
359
-    </section>    
360
-    
361
-    <section>
362
-        <title><varname>amqp_internal_loop_count</varname>(int)</title>
363
-        <para>
364
-        The internal listen for commands loop count.
365
-        </para>
366
-        <para>
367
-        <emphasis>Default value is 5.</emphasis>
368
-        </para>
369
-        <example>
370
-        <title>Set <varname>amqp_internal_loop_count</varname> parameter</title>
371
-        <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">
372 336
 ...
373 337
 modparam("kazoo", "amqp_internal_loop_count", 1)
374 338
 ...
375 339
 </programlisting>
376
-        </example>
377
-    </section>    
378
-    
379
-    <section>
380
-        <title><varname>amqp_consumer_ack_loop_count</varname>(int)</title>
381
-        <para>
382
-        The work ack loop count.
383
-        </para>
384
-        <para>
385
-        <emphasis>Default value is 20.</emphasis>
386
-        </para>
387
-        <example>
388
-        <title>Set <varname>amqp_consumer_ack_loop_count</varname> parameter</title>
389
-        <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">
390 352
 ...
391 353
 modparam("kazoo", "amqp_consumer_ack_loop_count", 5)
392 354
 ...
393 355
 </programlisting>
394
-        </example>
395
-    </section><section>
396
-        <title><varname>consume_messages_on_reconnect</varname>(int)</title>
397
-        <para>
398
-        This parameter indicates if the module ignores the loop counters on reconnect and consumes all the pending messages ready to be consumed.
399
-        </para>
400
-        <para>
401
-        <emphasis>Default value is 1.</emphasis>
402
-        </para>
403
-        <example>
404
-        <title>Set <varname>consume_messages_on_reconnect</varname> parameter</title>
405
-        <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">
406 368
 ...
407 369
 modparam("kazoo", "consume_messages_on_reconnect", 0)
408 370
 ...
409 371
 </programlisting>
410
-        </example>
411
-    </section><section>
412
-        <title><varname>single_consumer_on_reconnect</varname>(int)</title>
413
-        <para>
414
-        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.
415
-        </para>
416
-        <para>
417
-        <emphasis>Default value is 1.</emphasis>
418
-        </para>
419
-        <example>
420
-        <title>Set <varname>single_consumer_on_reconnect</varname> parameter</title>
421
-        <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">
422 385
 ...
423 386
 modparam("kazoo", "single_consumer_on_reconnect", 0)
424 387
 ...
425 388
 </programlisting>
426
-        </example>
427
-    </section>    
428
-    
429
-    
430
-    </section>
431
-
432
-    <section>
433
-    <title>timers</title>
434
-    <para>
435
-    each functional parameter related to timers come with 2 reflected parameters. name_sec and name_micro 
436
-    </para>
437
-    <section>
438
-        <title><varname>amqp_consumer_ack_timeout</varname>(str)</title>
439
-        <para>
440
-        Timeout when checking for acknowledge from workers.
441
-        </para>
442
-        <para>
443
-        <emphasis>Default value is 100000 micro.</emphasis>
444
-        </para>
445
-        <example>
446
-        <title>Set <varname>amqp_consumer_ack_timeout</varname> parameter</title>
447
-        <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">
448 408
 ...
449 409
 modparam("kazoo", "amqp_consumer_ack_timeout_sec", 1)
450 410
 modparam("kazoo", "amqp_consumer_ack_timeout_micro", 200000)
451 411
 ...
452 412
 </programlisting>
453
-        </example>
454
-    </section>    
455
-
456
-    <section>
457
-        <title><varname>amqp_interprocess_timeout</varname>(str)</title>
458
-        <para>
459
-        Timeout when checking for commands (publish/query) for sending to rabbitmq.
460
-        </para>
461
-        <para>
462
-        <emphasis>Default value is 100000 micro.</emphasis>
463
-        </para>
464
-        <example>
465
-        <title>Set <varname>amqp_interprocess_timeout</varname> parameter</title>
466
-        <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">
467 425
 ...
468 426
 modparam("kazoo", "amqp_interprocess_timeout_sec", 1)
469 427
 modparam("kazoo", "amqp_interprocess_timeout_micro", 200000)
470 428
 ...
471 429
 </programlisting>
472
-        </example>
473
-    </section>    
474
-
475
-    <section>
476
-        <title><varname>amqp_waitframe_timeout</varname>(str)</title>
477
-        <para>
478
-        Timeout when checking for messages from rabbitmq.
479
-        </para>
480
-        <para>
481
-        <emphasis>Default value is 100000 micro.</emphasis>
482
-        </para>
483
-        <example>
484
-        <title>Set <varname>amqp_waitframe_timeout</varname> parameter</title>
485
-        <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">
486 442
 ...
487 443
 modparam("kazoo", "amqp_waitframe_timeout_sec", 1)
488 444
 modparam("kazoo", "amqp_waitframe_timeout_micro", 200000)
489 445
 ...
490 446
 </programlisting>
491
-        </example>
492
-    </section>    
493
-
494
-    <section>
495
-        <title><varname>amqp_query_timeout</varname>(str)</title>
496
-        <para>
497
-        Timeout when checking for reply messages from rabbitmq for kazoo_query commands.
498
-        </para>
499
-        <para>
500
-        <emphasis>Default value is 2 sec.</emphasis>
501
-        </para>
502
-        <example>
503
-        <title>Set <varname>amqp_query_timeout</varname> parameter</title>
504
-        <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">
505 460
 ...
506 461
 modparam("kazoo", "amqp_query_timeout_sec", 1)
507 462
 modparam("kazoo", "amqp_query_timeout_micro", 200000)
508 463
 ...
509 464
 </programlisting>
510
-        </example>
511
-    </section>    
512
- 
513
-     <section>
514
-        <title><varname>amqp_query_timeout_avp</varname>(str)</title>
515
-        <para>
516
-        avp holding the value in seconds for Timeout when checking for reply messages from rabbitmq for kazoo_query commands.
517
-        </para>
518
-        <para>
519
-        <emphasis>Default value is NULL (no value).</emphasis>
520
-        </para>
521
-        <example>
522
-        <title>>Set <varname>amqp_query_timeout_avp</varname> parameter</title>
523
-        <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">
524 478
 ...
525 479
 modparam("kazoo", "amqp_query_timeout_avp", "$var(kz_timeout)")
526 480
 
... ...
@@ -532,121 +486,112 @@ route[SOME_ROUTE]
532 486
 
533 487
 ...
534 488
 </programlisting>
535
-        </example>
536
-    </section>    
537
- 
538
- 
539
-    </section>
540
-        
541
-    <section>
542
-    <title>presence related</title>
543
-    <section>
544
-        <title><varname>db_url</varname>(str)</title>
545
-        <para>
546
-        The database for the presentity table.
547
-        </para>
548
-        <para>If set, the kazoo_ppua_publish function will update the presentity status in the database.
549
-        </para>
550
-        <para>
551
-        <emphasis>Default value is <quote>NULL</quote>.</emphasis>
552
-        </para>
553
-        <example>
554
-        <title>Set <varname>db_url</varname> parameter</title>
555
-        <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">
556 508
 ...
557 509
 modparam("kazoo", "db_url", "&defaultdb;")
558 510
 ...
559 511
 </programlisting>
560
-        </example>
561
-    </section>
562
-
563
-    <section>
564
-        <title><varname>presentity_table</varname>(str)</title>
565
-        <para>
566
-        The name of the presentity table in the database.
567
-        </para>
568
-        <para>
569
-        <emphasis>Default value is <quote>presentity</quote>.</emphasis>
570
-        </para>
571
-        <example>
572
-        <title>Set <varname>presentity_table</varname> parameter</title>
573
-        <programlisting format="linespecific">
512
+				</example>
513
+			</section>
514
+
515
+			<section>
516
+				<title><varname>presentity_table</varname>(str)</title>
517
+				<para>The name of the presentity table in the database.</para>
518
+				<para>
519
+					<emphasis>Default value is <quote>presentity</quote>.</emphasis>
520
+				</para>
521
+				<example>
522
+					<title>Set <varname>presentity_table</varname> parameter</title>
523
+					<programlisting format="linespecific">
574 524
 ...
575 525
 modparam("kazoo", "presentity_table", "my_presentity_table")
576 526
 ...
577 527
 </programlisting>
578
-        </example>
579
-    </section>
580
-
581
-    <section id="kazoo.p.pua_mode">
582
-        <title><varname>pua_mode</varname>(int)</title>
583
-		<para>
584
-			Control if the module has to connect to presence database tables.
585
-			Set it to 0 to not connect to database.
586
-		</para>
587
-        <para>
588
-        <emphasis>Default value is <quote>1</quote>.</emphasis>
589
-        </para>
590
-        <example>
591
-        <title>Set <varname>pua_mode</varname> parameter</title>
592
-        <programlisting format="linespecific">
528
+				</example>
529
+			</section>
530
+
531
+			<section id="kazoo.p.pua_mode">
532
+				<title><varname>pua_mode</varname>(int)</title>
533
+				<para>Control if the module has to connect to presence database tables. Set it to 0
534
+					to not connect to database.</para>
535
+				<para>
536
+					<emphasis>Default value is <quote>1</quote>.</emphasis>
537
+				</para>
538
+				<example>
539
+					<title>Set <varname>pua_mode</varname> parameter</title>
540
+					<programlisting format="linespecific">
593 541
 ...
594 542
 modparam("kazoo", "pua_mode", 0)
595 543
 ...
596 544
 </programlisting>
597
-        </example>
598
-    </section>
599
-
600
-    </section>
601
-    
602
-    
603
-    
604
-
605
-
606
-</section>    
607
-<section>
608
-    <title>Functions</title>
609
-    <section>
610
-    <title>amqp related</title>
611
-
612
-    <section>
613
-        <title>
614
-        <function moreinfo="none">kazoo_publish(exchange, routing_key, json_payload)</function>
615
-        </title>
616
-        <para>
617
-        The function publishes a json payload to rabbitmq. The routing_key parameter should be encoded.
618
-        </para>
619
-        <para>
620
-        This function can be used from ANY ROUTE.
621
-        </para>
622
-
623
-        <example>
624
-        <title><function>kazoo_publish</function> usage</title>
625
-        <programlisting format="linespecific">
626
-...
627
-$var(amqp_payload_request) = "{'Event-Category' : 'directory', 'Event-Name' : 'reg_success', 'Contact' : '" + $var(fs_contact) + "', 'Call-ID' : '" + $ci + "', 'Realm' : '" + $fd +"', 'Username' : '" + $fU + "', 'From-User' : '" + $fU + "', 'From-Host' : '" + $fd + "', 'To-User' : '" + $tU +"', 'To-Host' : '" + $td + "', 'User-Agent' : '" + $ua +"' ," + $var(register_contants)+ " }";
545
+				</example>
546
+			</section>
547
+
548
+		</section>
549
+
550
+
551
+
552
+
553
+
554
+	</section>
555
+	<section>
556
+		<title>Functions</title>
557
+		<section>
558
+			<title>amqp related</title>
559
+
560
+			<section>
561
+				<title>
562
+					<function moreinfo="none">kazoo_publish(exchange, routing_key,
563
+						json_payload)</function>
564
+				</title>
565
+				<para>The function publishes a json payload to rabbitmq. The routing_key parameter
566
+					should be encoded.</para>
567
+				<para>This function can be used from ANY ROUTE.</para>
568
+
569
+				<example>
570
+					<title><function>kazoo_publish</function> usage</title>
571
+					<programlisting format="linespecific">
572
+...
573
+$var(amqp_payload_request) = $_s({"Event-Category" : "directory", "Event-Name" : "reg_success", "Contact" : "$(ct{s.escape.common}{s.replace,\','}{s.replace,$$,})", "Call-ID" : "$ci", "Realm" : "$fd", "Username" : "$fU", "From-User" : "$fU", "From-Host" : "$fd", "To-User" : "$tU", "To-Host" : "$td", "User-Agent" : "$(ua{s.escape.common}{s.replace,\','}{s.replace,$$,})" });
628 574
 $var(amqp_routing_key) = "registration.success." + $(fd{kz.encode}) + "." + $fU;
629 575
 kazoo_publish("callmgr", $var(amqp_routing_key), $var(amqp_payload_request)); 
630 576
 ...
631 577
 </programlisting>
632
-        </example>
633
-    </section>
634
-    
635
-    <section>
636
-        <title>
637
-        <function moreinfo="none">kazoo_query(exchange, routing_key, json_payload [, target_var])</function>
638
-        </title>
639
-        <para>
640
-        The function publishes a json payload to rabbitmq, waits for a correlated messageand puts the result in target_var. The routing_key parameter should be encoded.
641
-        target_var is optional as the function also puts the result in pseudo-variable $kzR.
642
-        </para>
643
-        <para>
644
-        This function can be used from ANY ROUTE.
645
-        </para>
646
-
647
-        <example>
648
-        <title><function>kazoo_query</function> usage</title>
649
-        <programlisting format="linespecific">
578
+				</example>
579
+			</section>
580
+
581
+			<section>
582
+				<title>
583
+					<function moreinfo="none">kazoo_query(exchange, routing_key, json_payload [,
584
+						target_var])</function>
585
+				</title>
586
+				<para>The function publishes a json payload to rabbitmq, waits for a correlated
587
+					messageand puts the result in target_var. The routing_key parameter should be
588
+					encoded. target_var is optional as the function also puts the result in
589
+					pseudo-variable $kzR.</para>
590
+				<para>This function can be used from ANY ROUTE.</para>
591
+
592
+				<example>
593
+					<title><function>kazoo_query</function> usage</title>
594
+					<programlisting format="linespecific">
650 595
 ...
651 596
 $var(amqp_payload_request) = "{'Event-Category' : 'call_event' , 'Event-Name' : 'query_user_channels_req', 'Realm' : '" + $fd + "', 'Username' : '" + $fU + "', 'Active-Only' : false }";
652 597
 kazoo_encode("$ci", "$var(callid_encoded)");
... ...
@@ -660,23 +605,21 @@ if(kazoo_query("callevt", $var(amqp_routing_key), $var(amqp_payload_request), "$
660 605
 }
661 606
 ...
662 607
 </programlisting>
663
-        </example>
664
-    </section>
665
-    
666
-    <section>
667
-        <title>
668
-        <function moreinfo="none">kazoo_subscribe(exchange, exchange_type, queue, routing_key)</function>
669
-        </title>
670
-        <para>
671
-        The function subscribes to exchange/type on queue with routing_key. The routing_key parameter should be encoded.
672
-        </para>
673
-        <para>
674
-        This function  must be called from event_route[kazoo:mod-init].
675
-        </para>
676
-
677
-        <example>
678
-        <title><function>kazoo_subscribe</function> usage</title>
679
-        <programlisting format="linespecific">
608
+				</example>
609
+			</section>
610
+
611
+			<section>
612
+				<title>
613
+					<function moreinfo="none">kazoo_subscribe(exchange, exchange_type, queue,
614
+						routing_key)</function>
615
+				</title>
616
+				<para>The function subscribes to exchange/type on queue with routing_key. The
617
+					routing_key parameter should be encoded.</para>
618
+				<para>This function must be called from event_route[kazoo:mod-init].</para>
619
+
620
+				<example>
621
+					<title><function>kazoo_subscribe</function> usage</title>
622
+					<programlisting format="linespecific">
680 623
 ...
681 624
 event_route[kazoo:mod-init]
682 625
 {
... ...
@@ -689,57 +632,53 @@ event_route[kazoo:consumer-event]
689 632
 }
690 633
 ...
691 634
 </programlisting>
692
-        </example>
693
-    </section>
694
-
695
-    <section>
696
-        <title>
697
-        <function moreinfo="none">kazoo_subscribe(json_description)</function>
698
-        </title>
699
-        <para>
700
-        The function takes additional parameters to the subscribe function.
701
-        </para>
702
-        <para>        
703
-        <itemizedlist>
704
-            <title>json payload fields description</title>
705
-            <listitem>
706
-               <para>exchange : str, required</para> 
707
-            </listitem>
708
-            <listitem>
709
-               <para>type : str, required</para> 
710
-            </listitem>
711
-            <listitem>
712
-               <para>queue : str, required</para> 
713
-            </listitem>
714
-            <listitem>
715
-               <para>routing : str, required</para> 
716
-            </listitem>
717
-            <listitem>
718
-               <para>auto_delete : int, default 1</para> 
719
-            </listitem>
720
-            <listitem>
721
-               <para>durable : int, default 0</para> 
722
-            </listitem>
723
-            <listitem>
724
-               <para>no_ack : int, default 1</para> 
725
-            </listitem>
726
-            <listitem>
727
-               <para>wait_for_consumer_ack : int, default 0</para> 
728
-            </listitem>
729
-            <listitem>
730
-               <para>event_key : str, no default</para> 
731
-            </listitem>
732
-            <listitem>
733
-               <para>event_subkey : str, no default</para> 
734
-            </listitem>
735
-        </itemizedlist>
736
-        </para>
737
-        <para>
738
-        This function  must be called from event_route[kazoo:mod-init].
739
-        </para>
740
-        <example>
741
-        <title><function>kazoo_subscribe</function> usage</title>
742
-        <programlisting format="linespecific">
635
+				</example>
636
+			</section>
637
+
638
+			<section>
639
+				<title>
640
+					<function moreinfo="none">kazoo_subscribe(json_description)</function>
641
+				</title>
642
+				<para>The function takes additional parameters to the subscribe function.</para>
643
+				<para>
644
+					<itemizedlist>
645
+						<title>json payload fields description</title>
646
+						<listitem>
647
+							<para>exchange : str, required</para>
648
+						</listitem>
649
+						<listitem>
650
+							<para>type : str, required</para>
651
+						</listitem>
652
+						<listitem>
653
+							<para>queue : str, required</para>
654
+						</listitem>
655
+						<listitem>
656
+							<para>routing : str, required</para>
657
+						</listitem>
658
+						<listitem>
659
+							<para>auto_delete : int, default 1</para>
660
+						</listitem>
661
+						<listitem>
662
+							<para>durable : int, default 0</para>
663
+						</listitem>
664
+						<listitem>
665
+							<para>no_ack : int, default 1</para>
666
+						</listitem>
667
+						<listitem>
668
+							<para>wait_for_consumer_ack : int, default 0</para>
669
+						</listitem>
670
+						<listitem>
671
+							<para>event_key : str, no default</para>
672
+						</listitem>
673
+						<listitem>
674
+							<para>event_subkey : str, no default</para>
675
+						</listitem>
676
+					</itemizedlist>
677
+				</para>
678
+				<para>This function must be called from event_route[kazoo:mod-init].</para>
679
+				<example>
680
+					<title><function>kazoo_subscribe</function> usage</title>
681
+					<programlisting format="linespecific">
743 682
 ...
744 683
 event_route[kazoo:mod-init]
745 684
 {
... ...
@@ -753,26 +692,23 @@ event_route[kazoo:consumer-event]
753 692
 }
754 693
 ...
755 694
 </programlisting>
756
-        </example>
757
-    </section>
758
-    
759
-</section>
760
-    <section>
761
-    <title>presence related</title>
762
-    <section>
763
-        <title>
764
-        <function moreinfo="none">kazoo_pua_publish(json_payload)</function>
765
-        </title>
766
-        <para>
767
-        The function build presentity state from json_payload and updates presentity table.
768
-        </para>
769
-        <para>
770
-        This function can be used from ANY ROUTE.
771
-        </para>
772
-
773
-        <example>
774
-        <title><function>kazoo_pua_publish</function> usage</title>
775
-        <programlisting format="linespecific">
695
+				</example>
696
+			</section>
697
+
698
+		</section>
699
+		<section>
700
+			<title>presence related</title>
701
+			<section>
702
+				<title>
703
+					<function moreinfo="none">kazoo_pua_publish(json_payload)</function>
704
+				</title>
705
+				<para>The function build presentity state from json_payload and updates presentity
706
+					table.</para>
707
+				<para>This function can be used from ANY ROUTE.</para>
708
+
709
+				<example>
710
+					<title><function>kazoo_pua_publish</function> usage</title>
711
+					<programlisting format="linespecific">
776 712
 ...
777 713
 event_route[kazoo:consumer-event-presence-update]
778 714
 {
... ...
@@ -782,50 +718,43 @@ event_route[kazoo:consumer-event-presence-update]
782 718
 }    
783 719
 ...
784 720
 </programlisting>
785
-        </example>
786
-    </section>
787
-
788
-    
789
-</section>
790
-    <section>
791
-    <title>other</title>
792
-    <section>
793
-        <title>
794
-        <function moreinfo="none">kazoo_encode(to_encode, target_var)</function>
795
-        </title>
796
-        <para>
797
-        The function encodes the 1st parameter for amqp and puts the result in the 2nd parameter.
798
-        </para>
799
-        <para>
800
-        This function can be used from ANY ROUTE.
801
-        </para>
802
-
803
-        <example>
804
-        <title><function>kazoo_encode</function> usage</title>
805
-        <programlisting format="linespecific">
721
+				</example>
722
+			</section>
723
+
724
+
725
+		</section>
726
+		<section>
727
+			<title>other</title>
728
+			<section>
729
+				<title>
730
+					<function moreinfo="none">kazoo_encode(to_encode, target_var)</function>
731
+				</title>
732
+				<para>The function encodes the 1st parameter for amqp and puts the result in the
733
+					2nd parameter.</para>
734
+				<para>This function can be used from ANY ROUTE.</para>
735
+
736
+				<example>
737
+					<title><function>kazoo_encode</function> usage</title>
738
+					<programlisting format="linespecific">
806 739
 ...
807 740
 kazoo_encode("$ci", "$var(callid_encoded)");
808 741
 $var(amqp_routing_key) = "call.status_req.$var(callid_encoded)";
809 742
 ...
810 743
 </programlisting>
811
-        </example>
812
-    </section>
813
-
814
-    <section>
815
-        <title>
816
-        <function moreinfo="none">kazoo_json(json_payload, field, target_var)</function>
817
-        </title>
818
-        <para>
819
-        The function extracts the value from a json payload and puts the result in the 3rd parameter.
820
-        It can use nested values for the query part.
821
-        </para>
822
-        <para>
823
-        This function can be used from ANY ROUTE.
824
-        </para>
825
-
826
-        <example>
827
-        <title><function>kazoo_json</function> usage</title>
828
-        <programlisting format="linespecific">
744
+				</example>
745
+			</section>
746
+
747
+			<section>
748
+				<title>
749
+					<function moreinfo="none">kazoo_json(json_payload, field, target_var)</function>
750
+				</title>
751
+				<para>The function extracts the value from a json payload and puts the result in
752
+					the 3rd parameter. It can use nested values for the query part.</para>
753
+				<para>This function can be used from ANY ROUTE.</para>
754
+
755
+				<example>
756
+					<title><function>kazoo_json</function> usage</title>
757
+					<programlisting format="linespecific">
829 758
 ...
830 759
 kazoo_json("$var(amqp_result)", "Channels[0].switch_url", "$du");
831 760
 if($du != $null) {
... ...
@@ -834,40 +763,38 @@ if($du != $null) {
834 763
 }
835 764
 ...
836 765
 </programlisting>
837
-        </example>
838
-    </section>
839
-    
840
-</section>
841
-</section>
842
-    
843
-        <section>
844
-        <title>Exported pseudo-variables</title>
845
-        <itemizedlist>
846
-            <listitem>
847
-            <para>
848
-                <emphasis>$kzR</emphasis>
849
-                Contains the payload result of kazoo_query execution.
850
-            </para>
851
-            </listitem>
852
-            <listitem>
853
-            <para>
854
-                <emphasis>$kzE</emphasis>
855
-                Contains the payload of a consumed message
856
-            </para>
857
-            </listitem>
858
-        </itemizedlist>
859
-    </section>
860
-    
861
-        <section>
862
-        <title>Transformations</title>
863
-        <para>The prefix for kazoo transformations is kz.</para>
864
-        <itemizedlist>
865
-            <listitem><para>
866
-                <emphasis>json</emphasis>
867
-            </para>
868
-        <example>
869
-        <title><function>kz.json</function> usage</title>
870
-        <programlisting format="linespecific">
766
+				</example>
767
+			</section>
768
+
769
+		</section>
770
+	</section>
771
+
772
+	<section>
773
+		<title>Exported pseudo-variables</title>
774
+		<itemizedlist>
775
+			<listitem>
776
+				<para>
777
+					<emphasis>$kzR</emphasis> Contains the payload result of kazoo_query execution.
778
+				</para>
779
+			</listitem>
780
+			<listitem>
781
+				<para>
782
+					<emphasis>$kzE</emphasis> Contains the payload of a consumed message</para>
783
+			</listitem>
784
+		</itemizedlist>
785
+	</section>
786
+
787
+	<section>
788
+		<title>Transformations</title>
789
+		<para>The prefix for kazoo transformations is kz.</para>
790
+		<itemizedlist>
791
+			<listitem>
792
+				<para>
793
+					<emphasis>json</emphasis>
794
+				</para>
795
+				<example>
796
+					<title><function>kz.json</function> usage</title>
797
+					<programlisting format="linespecific">
871 798
 ...
872 799
 #kazoo_json("$var(amqp_result)", "Channels[0].switch_url", "$du");
873 800
 $du = $kzR{kz.json,Channels[0].switch_url};
... ...
@@ -877,27 +804,27 @@ if($du != $null) {
877 804
 }
878 805
 ...
879 806
 </programlisting>
880