/
README
2246 lines (1696 loc) · 65.6 KB
/
README
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
dialog Module
Bogdan-Andrei Iancu
Voice Sistem SRL
Carsten Bock
ng-voice.com
Edited by
Bogdan-Andrei Iancu
Carsten Bock
Alex Balashov
<abalashov@evaristesys.com>
Olle E. Johansson
<oej@edvina.net>
Copyright © 2006 Voice Sistem SRL
Copyright © 2011 Carsten Bock, http://www.ng-voice.com
__________________________________________________________________
Table of Contents
1. Admin Guide
1. Overview
2. How it works
3. Dialog states
4. Dialog profiling
5. Dependencies
5.1. Kamailio Modules
5.2. External Libraries or Applications
6. Parameters
6.1. enable_stats (integer)
6.2. hash_size (integer)
6.3. rr_param (string)
6.4. dlg_flag (integer)
6.5. timeout_avp (string)
6.6. default_timeout (integer)
6.7. early_timeout (integer)
6.8. noack_timeout (integer)
6.9. end_timeout (integer)
6.10. dlg_extra_hdrs (string)
6.11. dlg_match_mode (integer)
6.12. detect_spirals (integer)
6.13. db_url (string)
6.14. db_mode (integer)
6.15. db_update_period (integer)
6.16. db_fetch_rows (integer)
6.17. db_skip_load (integer)
6.18. table_name (string)
6.19. call_id_column (string)
6.20. from_uri_column (string)
6.21. from_tag_column (string)
6.22. to_uri_column (string)
6.23. to_tag_column (string)
6.24. from_cseq_column (string)
6.25. to_cseq_column (string)
6.26. from_route_column (string)
6.27. to_route_column (string)
6.28. from_contact_column (string)
6.29. to_contact_column (string)
6.30. from_sock_column (string)
6.31. to_sock_column (string)
6.32. h_id_column (string)
6.33. h_entry_column (string)
6.34. state_column (string)
6.35. start_time_column (string)
6.36. timeout_column (string)
6.37. sflags_column (string)
6.38. toroute_name_column (string)
6.39. vars_table_name (string)
6.40. vars_h_id_column (string)
6.41. vars_h_entry_column (string)
6.42. vars_key_column (string)
6.43. vars_value_column (string)
6.44. profiles_with_value (string)
6.45. profiles_no_value (string)
6.46. bridge_controller (string)
6.47. bridge_contact (string)
6.48. initial_cbs_inscript (int)
6.49. send_bye (int)
6.50. wait_ack (int)
6.51. ka_timer (int)
6.52. ka_interval (int)
6.53. ka_failed_limit (int)
6.54. timeout_noreset (int)
6.55. timer_procs (int)
6.56. enable_dmq (int)
6.57. track_cseq_updates (int)
6.58. lreq_callee_headers (string)
6.59. event_callback (str)
6.60. h_id_start (int)
6.61. h_id_step (int)
7. Functions
7.1. set_dlg_profile(profile,[value])
7.2. unset_dlg_profile(profile,[value])
7.3. is_in_profile(profile,[value])
7.4. get_profile_size(profile,[value],size)
7.5. dlg_isflagset(flag)
7.6. dlg_setflag(flag)
7.7. dlg_resetflag(flag)
7.8. dlg_bye(side)
7.9. dlg_refer(side, address)
7.10. dlg_manage()
7.11. dlg_bridge(from, to, op)
7.12. dlg_get(callid, ftag, ttag)
7.13. is_known_dlg()
7.14. dlg_set_timeout(timeout [, h_entry, h_id])
7.15. dlg_set_timeout_by_profile(profile, [value], timeout)
7.16. dlg_set_property(attr)
7.17. dlg_remote_profile(cmd, profile, value, uid, expires)
7.18. dlg_set_ruri()
7.19. dlg_db_load_callid(cival)
7.20. dlg_db_load_extra()
8. Statistics
8.1. active_dialogs
8.2. early_dialogs
8.3. processed_dialogs
8.4. expired_dialogs
8.5. failed_dialogs
9. RPC Commands
9.1. dlg.list
9.2. dlg.list_ctx
9.3. dlg.dlg_list
9.4. dlg.dlg_list_ctx
9.5. dlg.terminate_dlg
9.6. dlg.end_dlg
9.7. dlg.profile_get_size
9.8. dlg.profile_list
9.9. dlg.bridge_dlg
9.10. dlg.stats_active
10. Exported Variables
10.1. $DLG_count
10.2. $DLG_status
10.3. $DLG_lifetime
10.4. $dlg(...)
10.5. $dlg_ctx(...)
10.6. $dlg_var(key)
11. Event Routes
11.1. event_route[dialog:start]
11.2. event_route[dialog:end]
11.3. event_route[dialog:failed]
2. Developer Guide
1. Available Functions
1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
1.2. terminate_dlg (dlg, hdrs)
3. Frequently Asked Questions
List of Examples
1.1. Set enable_stats parameter
1.2. Set hash_size parameter
1.3. Set rr_param parameter
1.4. Set dlg_flag parameter
1.5. Set timeout_avp parameter
1.6. Set default_timeout parameter
1.7. Set early_timeout parameter
1.8. Set noack_timeout parameter
1.9. Set end_timeout parameter
1.10. Set dlf_extra_hdrs parameter
1.11. Set dlg_match_mode parameter
1.12. Set detect_spirals parameter
1.13. Set db_url parameter
1.14. Set db_mode parameter
1.15. Set db_update_period parameter
1.16. Set db_fetch_rows parameter
1.17. Set db_skip_load parameter
1.18. Set table_name parameter
1.19. Set call_id_column parameter
1.20. Set from_uri_column parameter
1.21. Set from_tag_column parameter
1.22. Set to_uri_column parameter
1.23. Set to_tag_column parameter
1.24. Set from_cseq_column parameter
1.25. Set to_cseq_column parameter
1.26. Set from_route_column parameter
1.27. Set to_route_column parameter
1.28. Set from_contact_column parameter
1.29. Set to_contact_column parameter
1.30. Set from_sock_column parameter
1.31. Set to_sock_column parameter
1.32. Set h_id_column parameter
1.33. Set h_entry_column parameter
1.34. Set state_column parameter
1.35. Set start_time_column parameter
1.36. Set timeout_column parameter
1.37. Set sflags_column parameter
1.38. Set toroute_name_column parameter
1.39. Set vars_table_name parameter
1.40. Set vars_h_id_column parameter
1.41. Set vars_h_entry_column parameter
1.42. Set vars_key_column parameter
1.43. Set vars_value_column parameter
1.44. Set profiles_with_value parameter
1.45. Set profiles_no_value parameter
1.46. Set bridge_controller parameter
1.47. Set bridge_contact parameter
1.48. Set initial_cbs_inscript parameter
1.49. Set send_bye parameter
1.50. Set wait_ack parameter
1.51. Set ka_timer parameter
1.52. Set ka_interval parameter
1.53. Set ka_failed_limit parameter
1.54. Set timeout_noreset parameter
1.55. Set timer_procs parameter
1.56. Set enable_dmq parameter
1.57. Set track_cseq_updates parameter
1.58. Set lreq_callee_headers parameter
1.59. Set event_callback parameter
1.60. Set h_id_start parameter
1.61. Set h_id_step parameter
1.62. set_dlg_profile usage
1.63. unset_dlg_profile usage
1.64. is_in_profile usage
1.65. get_profile_size usage
1.66. dlg_isflagset usage
1.67. dlg_setflag usage
1.68. dlg_resetflag usage
1.69. dlg_bye usage
1.70. dlg_refer usage
1.71. dlg_manage usage
1.72. dlg_bridge usage
1.73. dlg_get usage
1.74. is_known_dlg() usage
1.75. dlg_set_timeout usage
1.76. dlg_set_timeout_by_profile usage
1.77. dlg_set_property usage
1.78. dlg_remote_profile usage
1.79. dlg_set_ruri() usage
1.80. dlg_db_load_callid() usage
1.81. dlg_db_load_extra() usage
Chapter 1. Admin Guide
Table of Contents
1. Overview
2. How it works
3. Dialog states
4. Dialog profiling
5. Dependencies
5.1. Kamailio Modules
5.2. External Libraries or Applications
6. Parameters
6.1. enable_stats (integer)
6.2. hash_size (integer)
6.3. rr_param (string)
6.4. dlg_flag (integer)
6.5. timeout_avp (string)
6.6. default_timeout (integer)
6.7. early_timeout (integer)
6.8. noack_timeout (integer)
6.9. end_timeout (integer)
6.10. dlg_extra_hdrs (string)
6.11. dlg_match_mode (integer)
6.12. detect_spirals (integer)
6.13. db_url (string)
6.14. db_mode (integer)
6.15. db_update_period (integer)
6.16. db_fetch_rows (integer)
6.17. db_skip_load (integer)
6.18. table_name (string)
6.19. call_id_column (string)
6.20. from_uri_column (string)
6.21. from_tag_column (string)
6.22. to_uri_column (string)
6.23. to_tag_column (string)
6.24. from_cseq_column (string)
6.25. to_cseq_column (string)
6.26. from_route_column (string)
6.27. to_route_column (string)
6.28. from_contact_column (string)
6.29. to_contact_column (string)
6.30. from_sock_column (string)
6.31. to_sock_column (string)
6.32. h_id_column (string)
6.33. h_entry_column (string)
6.34. state_column (string)
6.35. start_time_column (string)
6.36. timeout_column (string)
6.37. sflags_column (string)
6.38. toroute_name_column (string)
6.39. vars_table_name (string)
6.40. vars_h_id_column (string)
6.41. vars_h_entry_column (string)
6.42. vars_key_column (string)
6.43. vars_value_column (string)
6.44. profiles_with_value (string)
6.45. profiles_no_value (string)
6.46. bridge_controller (string)
6.47. bridge_contact (string)
6.48. initial_cbs_inscript (int)
6.49. send_bye (int)
6.50. wait_ack (int)
6.51. ka_timer (int)
6.52. ka_interval (int)
6.53. ka_failed_limit (int)
6.54. timeout_noreset (int)
6.55. timer_procs (int)
6.56. enable_dmq (int)
6.57. track_cseq_updates (int)
6.58. lreq_callee_headers (string)
6.59. event_callback (str)
6.60. h_id_start (int)
6.61. h_id_step (int)
7. Functions
7.1. set_dlg_profile(profile,[value])
7.2. unset_dlg_profile(profile,[value])
7.3. is_in_profile(profile,[value])
7.4. get_profile_size(profile,[value],size)
7.5. dlg_isflagset(flag)
7.6. dlg_setflag(flag)
7.7. dlg_resetflag(flag)
7.8. dlg_bye(side)
7.9. dlg_refer(side, address)
7.10. dlg_manage()
7.11. dlg_bridge(from, to, op)
7.12. dlg_get(callid, ftag, ttag)
7.13. is_known_dlg()
7.14. dlg_set_timeout(timeout [, h_entry, h_id])
7.15. dlg_set_timeout_by_profile(profile, [value], timeout)
7.16. dlg_set_property(attr)
7.17. dlg_remote_profile(cmd, profile, value, uid, expires)
7.18. dlg_set_ruri()
7.19. dlg_db_load_callid(cival)
7.20. dlg_db_load_extra()
8. Statistics
8.1. active_dialogs
8.2. early_dialogs
8.3. processed_dialogs
8.4. expired_dialogs
8.5. failed_dialogs
9. RPC Commands
9.1. dlg.list
9.2. dlg.list_ctx
9.3. dlg.dlg_list
9.4. dlg.dlg_list_ctx
9.5. dlg.terminate_dlg
9.6. dlg.end_dlg
9.7. dlg.profile_get_size
9.8. dlg.profile_list
9.9. dlg.bridge_dlg
9.10. dlg.stats_active
10. Exported Variables
10.1. $DLG_count
10.2. $DLG_status
10.3. $DLG_lifetime
10.4. $dlg(...)
10.5. $dlg_ctx(...)
10.6. $dlg_var(key)
11. Event Routes
11.1. event_route[dialog:start]
11.2. event_route[dialog:end]
11.3. event_route[dialog:failed]
1. Overview
Kamailio can behave as a stateful proxy through the TM module. However,
"stateful" in this context refers to transaction state, not dialog
state. Certain applications may benefit from an awareness of "calls" in
the proxy, not just SIP transactions.
For example, a common need is to limit the number of calls that can be
made concurrently by an endpoint, account, user group, etc. In order to
count the number of calls in progress, it is necessary for the proxy to
be aware of whole dialogs, not just transactions, and to provide some
means of programmatically classifying these dialogs. This is just one
common application discussed for illustrative purposes; there are many
others.
The dialog module provides dialog awareness for the Kamailio proxy.
It's functionality is to keep track of the current dialogs, to offer
information about them (e.g. how many dialogs are active), and to
manage various characteristics of dialogs. The module exports several
functions that can be used directly from the configuration route script
as well as functions for the RPC interface.
This module also provides a API foundation on which to build more
complex dialog-oriented functionality in other Kamailio modules.
2. How it works
To create the dialog associated with an initial INVITE request, execute
the function “dlg_manage()” or set the flag specified by parameter
“dlg_flag” (Section 6.4, “dlg_flag (integer)”) before creating the
corresponding transaction.
The dialog is automatically destroyed when a “BYE” is received. In case
of no “BYE”, the dialog lifetime is controlled via the default timeout
(see “default_timeout” - Section 6.6, “default_timeout (integer)”) and
custom timeout (see “timeout_avp” - Section 6.5, “timeout_avp
(string)”). The dialog timeout is reset each time a sequential request
is processed.
3. Dialog states
Dialogs have states that are shown in the RPC interface as well as
stored in the database.
* 1 : Unconfirmed dialog
* 2 : Early dialog (ringing)
* 3 : Confirmed dialog (waiting for ACK)
* 4 : Confirmed dialog (active call)
* 5 : Deleted dialog
The early and deleted dialog states are not updated in database
storage.
4. Dialog profiling
Dialog profiling is a mechanism that helps in classifying, sorting and
keeping track of certain types of dialogs. The classification criteria
can be any attributes desired by the administrator; it can be SIP
message attributes, other pseudo-variables, custom values, etc. Dialogs
can be dynamically added into one or more profile tables. Logically,
each profile table can have a special meaning (like dialogs outside the
domain, dialogs terminated to the PSTN, etc.).
There are two types of profiles:
* with no value - a dialog simply belongs to a profile (for instance,
an outbound calls profile). There is no other additional
information to describe the dialog beyond its membership in the
profile per se.
* with value - a dialog belongs to a profile having a certain value
(like in a caller profile, where the value is the caller ID). The
membership of the dialog in the profile is strictly related to the
value. For example, if the account ID of the caller is stored in
the pseudo-variable $var(account_id), you can use $var(account_id)
as a value/key by which to group dialogs so that you can count the
number of open dialogs for each account, enforce concurrent call
limits as necessary, etc.
A dialog can be added to multiple profiles at the same time.
Profiles are visible (at the moment) in the request route (for initial
and sequential requests) and in the branch, failure and reply routes of
the original request.
5. Dependencies
5.1. Kamailio Modules
5.2. External Libraries or Applications
5.1. Kamailio Modules
The following modules must be loaded before this module:
* TM - Transaction module
* RR - Record-Route module
* PV - Pseudovariables module
5.2. External Libraries or Applications
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* None.
6. Parameters
6.1. enable_stats (integer)
6.2. hash_size (integer)
6.3. rr_param (string)
6.4. dlg_flag (integer)
6.5. timeout_avp (string)
6.6. default_timeout (integer)
6.7. early_timeout (integer)
6.8. noack_timeout (integer)
6.9. end_timeout (integer)
6.10. dlg_extra_hdrs (string)
6.11. dlg_match_mode (integer)
6.12. detect_spirals (integer)
6.13. db_url (string)
6.14. db_mode (integer)
6.15. db_update_period (integer)
6.16. db_fetch_rows (integer)
6.17. db_skip_load (integer)
6.18. table_name (string)
6.19. call_id_column (string)
6.20. from_uri_column (string)
6.21. from_tag_column (string)
6.22. to_uri_column (string)
6.23. to_tag_column (string)
6.24. from_cseq_column (string)
6.25. to_cseq_column (string)
6.26. from_route_column (string)
6.27. to_route_column (string)
6.28. from_contact_column (string)
6.29. to_contact_column (string)
6.30. from_sock_column (string)
6.31. to_sock_column (string)
6.32. h_id_column (string)
6.33. h_entry_column (string)
6.34. state_column (string)
6.35. start_time_column (string)
6.36. timeout_column (string)
6.37. sflags_column (string)
6.38. toroute_name_column (string)
6.39. vars_table_name (string)
6.40. vars_h_id_column (string)
6.41. vars_h_entry_column (string)
6.42. vars_key_column (string)
6.43. vars_value_column (string)
6.44. profiles_with_value (string)
6.45. profiles_no_value (string)
6.46. bridge_controller (string)
6.47. bridge_contact (string)
6.48. initial_cbs_inscript (int)
6.49. send_bye (int)
6.50. wait_ack (int)
6.51. ka_timer (int)
6.52. ka_interval (int)
6.53. ka_failed_limit (int)
6.54. timeout_noreset (int)
6.55. timer_procs (int)
6.56. enable_dmq (int)
6.57. track_cseq_updates (int)
6.58. lreq_callee_headers (string)
6.59. event_callback (str)
6.60. h_id_start (int)
6.61. h_id_step (int)
6.1. enable_stats (integer)
If statistics support should be enabled or not. Via statistics
variables, the module provide information about the dialog processing.
Set it to zero to disable or to non-zero to enable it.
Default value is “1 (enabled)”.
Example 1.1. Set enable_stats parameter
...
modparam("dialog", "enable_stats", 0)
...
6.2. hash_size (integer)
The size of the hash table internally used to keep the dialogs. A
larger table is much faster but consumes more memory. The hash size
must be a power of two.
IMPORTANT: If dialog information should be stored in a database, a
constant hash_size should be used, otherwise the restoring process will
not take place. If you really want to modify the hash_size, you must
delete all table's rows before restarting the server.
Default value is “4096”.
Example 1.2. Set hash_size parameter
...
modparam("dialog", "hash_size", 1024)
...
6.3. rr_param (string)
Name of the Record-Route parameter used to store the dialog cookie. It
is used for the fast matching of sequential requests to tracked
dialogs.
Default value is “did”.
Example 1.3. Set rr_param parameter
...
modparam("dialog", "rr_param", "xyz")
...
6.4. dlg_flag (integer)
Flag to be used for marking if a dialog should be constructed for the
current request (this make sense only for initial requests).
Note: it is not needed to set this parameter and its corresponding flag
for initial request in case the “dlg_manage()” function is used. In
other words, using “dlg_manage()” alone is enough.
Default value is “none”.
Example 1.4. Set dlg_flag parameter
...
modparam("dialog", "dlg_flag", 4)
...
6.5. timeout_avp (string)
The specification of an AVP that contains a custom timeout value (in
seconds) for the dialog. It may be used only in a request (initial or
sequential) context.
Default value is “none”.
Example 1.5. Set timeout_avp parameter
...
modparam("dialog", "timeout_avp", "$avp(i:10)")
...
6.6. default_timeout (integer)
The default dialog timeout (in seconds), in the absence of a custom
value provided in an AVP.
Default value is “43200 (12 hours)”.
Example 1.6. Set default_timeout parameter
...
modparam("dialog", "default_timeout", 21600)
...
6.7. early_timeout (integer)
The timeout (in seconds) after which the dialogs in unconfirmed or
early state (no final response received) are destroyed.
Default value is “300 (5 minutes)”.
Example 1.7. Set early_timeout parameter
...
modparam("dialog", "early_timeout", 180)
...
6.8. noack_timeout (integer)
The timeout (in seconds) after which the dialogs which were answered
with 200ok but didn't receive the ACK are marked for termination (the
lifetime is set to 10 more seconds).
Default value is “60 (1 minute)”.
Example 1.8. Set noack_timeout parameter
...
modparam("dialog", "noack_timeout", 90)
...
6.9. end_timeout (integer)
The timeout (in seconds) after which the dialogs in terminated state
are destroyed.
Default value is “300 (5 minutes)”.
Example 1.9. Set end_timeout parameter
...
modparam("dialog", "end_timeout", 180)
...
6.10. dlg_extra_hdrs (string)
A string containing the extra headers (full format, with EOH) to be
added to requests generated locally by the module (like BYEs).
Default value is “NULL”.
Example 1.10. Set dlf_extra_hdrs parameter
...
modparam("dialog", "dlg_extra_hdrs", "Hint: credit expired\r\n")
...
6.11. dlg_match_mode (integer)
How the sequential requests should be matched against the known
dialogs. The modes are a combination of matching based on a cookie
(DID) stored as cookie in Record-Route header and matching based on SIP
elements (as in RFC 3261).
Note: DID-based matching does not replace callid/fromtag/totag
comparison. It will speed up dialog matching by not iterating over the
whole dialog list for callid/fromtag/totag comparison, but instead it
uses a hash table to find the respective dialog and then doing only one
callid/fromtag/totag comparison. Thus, there is no security issue when
using DID based matching. Use DID_FALLBACK for maximum interoperability
or use DID_ONLY to reject buggy clients or hacking attempts. DID_NONE
is only useful, when you want to hide dialog-tracking from the users
(preventing the DID Record-Route cookie).
The supported modes are:
* 0 - DID_ONLY - the match is done exclusively based on DID;
* 1 - DID_FALLBACK - the match is first tried based on DID and if not
present, it will fall back to SIP matching;
* 2 - DID_NONE - the match is done exclusively based on SIP elements;
no DID information is added in RR.
Default value is “0 (DID_ONLY)”.
Example 1.11. Set dlg_match_mode parameter
...
modparam("dialog", "dlg_match_mode", 1)
...
6.12. detect_spirals (integer)
Whether spirals (i.e., messages routed through the proxy multiple
times) should be detected.
If set to 0, spirals will not be detected and result in the generation
of a new, possibly dangling dialog structure per occurring spiral. If
set to 1, spirals are detected and internally mapped to existing dialog
structures.
Default value is 1.
Example 1.12. Set detect_spirals parameter
...
modparam("dialog", "detect_spirals", 1)
...
6.13. db_url (string)
In order to store information about dialogs in a database, a database
URL must be specified.
Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”.
Example 1.13. Set db_url parameter
...
modparam("dialog", "db_url", "dbdriver://username:password@dbhost/dbname")
...
6.14. db_mode (integer)
Mode of synchronisation of dialog information from memory to an
underlying database (if desired):
The supported modes are:
* 0 - NO_DB - the memory content is not flushed into DB;
* 1 - REALTIME - any dialog information changes will be reflected
into the database immediately.
* 2 - DELAYED - the dialog information changes will be flushed into
DB periodically, based on a timer routine.
* 3 - SHUTDOWN - the dialog information will be flushed into DB only
at shutdown - no runtime updates.
Default value is “0”.
Example 1.14. Set db_mode parameter
...
modparam("dialog", "db_mode", 1)
...
6.15. db_update_period (integer)
The interval (seconds) at which to update dialogs' information, if the
server is configured to store the dialog information at a given
interval. Too short an interval will generate intensive database
operations, while an excessively long one will miss dialogs with a
short lifetime.
Default value is “60” seconds.
Example 1.15. Set db_update_period parameter
...
modparam("dialog", "db_update_period", 120)
...
6.16. db_fetch_rows (integer)
The number of the rows to be fetched at once from database when loading
the dialog records at startup from the database. This value can be used
to tune the load time at startup. For 1MB of private memory (default),
it should be below 400. The database driver must support the
fetch_result() capability. A value of 0 means the database fetch is not
limited.
Default value is “200”.
Example 1.16. Set db_fetch_rows parameter
...
modparam("dialog", "db_fetch_rows", 500)
...
6.17. db_skip_load (integer)
Set db_skip_load to 1, to skip the loading of dialog data from the
database.
Default value is “0” ( not skipped ).
Example 1.17. Set db_skip_load parameter
...
modparam("dialog", "db_skip_load", 1)
...
6.18. table_name (string)
Database table name used for storing dialog information.
Default value is “dialog”.
Example 1.18. Set table_name parameter
...
modparam("dialog", "table_name", "my_dialog")
...
6.19. call_id_column (string)
The column name in the database to store the dialog call-id.
Default value is “callid”.
Example 1.19. Set call_id_column parameter
...
modparam("dialog", "call_id_column", "callid_c_name")
...
6.20. from_uri_column (string)
The column name in the database to store the caller's SIP address
(URI).
Default value is “from_uri”.
Example 1.20. Set from_uri_column parameter
...
modparam("dialog", "from_uri_column", "from_uri_c_name")
...
6.21. from_tag_column (string)
The column name in the database to store the From header tag from the
INVITE request.
Default value is “from_tag”.
Example 1.21. Set from_tag_column parameter
...
modparam("dialog", "from_tag_column", "from_tag_c_name")
...
6.22. to_uri_column (string)
The column name in the database to store the callee's SIP address
(URI).
Default value is “to_uri”.
Example 1.22. Set to_uri_column parameter
...
modparam("dialog", "to_uri_column", "to_uri_c_name")
...
6.23. to_tag_column (string)
The column name in the database to store the To header tag from the 200
OK response to the INVITE request, if present.
Default value is “to_tag”.
Example 1.23. Set to_tag_column parameter
...
modparam("dialog", "to_tag_column", "to_tag_c_name")
...
6.24. from_cseq_column (string)
The column name in the database to store the Cseq from caller side.
Default value is “caller_cseq”.
Example 1.24. Set from_cseq_column parameter
...
modparam("dialog", "from_cseq_column", "from_cseq")
...
6.25. to_cseq_column (string)
The column name in the database to store the cseq from callee side.
Default value is “callee_cseq”.
Example 1.25. Set to_cseq_column parameter
...
modparam("dialog", "to_cseq_column", "to_cseq")
...
6.26. from_route_column (string)
The column name in the database to store the route records from caller
side (proxy to caller).
Default value is “caller_route_set”.
Example 1.26. Set from_route_column parameter
...
modparam("dialog", "from_route_column", "rroute_from")
...
6.27. to_route_column (string)
The column name in the database to store the route records from callee
side (proxy to callee).
Default value is “callee_route_set”.
Example 1.27. Set to_route_column parameter
...
modparam("dialog", "to_route_column", "rroute_to")
...
6.28. from_contact_column (string)
The column name in the database to store the caller's contact uri.
Default value is “caller_contact”.
Example 1.28. Set from_contact_column parameter
...
modparam("dialog", "from_contact_column", "from_contact_uri")
...
6.29. to_contact_column (string)
The column name in the database to store the callee's contact uri.
Default value is “callee_contact”.
Example 1.29. Set to_contact_column parameter
...
modparam("dialog", "to_contact_column", "to_contact_uri")
...
6.30. from_sock_column (string)
The column name in the database to store the information about the
local interface receiving the traffic from caller.
Default value is “caller_sock”.
Example 1.30. Set from_sock_column parameter
...
modparam("dialog", "from_sock_column", "socket_from")
...
6.31. to_sock_column (string)
The column name in the database to store information about the local
interface receiving the traffic from callee.
Default value is “callee_sock”.
Example 1.31. Set to_sock_column parameter
...
modparam("dialog", "to_sock_column", "socket_to")
...
6.32. h_id_column (string)
The column name in the database to store the dialogs' hash id
information.
Default value is “hash_id”.
Example 1.32. Set h_id_column parameter
...
modparam("dialog", "h_id_column", "hash_id_c_name")
...
6.33. h_entry_column (string)
The column name in the database to store the dialog's hash entry
information.
Default value is “hash_entry”.
Example 1.33. Set h_entry_column parameter
...