/
dispatcher_admin.xml
2090 lines (2044 loc) · 62.1 KB
/
dispatcher_admin.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding='ISO-8859-1'?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
%docentities;
]>
<!-- Module User's Guide -->
<chapter xmlns:xi="http://www.w3.org/2001/XInclude">
<title>&adminguide;</title>
<section>
<title>Overview</title>
<para>
This module offers SIP load balancer functionality and it can be
used as SIP traffic dispatcher. There are many load balancing and
traffic dispatching algorithms that you can choose from, for example:
round-robin, weight based load balancing, call load distribution,
and hashing over SIP message attributes.
</para>
<para>
The module can be used as a stateless load balancer; it does not
depend on any call state tracking module. It requires the TM module if
you enable auto-discovery of active/inactive gateways.
</para>
<para>
It is very lightweight, therefore suitable for handling heavy SIP
traffic. As the module has a small footprint and the ability to load
balancing rules from a plain text file, it is suitable for embedded systems.
</para>
</section>
<section>
<title>Dependencies</title>
<section>
<title>&kamailio; modules</title>
<para>
The following modules must be loaded before this module:
<itemizedlist>
<listitem>
<para>
<emphasis>TM - only if active recovery of failed hosts
is required</emphasis>.
</para>
</listitem>
<listitem>
<para>
<emphasis>database engine - only if you want to load
balancing routes from database instead of plain text file.
</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
<section>
<title>External libraries or applications</title>
<para>
The following libraries or applications must be installed before
running &kamailio; with this module:
<itemizedlist>
<listitem>
<para>
<emphasis>none</emphasis>.
</para>
</listitem>
</itemizedlist>
</para>
</section>
</section>
<section>
<title>Parameters</title>
<section id="dispatcher.p.list_file">
<title><varname>list_file</varname> (string)</title>
<para>
Path to the file with destination sets (destination groups).
</para>
<para>
<emphasis>
Default value is <quote>/etc/kamailio/dispatcher.list</quote> or
<quote>/usr/local/etc/kamailio/dispatcher.list</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>list_file</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "list_file", "/var/run/kamailio/dispatcher.list")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.db_url">
<title><varname>db_url</varname> (string)</title>
<para>
If you want to load the list of gateways from the database you must set
this parameter.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote> (disable DB support).
</emphasis>
</para>
<example>
<title>Set <quote>db_url</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "db_url", "mysql://user:passwd@localhost/database")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.table_name">
<title><varname>table_name</varname> (string)</title>
<para>
If you want to load the list of gateways from the database you must set
this parameter as the database name.
</para>
<para>
<emphasis>
Default value is <quote>dispatcher</quote>.
</emphasis>
</para>
<example>
<title>Set <quote>table_name</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "table_name", "my_dispatcher")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.setid_col">
<title><varname>setid_col</varname> (string)</title>
<para>
The column's name in the database storing the gateway's set (group)
id.
</para>
<para>
<emphasis>
Default value is <quote>setid</quote>.
</emphasis>
</para>
<example>
<title>Set <quote>setid_col</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "setid_col", "groupid")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.destination_col">
<title><varname>destination_col</varname> (string)</title>
<para>
The column's name in the database storing the destination
sip URI.
</para>
<para>
<emphasis>
Default value is <quote>destination</quote>.
</emphasis>
</para>
<example>
<title>Set <quote>destination_col</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "destination_col", "uri")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.flags_col">
<title><varname>flags_col</varname> (string)</title>
<para>
The column's name in the database storing the flags for
the destination URI.
</para>
<para>
<emphasis>
Default value is <quote>flags</quote>.
</emphasis>
</para>
<example>
<title>Set <quote>flags_col</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "flags_col", "dstflags")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.priority_col">
<title><varname>priority_col</varname> (string)</title>
<para>
The column's name in the database storing the priority for
destination URI.
</para>
<para>
<emphasis>
Default value is <quote>priority</quote>.
</emphasis>
</para>
<example>
<title>Set <quote>priority_col</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "priority_col", "dstpriority")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.force_dst">
<title><varname>force_dst</varname> (int)</title>
<para>
If set to 1, force overwriting of destination address (outbound proxy)
when that is already set. If set to 0, will return error when the
destination address is already set.
</para>
<para>
<emphasis>
Default value is <quote>1</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>force_dst</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "force_dst", 1)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.flags">
<title><varname>flags</varname> (int)</title>
<para>
Various flags that affect dispatcher's behaviour. The flags are defined
as a bitmask on an integer value.
If flag 1 is set only the username
part of the URI will be used when computing an URI based hash.
If no flags are set the username, hostname and port will be used.
The port is used only if different from 5060 (normal sip URI) or 5061
(in the sips: case).
</para>
<para>
If flag 2 is set, then failover support is enabled. The functions
exported by the module will store the rest of addresses from the
destination set in XAPVs, and use these XAVPs to try next address if
the current-tried destination fails.
</para>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>flags</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "flags", 3)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.use_default">
<title><varname>use_default</varname> (int)</title>
<para>
If the parameter is set to 1, the last address in destination set
is used as a final option to send the request to. For example, it is useful
when wanting to send the call to an announcement server saying:
"the gateways are full, try later".
</para>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>use_default</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "use_default", 1)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.xavp_dst">
<title><varname>xavp_dst</varname> (str)</title>
<para>
The name of the XAVP which will hold the list with addresses and
associated properties, in the order they have been selected by the
chosen algorithm. If use_default is 1, the values of last XAVP correspond
to the last address in destination set. In case of using dispatcher.list file,
you have to set the priority field for each destination to ensure a particular order there.
The first XAVP is the current selected destination. All the other addresses
from the destination set will be added in the XAVP list to be able to implement serial forking.
</para>
<note>
<para>
You must set this parameter if you want to do load balancing fail over.
</para>
</note>
<para>
<emphasis>
Default value is <quote>_dsdst_</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>xavp_dst</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "xavp_dst", "_dsdst_")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.xavp_dst_mode">
<title><varname>xavp_dst_mode</varname> (int)</title>
<para>
Control what fields are added to the XAVP specified by xavp_dst
parameter.
</para>
<para>
The addeded fields are:
<itemizedlist>
<listitem>
grp - the set id (group id).
</listitem>
<listitem>
uri - the URI address.
</listitem>
<listitem>
sock - the socket pointer.
</listitem>
<listitem>
socket - the socket string - it iadded only if xavp_dst_mode has bit 2 set
(value 2).
</listitem>
<listitem>
dstid - the destination unique id (in case of call load distribution algorithm).
</listitem>
<listitem>
attrs - the attributes - they are added if xavp_dst_mode does not have
the bit 1 set (value 1).
</listitem>
</itemizedlist>
</para>
<para>
<emphasis>
Default value is <quote>0</quote> (add all fields).
</emphasis>
</para>
<example>
<title>Set the <quote>xavp_dst_mode</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "xavp_dst_mode", 1)
...
modparam("dispatcher", "xavp_dst_mode", 2)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.xavp_ctx">
<title><varname>xavp_ctx</varname> (str)</title>
<para>
The name of the XAVP which will hold some attributes specific to
dispatcher routing context. The XAVP can hold the next fields: cnt -
the number of addresses selected for routing.
</para>
<para>
<emphasis>
Default value is <quote>_dsctx_</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>xavp_ctx</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "xavp_ctx", "_dsctx_")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.xavp_ctx_mode">
<title><varname>xavp_ctx_mode</varname> (int)</title>
<para>
Control what fields are added to the XAVP specified by xavp_ctx
parameter. The cnt field is added if xavp_cnt_mode does not have the
bit 1 set.
</para>
<para>
<emphasis>
Default value is <quote>0</quote> (add all fields).
</emphasis>
</para>
<example>
<title>Set the <quote>xavp_ctx_mode</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "xavp_ctx_mode", 1)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.hash_pvar">
<title><varname>hash_pvar</varname> (str)</title>
<para>
String with PVs used for the hashing algorithm 7.
</para>
<note>
<para>
You must set this parameter if you want do hashing over custom message
parts.
</para>
</note>
<para>
<emphasis>
Default value is <quote>null</quote> - disabled.
</emphasis>
</para>
<example>
<title>Use $avp(hash) for hashing:</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "hash_pvar", "$avp(hash)")
...
</programlisting>
</example>
<example>
<title>Use combination of PVs for hashing:</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "hash_pvar", "hash the $fU@$ci")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.setid_pvname">
<title><varname>setid_pvname</varname> (str)</title>
<para>
The name of the PV where to store the set ID (group ID) when calling
ds_is_from_list() with no parameter.
</para>
<para>
<emphasis>
Default value is <quote>null</quote> - don't set PV.
</emphasis>
</para>
<example>
<title>Set the <quote>setid_pvname</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "setid_pvname", "$var(setid)")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.attrs_pvname">
<title><varname>attrs_pvname</varname> (str)</title>
<para>
The name of the PV where to store the attributes of matching address
when calling ds_is_from_list().
</para>
<para>
<emphasis>
Default value is <quote>null</quote> - don't set PV.
</emphasis>
</para>
<example>
<title>Set the <quote>attrs_pvname</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "attrs_pvname", "$var(attrs)")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_ping_method">
<title><varname>ds_ping_method</varname> (string)</title>
<para>
With this method you can define, with which method you want to probe the gateways.
Pinging gateways feature depends on ds_ping_interval parameter.
</para>
<para>
<emphasis>
Default value is <quote>OPTIONS</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_ping_method</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_ping_method", "INFO")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_ping_from">
<title><varname>ds_ping_from</varname> (string)</title>
<para>
With this Method you can define the "From:"-Line for the request, sent to the failed gateways.
This method is only available, if compiled with the probing of failed gateways enabled.
</para>
<para>
<emphasis>
Default value is <quote>sip:dispatcher@localhost</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_ping_from</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_ping_from", "sip:proxy@sip.somehost.com")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_ping_interval">
<title><varname>ds_ping_interval</varname> (int)</title>
<para>
With this parameter you can define the interval for sending a request
to a gateway marked as inactive upon a failed request routing to it.
This parameter is only used, when the TM-Module is loaded.
If set to <quote>0</quote>, the pinging of inactive gateway is disabled.
</para>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_ping_interval</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_ping_interval", 30)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_probing_threshold">
<title><varname>ds_probing_threshold</varname> (int)</title>
<para>
If you want to set a gateway into inactive mode, there can be
a specific number of failed requests until it will change from "active"
to "inactive". It is using the state "trying", that allows selection
of gateway but indicates there was a failure previously with the
gateway. The number of attempts can be set with this parameter.
This parameter can be modified via ser config framework.
</para>
<para>
<emphasis>
Default value is <quote>1</quote> (set inactive with first failure).
</emphasis>
</para>
<example>
<title>Set the <quote>ds_probing_threshold</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_probing_threshold", 10)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_inactive_threshold">
<title><varname>ds_inactive_threshold</varname> (int)</title>
<para>
If you want to set a gateway into active mode (after being inactive), there can be
a specific number of successful requests until it will change from "inactive"
to "active". The number of attempts can be set with this parameter.
This parameter can be modified via ser config framework.
</para>
<para>
<emphasis>
Default value is <quote>1</quote> (set active with first success).
</emphasis>
</para>
<example>
<title>Set the <quote>ds_inactive_threshold</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_inactive_threshold", 10)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_ping_reply_codes">
<title><varname>ds_ping_reply_codes</varname> (string)</title>
<para>
This parameter defines the valid response codes, which are accepted
as a valid reply to the PING-Method. It is a list separated by
colons, where you may define either a single code (e.g. "code=202"
would accept 202 as an additional, valid response) or a class of
responses, you want to accept (e.g. "class=2" would accept
everything from 200 to 299 as valid response). This parameter can
be modified via config framework.
</para>
<para>
Please note that the response codes the module accepts as valid reply to the
PING-Method are not only the ones generated from the remote servers, but also those
that are generated locally. E.g.: setting code=408 or class=400 will never set
a backend down even if it is, because internally the Kamailio transaction layer
generates a 408 in the case of no response from the remote server, and this
internal code 408 is accepted as valid value.
</para>
<para>
<emphasis>
Default value is <quote></quote> (only 200 OK is accepted).
</emphasis>
</para>
<example>
<title>Set the <quote>ds_ping_reply_codes</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=403;code=488;class=3")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_probing_mode">
<title><varname>ds_probing_mode</varname> (int)</title>
<para>
Controls what gateways are tested to see if they are reachable.
</para>
<itemizedlist>
<listitem>
<para>Value 0: If set to 0, only the gateways with state PROBING are tested.
After a gateway is probed, the PROBING state is cleared in this mode.
This means that no probing will be executed at all only if flag in config file is set to 8/PROBING
(please check destination list file syntaxis for more details), it will probe only one time at startup or
after dispatcher reload.</para>
</listitem>
<listitem>
<para>Value 1: If set to 1, all gateways are tested. If set to 1 and
there is a failure of keepalive to an active gateway, then it is
set to TRYING state. This means that probing will be executed all the time,
but you can skip some servers with flag 4 in destination list file, for example.</para>
</listitem>
<listitem>
<para>Value 2: if set to 2, only gateways in INACTIVE state with
PROBING mode set are tested.</para>
</listitem>
<listitem>
<para>Value 3: If set to 3, any gateway with state PROBING is continually probed
without modifying/removing the PROBING state. This allows selected gateways
to be probed continually, regardless of state changes.</para>
</listitem>
</itemizedlist>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_probing_mode</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_probing_mode", 1)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_ping_latency_stats">
<title><varname>ds_ping_latency_stats</varname> (int)</title>
<para>
Enable latency measurement when pinging nodes
</para>
<itemizedlist>
<listitem>
<para>If set to 0, disable latency measurement.</para>
</listitem>
<listitem>
<para>If set to 1, enable latency measurement.
</para>
</listitem>
</itemizedlist>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>accessing the metrics</title>
<programlisting format="linespecific">
# using the command :
kamcmd dispatcher.list
...
DEST: {
URI: sip:1.2.3.4
FLAGS: AX
PRIORITY: 9
LATENCY: {
AVG: 24.250000 # weighted moving average for the last few weeks
STD: 1.035000 # standard deviation of AVG
EST: 25.000000 # short term estimate, see parameter: ds_latency_estimator_alpha
MAX: 26 # maximum value seen
TIMEOUT: 0 # count of ping timeouts
}
}
...
</programlisting>
</example>
<example>
<title>Set the <quote>ds_ping_latency_stats</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_ping_latency_stats", 1)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_latency_estimator_alpha">
<title><varname>ds_latency_estimator_alpha</varname> (int)</title>
<para>
The value to be used to control the memory of the estimator EWMA "exponential weighted moving average" or
"the speed at which the older samples are dampened"
a good explanation can be found here : http://www.itl.nist.gov/div898/handbook/pmc/section3/pmc324.htm
Because Kamailio doesn't support float parameter types, the value in the parameter is divided by 1000 and stored as float.
For example, if you want to set the alpha to be 0.75, use value 750 here.
</para>
<para>
<emphasis>
Default value is <quote>900 => 0.9</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_hash_size</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_latency_estimator_alpha", 900)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_hash_size">
<title><varname>ds_hash_size</varname> (int)</title>
<para>
The value to be used as power of two to set the number of slots
to hash table storing data for call load dispatching (e.g., value
8 will create a hash table with 256 slots).
It must be greater than 0 to enable call load dispatching feature
(alg 10).
</para>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_hash_size</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_hash_size", 9)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_hash_expire">
<title><varname>ds_hash_expire</varname> (int)</title>
<para>
Expiration time in seconds to remove the load on a destination if no
BYE was received meanwhile.
</para>
<para>
<emphasis>
Default value is <quote>7200</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_hash_expire</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_hash_expire", 3600)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_hash_initexpires">
<title><varname>ds_hash_initexpire</varname> (int)</title>
<para>
Expiration time in seconds to remove the load on a destination if no
200 for INVITE was received meanwhile and state updated with
ds_load_update().
</para>
<para>
<emphasis>
Default value is <quote>7200</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_hash_initexpire</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_hash_initexpire", 60)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_hash_check_interval">
<title><varname>ds_hash_check_interval</varname> (int)</title>
<para>
Time interval in seconds to scan internal hash table with call load
dispatching data for expired items.
</para>
<para>
<emphasis>
Default value is <quote>30</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_hash_check_interval</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_hash_check_interval", 60)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.outbound_proxy">
<title><varname>outbound_proxy</varname> (str)</title>
<para>
SIP URI of outbound proxy to be used when sending pings.
</para>
<para>
<emphasis>
By default no outbound proxy is defined.
</emphasis>
</para>
<example>
<title>Set the <quote>outbound_proxy</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "outbound_proxy", "sip:outbound.example.com")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_default_socket">
<title><varname>ds_default_socket</varname> (str)</title>
<para>
Default socket to be used for sending pings and dispatching requests
when a gateway has no send socket configured.
</para>
<para>
<emphasis>
By default no default socket is defined, the first configuration
script <emphasis>listen</emphasis> directive is used.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_default_socket</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_default_socket", "udp:192.168.0.125:5060")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_timer_mode">
<title><varname>ds_timer_mode</varname> (int)</title>
<para>
Specify the timer process to be used by the module for
keepalives and active dialogs tracking.
</para>
<para>
It can be set to:
</para>
<itemizedlist>
<listitem>
<para>0 - use main timer process.</para>
</listitem>
<listitem>
<para>1 - use secondary timer process.</para>
</listitem>
</itemizedlist>
<para>
On a server with a lot of traffic, using secondary
timer can help with performances, because the main timer
can be overloaded by taking care of transactions retransmissions
and expirations of items in memory.
</para>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_timer_mode</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_timer_mode", 1)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.event_callback">
<title><varname>event_callback</varname> (str)</title>
<para>
The name of the function in the kemi configuration file (embedded
scripting language such as Lua, Python, ...) to be executed instead
of event_route[...] blocks.
</para>
<para>
The function receives a string parameter with the name of the event,
the values are: 'dispatcher:dst-down', 'dispatcher:dst-up'.
</para>
<para>
<emphasis>
Default value is 'empty' (no function is executed for events).
</emphasis>
</para>
<example>
<title>Set <varname>event_callback</varname> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "event_callback", "ksr_dispatcher_event")
...
-- event callback function implemented in Lua
function ksr_dispatcher_event(evname)
KSR.info("===== dispatcher module triggered event: " .. evname .. "\n");
return 1;
end
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_attrs_none">
<title><varname>ds_attrs_none</varname> (int)</title>
<para>
If set to 1, "none=yes" is set in the attrs for those records that
have no attrs value, to ensure that corresponding XAVP fields for
records do not get mixed up.
</para>
<para>
<emphasis>
Default value is <quote>0</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_attrs_none</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_attrs_none", 1)
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_db_extra_attrs">
<title><varname>ds_db_extra_attrs</varname> (str)</title>
<para>
Set a list of column names to be loaded from database dispatcher table
and be concatenated to 'attrs' field. The format is:
'aname1=cname1;aname2=cname2;...;anameN=cnameN'.
</para>
<para>
The 'anameX' is the attribute name and 'cnameX' is column name. The
additional columns must be added to database dispatcher table and their
type must be VARCHAR (string).
</para>
<para>
<emphasis>
Default value is <quote>empty</quote>.
</emphasis>
</para>
<example>
<title>Set the <quote>ds_db_extra_attrs</quote> parameter</title>
<programlisting format="linespecific">
...
modparam("dispatcher", "ds_db_extra_attrs", "socket=socket;pref=prefix")
...
</programlisting>
</example>
</section>
<section id="dispatcher.p.ds_load_mode">
<title><varname>ds_load_mode</varname> (int)</title>
<para>
If set to 1, the module throws error when failing to add a destination