-
Notifications
You must be signed in to change notification settings - Fork 908
/
README
1101 lines (800 loc) · 32.1 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
IMS_DIALOG Module
Bogdan-Andrei Iancu
Voice Sistem SRL
Carsten Bock
ng-voice GmbH
Jason Penton
Smile Communications
Richard Good
Smile Communications
Edited by
Bogdan-Andrei Iancu
Edited by
Carsten Bock
Edited by
Jason Penton
Edited by
Richard Good
Copyright © 2006 Voice Sistem SRL
Copyright © 2011-2013 Carsten Bock, http://www.ng-voice.com
__________________________________________________________________
Table of Contents
1. Admin Guide
1. Overview
2. How it works
3. Dialog profiling
4. Dependencies
4.1. Kamailio Modules
4.2. External Libraries or Applications
5. Parameters
5.1. enable_stats (integer)
5.2. hash_size (integer)
5.3. rr_param (string)
5.4. dlg_flag (integer)
5.5. timeout_avp (string)
5.6. default_timeout (integer)
5.7. dlg_extra_hdrs (string)
5.8. dlg_match_mode (integer)
5.9. detect_spirals (integer)
5.10. db_url (string)
5.11. db_mode (integer)
5.12. db_update_period (integer)
5.13. db_fetch_rows (integer)
5.14. table_name (string)
5.15. profiles_with_value (string)
5.16. profiles_no_value (string)
5.17. bridge_controller (string)
5.18. initial_cbs_inscript (string)
6. Functions
6.1. set_dlg_profile(profile,[value])
6.2. unset_dlg_profile(profile,[value])
6.3. is_in_profile(profile,[value])
6.4. get_profile_size(profile,[value],size)
6.5. dlg_isflagset(flag)
6.6. dlg_setflag(flag)
6.7. dlg_resetflag(flag)
6.8. dlg_terminate
6.9. dlg_refer(side, address)
6.10. dlg_manage()
6.11. dlg_bridge(from, to, op)
6.12. dlg_get(callid, ftag, ttag)
6.13. is_known_dlg()
7. Exported statistics
7.1. active_dialogs
7.2. early_dialogs
7.3. processed_dialogs
7.4. expired_dialogs
7.5. failed_dialogs
8. MI Commands
8.1. dlg_list
8.2. dlg_list_ctx
8.3. dlg_end_dlg
8.4. dlg_terminate_dlg
8.5. profile_get_size
8.6. profile_list_dlgs
8.7. dlg_bridge
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.end_dlg
9.6. dlg.profile_get_size
9.7. dlg.profile_list
9.8. dlg.bridge_dlg
10. Exported pseudo-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)
2. Developer Guide
1. Available Functions
1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)
1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned
int h_id, hdrs)
1.4. set_dlg_var (dlg, key, val)
1.5. get_dlg_var (dlg, key)
1.6. get_current_dialog ()
3. Frequently Asked Questions
List of Examples
1.1. Set hash_size parameter
1.2. Set rr_param parameter
1.3. Set dlg_flag parameter
1.4. Set timeout_avp parameter
1.5. Set default_timeout parameter
1.6. Set dlf_extra_hdrs parameter
1.7. Set detect_spirals parameter
1.8. Set profiles_with_value parameter
1.9. Set profiles_no_value parameter
1.10. Set bridge_controller parameter
1.11. set_dlg_profile usage
1.12. unset_dlg_profile usage
1.13. is_in_profile usage
1.14. get_profile_size usage
1.15. dlg_isflagset usage
1.16. dlg_setflag usage
1.17. dlg_resetflag usage
1.18. dlg_terminate usage
1.19. dlg_get usage
Chapter 1. Admin Guide
Table of Contents
1. Overview
2. How it works
3. Dialog profiling
4. Dependencies
4.1. Kamailio Modules
4.2. External Libraries or Applications
5. Parameters
5.1. enable_stats (integer)
5.2. hash_size (integer)
5.3. rr_param (string)
5.4. dlg_flag (integer)
5.5. timeout_avp (string)
5.6. default_timeout (integer)
5.7. dlg_extra_hdrs (string)
5.8. dlg_match_mode (integer)
5.9. detect_spirals (integer)
5.10. db_url (string)
5.11. db_mode (integer)
5.12. db_update_period (integer)
5.13. db_fetch_rows (integer)
5.14. table_name (string)
5.15. profiles_with_value (string)
5.16. profiles_no_value (string)
5.17. bridge_controller (string)
5.18. initial_cbs_inscript (string)
6. Functions
6.1. set_dlg_profile(profile,[value])
6.2. unset_dlg_profile(profile,[value])
6.3. is_in_profile(profile,[value])
6.4. get_profile_size(profile,[value],size)
6.5. dlg_isflagset(flag)
6.6. dlg_setflag(flag)
6.7. dlg_resetflag(flag)
6.8. dlg_terminate
6.9. dlg_refer(side, address)
6.10. dlg_manage()
6.11. dlg_bridge(from, to, op)
6.12. dlg_get(callid, ftag, ttag)
6.13. is_known_dlg()
7. Exported statistics
7.1. active_dialogs
7.2. early_dialogs
7.3. processed_dialogs
7.4. expired_dialogs
7.5. failed_dialogs
8. MI Commands
8.1. dlg_list
8.2. dlg_list_ctx
8.3. dlg_end_dlg
8.4. dlg_terminate_dlg
8.5. profile_get_size
8.6. profile_list_dlgs
8.7. dlg_bridge
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.end_dlg
9.6. dlg.profile_get_size
9.7. dlg.profile_list
9.8. dlg.bridge_dlg
10. Exported pseudo-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)
1. Overview
The ims_dialog module provides dialog awareness to the Kamailio proxy.
Its functionality is to keep track of the current dialogs, to offer
information about them (like how many dialogs are active) or to manage
them. The module exports several functions that could be used directly
from scripts. The ims_dialog module extends the original dialog module
by providing support for forked calling and early dialog termination.
It is the intention that the ims_dialog module will eventually replace
the dialog module.
The module, via an internal API, also provide the foundation to build
on top of it more complex dialog-based functionalities via other
Kamailio modules.
2. How it works
To create the dialog associated to an initial request, the flag
“dlg_flag” ( Section 5.4, “ dlg_flag (integer) ”) must be set 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 5.6, “ default_timeout (integer) ”)
and custom timeout (see “timeout_avp” - Section 5.5, “ timeout_avp
(string) ”). The dialog timeout is reset each time a sequential request
passes.
3. Dialog profiling
Dialog profiling is a mechanism that helps in classifying, sorting and
keeping trace of certain types of dialogs, using whatever properties of
the dialog (like caller, destination, type of calls, etc). Dialogs can
be dynamically added in different (and several) profile tables -
logically, each profile table can have a special meaning (like dialogs
outside the domain, dialogs terminated to PSTN, etc).
There are two types of profiles:
* with no value - a dialog simply belongs to a profile. (like
outbound calls profile). There is no other additional information
to describe the dialog's belonging to the profile;
* with value - a dialog belongs to a profile having a certain value
(like in caller profile, where the value is the caller ID). The
belonging of the dialog to the profile is strictly related to the
value.
A dialog can be added to multiple profiles in 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.
4. Dependencies
4.1. Kamailio Modules
4.2. External Libraries or Applications
4.1. Kamailio Modules
The following modules must be loaded before this module:
* TM - Transaction module
* RR - Record-Route module
4.2. External Libraries or Applications
The following libraries or applications must be installed before
running Kamailio with this module loaded:
* None.
5. Parameters
5.1. enable_stats (integer)
5.2. hash_size (integer)
5.3. rr_param (string)
5.4. dlg_flag (integer)
5.5. timeout_avp (string)
5.6. default_timeout (integer)
5.7. dlg_extra_hdrs (string)
5.8. dlg_match_mode (integer)
5.9. detect_spirals (integer)
5.10. db_url (string)
5.11. db_mode (integer)
5.12. db_update_period (integer)
5.13. db_fetch_rows (integer)
5.14. table_name (string)
5.15. profiles_with_value (string)
5.16. profiles_no_value (string)
5.17. bridge_controller (string)
5.18. initial_cbs_inscript (string)
5.1. enable_stats (integer)
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
5.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 number.
IMPORTANT: If dialogs' 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.1. Set hash_size parameter
...
modparam("ims_dialog", "hash_size", 1024)
...
5.3. rr_param (string)
Name of the Record-Route parameter to be added with the dialog cookie.
It is used for the fast dialog matching of sequential requests.
Default value is “did”.
Example 1.2. Set rr_param parameter
...
modparam("ims_dialog", "rr_param", "xyz")
...
5.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).
Default value is “none”.
Example 1.3. Set dlg_flag parameter
...
modparam("ims_dialog", "dlg_flag", 4)
...
5.5. timeout_avp (string)
The specification of an AVP that contain a custom timeout (in seconds)
for the dialog. It may be used only in a request (initial or
sequential) context
Default value is “none”.
Example 1.4. Set timeout_avp parameter
...
modparam("ims_dialog", "timeout_avp", "$avp(i:10)")
...
5.6. default_timeout (integer)
The default dialog timeout (in seconds) if no custom one is set.
Default value is “43200 (12 hours)”.
Example 1.5. Set default_timeout parameter
...
modparam("ims_dialog", "default_timeout", 21600)
...
5.7. dlg_extra_hdrs (string)
A string containing the extra headers (full format, with EOH) to be
added in the requests generated by the module (like BYEs).
Default value is “NULL”.
Example 1.6. Set dlf_extra_hdrs parameter
...
modparam("ims_dialog", "dlg_extra_hdrs", "Hint: credit expired\r\n")
...
5.8. dlg_match_mode (integer)
Deprecated - in the new dialog module we always match using DID ONLY
5.9. detect_spirals (integer)
Whether spirals (i.e., messages routed through the proxy multiple
times) should be detected or not.
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.7. Set detect_spirals parameter
...
modparam("ims_dialog", "detect_spirals", 1)
...
5.10. db_url (string)
Db storage not yet supported by ims_dialog - this to be done in future.
5.11. db_mode (integer)
Db storage not yet supported by ims_dialog - this to be done in future.
5.12. db_update_period (integer)
Db storage not yet supported by ims_dialog - this to be done in future.
5.13. db_fetch_rows (integer)
Db storage not yet supported by ims_dialog - this to be done in future.
5.14. table_name (string)
Db storage not yet supported by ims_dialog - this to be done in future.
5.15. profiles_with_value (string)
List of names for profiles with values.
Default value is “empty”.
Example 1.8. Set profiles_with_value parameter
...
modparam("dialog", "profiles_with_value", "caller ; my_profile")
...
5.16. profiles_no_value (string)
List of names for profiles without values.
Default value is “empty”.
Example 1.9. Set profiles_no_value parameter
...
modparam("dialog", "profiles_no_value", "inbound ; outbound")
...
5.17. bridge_controller (string)
SIP address to be used in From header when initiating a call bridge.
Default value is “sip:controller@kamailio.org”.
Example 1.10. Set bridge_controller parameter
...
modparam("dialog", "bridge_controller", "sip:ctd@kamailio.org")
...
5.18. initial_cbs_inscript (string)
This has been deprecated since dlg_manage has been removed.
6. Functions
6.1. set_dlg_profile(profile,[value])
6.2. unset_dlg_profile(profile,[value])
6.3. is_in_profile(profile,[value])
6.4. get_profile_size(profile,[value],size)
6.5. dlg_isflagset(flag)
6.6. dlg_setflag(flag)
6.7. dlg_resetflag(flag)
6.8. dlg_terminate
6.9. dlg_refer(side, address)
6.10. dlg_manage()
6.11. dlg_bridge(from, to, op)
6.12. dlg_get(callid, ftag, ttag)
6.13. is_known_dlg()
6.1. set_dlg_profile(profile,[value])
Inserts the current dialog into a profile. Note that if the profile
does not supports values, this will be silently discarded. Also, there
is no check for inserting the same dialog in the same profile for
multiple times.
Meaning of the parameters is as follows:
* profile - name of the profile to be added to;
* value (optional) - string value to define the belonging of the
dialog to the profile - note that the profile must support values.
Pseudo-variables are supported.
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
Example 1.11. set_dlg_profile usage
...
set_dlg_profile("inbound_call");
set_dlg_profile("caller","$fu");
...
6.2. unset_dlg_profile(profile,[value])
Removes the current dialog from a profile.
Meaning of the parameters is as follows:
* profile - name of the profile to be removed from;
* value (optional) - string value to define the belonging of the
dialog to the profile - note that the profile must support values.
Pseudo-variables are supported.
This function can be used from BRANCH_ROUTE, REPLY_ROUTE and
FAILURE_ROUTE.
Example 1.12. unset_dlg_profile usage
...
unset_dlg_profile("inbound_call");
unset_dlg_profile("caller","$fu");
...
6.3. is_in_profile(profile,[value])
Checks if the current dialog belongs to a profile. If the profile
supports values, the check can be reinforced to take into account a
specific value - if the dialog was inserted into the profile for a
specific value. If no value is passed, only the simply belonging of the
dialog to the profile is checked. Note that if the profile does not
supports values, this will be silently discarded.
Meaning of the parameters is as follows:
* profile - name of the profile to be checked against;
* value (optional) - string value to further restrict the check.
Pseudo-variables are supported.
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
Example 1.13. is_in_profile usage
...
if (is_in_profile("inbound_call")) {
log("this request belongs to a inbound call\n");
}
...
if (is_in_profile("caller","XX")) {
log("this request belongs to a call of user XX\n");
}
...
6.4. get_profile_size(profile,[value],size)
Returns the number of dialogs belonging to a profile. If the profile
supports values, the check can be reinforced to take into account a
specific value - how many dialogs were inserted into the profile with a
specific value. If no value is passed, only simply belonging of the
dialog to the profile is checked. Note that if the profile does not
supports values, this will be silently discarded.
Meaning of the parameters is as follows:
* profile - name of the profile to get the size for;
* value (optional) - string value to further restrict the check.
Pseudo-variables are supported;
* size - an AVP or script variable to return the profile size in.
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
and FAILURE_ROUTE.
Example 1.14. get_profile_size usage
...
if(get_profile_size("inbound_call","$avp(size)"))
xlog("currently there are $avp(size) inbound calls\n");
...
if(get_profile_size("caller","$fu","$avp(size)"))
xlog("currently, the user $fu has $avp(size) active outgoing calls\n");
...
6.5. dlg_isflagset(flag)
Check if the dialog flag is set or not.
Meaning of the parameters is as follows:
* flag - index of the flag - can be pseudo-variable.
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
Example 1.15. dlg_isflagset usage
...
if(dlg_isflagset("1"))
{
...
}
...
6.6. dlg_setflag(flag)
Set the dialog flag.
Meaning of the parameters is as follows:
* flag - index of the flag - can be pseudo-variable.
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
Example 1.16. dlg_setflag usage
...
dlg_setflag("1");
...
6.7. dlg_resetflag(flag)
Reset the dialog flag.
Meaning of the parameters is as follows:
* flag - index of the flag - can be pseudo-variable.
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
Example 1.17. dlg_resetflag usage
...
redlg_setflag("1");
...
6.8. dlg_terminate
Terminates a dialog. In ims_dialog module this function now includes
support for early as well as confirmed dialogs.
Meaning of the parameters is as follows:
* side - which side to terminate. It can be: caller, callee or both
of them.
* reason - reason for termination.
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
Example 1.18. dlg_terminate usage
...
dlg_terminate("all", "Insufficient QoS");
...
6.9. dlg_refer(side, address)
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
6.10. dlg_manage()
This has been deprecated in ims_dialog. Instead set dialog flag for
initial INVITE and Route-parameter-callback execution for within-dialog
requests.
6.11. dlg_bridge(from, to, op)
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
6.12. dlg_get(callid, ftag, ttag)
Search and set current dialog based on Call-ID, From-Tag and To-Tag
parameters.
Meaning of the parameters is as follows:
* callid - SIP call-id.
* ftag - SIP From tag.
* ttag - SIP To tag.
This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
ONREPLY_ROUTE and FAILURE_ROUTE.
Example 1.19. dlg_get usage
...
if(dlg_get("abcdef", "123", "456"))
{
dlg_bye("all");
}
...
6.13. is_known_dlg()
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
7. Exported statistics
7.1. active_dialogs
7.2. early_dialogs
7.3. processed_dialogs
7.4. expired_dialogs
7.5. failed_dialogs
7.1. active_dialogs
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
7.2. early_dialogs
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
7.3. processed_dialogs
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
7.4. expired_dialogs
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
7.5. failed_dialogs
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
8. MI Commands
8.1. dlg_list
8.2. dlg_list_ctx
8.3. dlg_end_dlg
8.4. dlg_terminate_dlg
8.5. profile_get_size
8.6. profile_list_dlgs
8.7. dlg_bridge
8.1. dlg_list
Lists the description of a dialog or of all dialogs (calls). If only
one dialogs is to be listed, the dialog identifiers are to be passed as
parameter (callid and fromtag). In ims_dialog module this also now also
lists all dlg_out entries for early dialogs.
Name: dlg_list
Parameters:
* callid (optional) - callid if a single dialog to be listed.
* from_tag (optional, but cannot be present without the callid
parameter) - from tag (as per initial request) of the dialog to be
listed. Note that if the from_tag is not specified, only dialogs
created by a request without a from tag are matched, which will
only occur with broken clients and is thus a very rare situation.
MI FIFO Command Format:
:dlg_list:_reply_fifo_file_
_empty_line_
:dlg_list:_reply_fifo_file_
abcdrssfrs122444@192.168.1.1
AAdfeEFF33
8.2. dlg_list_ctx
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
8.3. dlg_end_dlg
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
8.4. dlg_terminate_dlg
Terminates a singe dialog, identified by the call_id, ftag, ttag. In
ims_dialog module this dialog can be terminated in the early or
confirmed states.
Name: dlg_terminate_dlg
Parameters:
* callid - callid of the dialog to be terminated.
* ftag fromtag of dialog to be terminated.
* ttag totag of dialog to be terminated.
Note: Works for confirmed and early dialogs.
MI FIFO Command Format:
:dlg_terminate_dlg:_reply_fifo_file_
abcdrssfrs122444@192.168.1.1
AAdfeEFF33 ftag-1234 t-tag1234
8.5. profile_get_size
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
8.6. profile_list_dlgs
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
8.7. dlg_bridge
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
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.end_dlg
9.6. dlg.profile_get_size
9.7. dlg.profile_list
9.8. dlg.bridge_dlg
9.1. dlg.list
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
9.2. dlg.list_ctx
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
9.3. dlg.dlg_list
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
9.4. dlg.dlg_list_ctx
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
9.5. dlg.end_dlg
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
9.6. dlg.profile_get_size
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
9.7. dlg.profile_list
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
9.8. dlg.bridge_dlg
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
10. Exported pseudo-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)
10.1. $DLG_count
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
10.2. $DLG_status
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
10.3. $DLG_lifetime
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
10.4. $dlg(...)
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
10.5. $dlg_ctx(...)
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
10.6. $dlg_var(key)
This function is currently not supported by the ims_dialog module. To
be incorporated in the future.
Chapter 2. Developer Guide
Table of Contents
1. Available Functions
1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)
1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned int
h_id, hdrs)
1.4. set_dlg_var (dlg, key, val)
1.5. get_dlg_var (dlg, key)
1.6. get_current_dialog ()
1. Available Functions
1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)
1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned int h_id,
hdrs)
1.4. set_dlg_var (dlg, key, val)
1.5. get_dlg_var (dlg, key)
1.6. get_current_dialog ()
1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
Register a new callback to the dialog.
Meaning of the parameters is as follows:
* struct dlg_cell* dlg - dialog to register callback to. If maybe
NULL only for DLGCB_CREATED callback type, which is not a per
dialog type.
* int type - types of callbacks; more types may be register for the
same callback function; only DLGCB_CREATED must be register alone.
Possible types:
+ DLGCB_LOADED
+ DLGCB_CREATED - called when a new dialog is created - it's a
global type (not associated to any dialog)
+ DLGCB_FAILED - called when the dialog was negatively replied
(non-2xx) - it's a per dialog type.
+ DLGCB_CONFIRMED_NA - called when the dialog is confirmed (2xx
replied) but the setup-concluding ACK message from the caller
is yet pending - it's a per dialog type.
+ DLGCB_CONFIRMED - called when the dialog is confirmed (2xx
replied) and the setup-concluding ACK message from the caller
has been seen - it's a per dialog type.
+ DLGCB_REQ_WITHIN - called when the dialog matches a sequential
request (excluding setup-concluding ACK messages which are
handled in DLGCB_CONFIRMED) - it's a per dialog type.
+ DLGCB_TERMINATED - called when the dialog is terminated via
BYE - it's a per dialog type.
+ DLGCB_TERMINATED_CONFIRMED - called when response to a BYE
request is received - it's a per dialog type.
+ DLGCB_EXPIRED - called when the dialog expires without
receiving a BYE - it's a per dialog type.
+ DLGCB_EARLY - called when the dialog is created in an early
state (18x replied) - it's a per dialog type.
+ DLGCB_RESPONSE_FWDED - called when the dialog matches a reply
to the initial INVITE request - it's a per dialog type.
+ DLGCB_RESPONSE_WITHIN - called when the dialog matches a reply
to a subsequent in dialog request - it's a per dialog type.
+ DLGCB_MI_CONTEXT - called when the mi dlg_list_ctx command is
invoked - it's a per dialog type.
+ DLGCB_SPIRALED - called when the dialog matches a spiraling
request - it's a per dialog type.
+ DLGCB_DESTROY
* dialog_cb cb - callback function to be called. Prototype is: “void
(dialog_cb) (struct dlg_cell* dlg, int type, struct dlg_cb_params *
params); ”
* void *param - parameter to be passed to the callback function.
* param_free callback_param_free - callback function to be called to
free the param. Prototype is: “void (param_free_cb) (void *param);”
1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)