Debian Codegraph @

src/modules/ims_dialog/README

raw
1 IMS_DIALOG Module
2
3 Bogdan-Andrei Iancu
4
5 Voice Sistem SRL
6
7 Carsten Bock
8
9 ng-voice GmbH
10
11 Jason Penton
12
13 Smile Communications
14
15 Richard Good
16
17 Smile Communications
18
19 Edited by
20
21 Bogdan-Andrei Iancu
22
23 Carsten Bock
24
25 Jason Penton
26
27 Richard Good
28
29 Copyright © 2006 Voice Sistem SRL
30
31 Copyright © 2011-2013 Carsten Bock, http://www.ng-voice.com
32 __________________________________________________________________
33
34 Table of Contents
35
36 1. Admin Guide
37
38 1. Overview
39 2. How it works
40 3. Dialog profiling
41 4. Dependencies
42
43 4.1. Kamailio Modules
44 4.2. External Libraries or Applications
45
46 5. Parameters
47
48 5.1. enable_stats (integer)
49 5.2. hash_size (integer)
50 5.3. rr_param (string)
51 5.4. dlg_flag (integer)
52 5.5. timeout_avp (string)
53 5.6. default_timeout (integer)
54 5.7. dlg_extra_hdrs (string)
55 5.8. dlg_match_mode (integer)
56 5.9. detect_spirals (integer)
57 5.10. db_url (string)
58 5.11. db_mode (integer)
59 5.12. db_update_period (integer)
60 5.13. db_fetch_rows (integer)
61 5.14. profiles_with_value (string)
62 5.15. profiles_no_value (string)
63 5.16. bridge_controller (string)
64 5.17. initial_cbs_inscript (string)
65
66 6. Functions
67
68 6.1. set_dlg_profile(profile[, value])
69 6.2. unset_dlg_profile(profile[, value])
70 6.3. is_in_profile(profile[, value])
71 6.4. get_profile_size(profile[, value], size)
72 6.5. dlg_isflagset(flag)
73 6.6. dlg_setflag(flag)
74 6.7. dlg_resetflag(flag)
75 6.8. dlg_terminate
76 6.9. dlg_refer(side, address)
77 6.10. dlg_manage()
78 6.11. dlg_bridge(from, to, op)
79 6.12. dlg_get(callid, ftag, ttag)
80 6.13. is_known_dlg()
81
82 7. Exported statistics
83
84 7.1. active_dialogs
85 7.2. early_dialogs
86 7.3. processed_dialogs
87 7.4. expired_dialogs
88 7.5. failed_dialogs
89
90 8. MI Commands
91
92 8.1. dlg_list
93 8.2. dlg_list_ctx
94 8.3. dlg_end_dlg
95 8.4. dlg_terminate_dlg
96 8.5. profile_get_size
97 8.6. profile_list_dlgs
98 8.7. dlg_bridge
99
100 9. RPC Commands
101
102 9.1. dlg.list
103 9.2. dlg.list_ctx
104 9.3. dlg.dlg_list
105 9.4. dlg.dlg_list_ctx
106 9.5. dlg.end_dlg
107 9.6. dlg.profile_get_size
108 9.7. dlg.profile_list
109 9.8. dlg.bridge_dlg
110
111 10. Exported pseudo-variables
112
113 10.1. $DLG_count
114 10.2. $DLG_status
115 10.3. $DLG_lifetime
116 10.4. $dlg(...)
117 10.5. $dlg_ctx(...)
118 10.6. $dlg_var(key)
119
120 2. Developer Guide
121
122 1. Available Functions
123
124 1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
125
126 1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)
127 1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned
128 int h_id, hdrs)
129
130 1.4. set_dlg_var (dlg, key, val)
131 1.5. get_dlg_var (dlg, key)
132 1.6. get_current_dialog ()
133
134 3. Frequently Asked Questions
135
136 List of Examples
137
138 1.1. Set hash_size parameter
139 1.2. Set rr_param parameter
140 1.3. Set dlg_flag parameter
141 1.4. Set timeout_avp parameter
142 1.5. Set default_timeout parameter
143 1.6. Set dlf_extra_hdrs parameter
144 1.7. Set detect_spirals parameter
145 1.8. Set db_url parameter
146 1.9. Set db_mode parameter
147 1.10. Set db_update_period parameter
148 1.11. Set db_fetch_rows parameter
149 1.12. Set profiles_with_value parameter
150 1.13. Set profiles_no_value parameter
151 1.14. Set bridge_controller parameter
152 1.15. set_dlg_profile usage
153 1.16. unset_dlg_profile usage
154 1.17. is_in_profile usage
155 1.18. get_profile_size usage
156 1.19. dlg_isflagset usage
157 1.20. dlg_setflag usage
158 1.21. dlg_resetflag usage
159 1.22. dlg_terminate usage
160 1.23. dlg_get usage
161
162 Chapter 1. Admin Guide
163
164 Table of Contents
165
166 1. Overview
167 2. How it works
168 3. Dialog profiling
169 4. Dependencies
170
171 4.1. Kamailio Modules
172 4.2. External Libraries or Applications
173
174 5. Parameters
175
176 5.1. enable_stats (integer)
177 5.2. hash_size (integer)
178 5.3. rr_param (string)
179 5.4. dlg_flag (integer)
180 5.5. timeout_avp (string)
181 5.6. default_timeout (integer)
182 5.7. dlg_extra_hdrs (string)
183 5.8. dlg_match_mode (integer)
184 5.9. detect_spirals (integer)
185 5.10. db_url (string)
186 5.11. db_mode (integer)
187 5.12. db_update_period (integer)
188 5.13. db_fetch_rows (integer)
189 5.14. profiles_with_value (string)
190 5.15. profiles_no_value (string)
191 5.16. bridge_controller (string)
192 5.17. initial_cbs_inscript (string)
193
194 6. Functions
195
196 6.1. set_dlg_profile(profile[, value])
197 6.2. unset_dlg_profile(profile[, value])
198 6.3. is_in_profile(profile[, value])
199 6.4. get_profile_size(profile[, value], size)
200 6.5. dlg_isflagset(flag)
201 6.6. dlg_setflag(flag)
202 6.7. dlg_resetflag(flag)
203 6.8. dlg_terminate
204 6.9. dlg_refer(side, address)
205 6.10. dlg_manage()
206 6.11. dlg_bridge(from, to, op)
207 6.12. dlg_get(callid, ftag, ttag)
208 6.13. is_known_dlg()
209
210 7. Exported statistics
211
212 7.1. active_dialogs
213 7.2. early_dialogs
214 7.3. processed_dialogs
215 7.4. expired_dialogs
216 7.5. failed_dialogs
217
218 8. MI Commands
219
220 8.1. dlg_list
221 8.2. dlg_list_ctx
222 8.3. dlg_end_dlg
223 8.4. dlg_terminate_dlg
224 8.5. profile_get_size
225 8.6. profile_list_dlgs
226 8.7. dlg_bridge
227
228 9. RPC Commands
229
230 9.1. dlg.list
231 9.2. dlg.list_ctx
232 9.3. dlg.dlg_list
233 9.4. dlg.dlg_list_ctx
234 9.5. dlg.end_dlg
235 9.6. dlg.profile_get_size
236 9.7. dlg.profile_list
237 9.8. dlg.bridge_dlg
238
239 10. Exported pseudo-variables
240
241 10.1. $DLG_count
242 10.2. $DLG_status
243 10.3. $DLG_lifetime
244 10.4. $dlg(...)
245 10.5. $dlg_ctx(...)
246 10.6. $dlg_var(key)
247
248 1. Overview
249
250 The ims_dialog module provides dialog awareness to the Kamailio proxy.
251 Its functionality is to keep track of the current dialogs, to offer
252 information about them (like how many dialogs are active) or to manage
253 them. The module exports several functions that could be used directly
254 from scripts. The ims_dialog module extends the original dialog module
255 by providing support for forked calling and early dialog termination.
256 It is the intention that the ims_dialog module will eventually replace
257 the dialog module.
258
259 The module, via an internal API, also provide the foundation to build
260 on top of it more complex dialog-based functionalities via other
261 Kamailio modules.
262
263 2. How it works
264
265 To create the dialog associated to an initial request, the flag
266 “dlg_flag” ( Section 5.4, “ dlg_flag (integer) ”) must be set before
267 creating the corresponding transaction.
268
269 The dialog is automatically destroyed when a “BYE” is received. In case
270 of no “BYE”, the dialog lifetime is controlled via the default timeout
271 (see “default_timeout” - Section 5.6, “ default_timeout (integer) ”)
272 and custom timeout (see “timeout_avp” - Section 5.5, “ timeout_avp
273 (string) ”). The dialog timeout is reset each time a sequential request
274 passes.
275
276 3. Dialog profiling
277
278 Dialog profiling is a mechanism that helps in classifying, sorting and
279 keeping trace of certain types of dialogs, using whatever properties of
280 the dialog (like caller, destination, type of calls, etc). Dialogs can
281 be dynamically added in different (and several) profile tables -
282 logically, each profile table can have a special meaning (like dialogs
283 outside the domain, dialogs terminated to PSTN, etc).
284
285 There are two types of profiles:
286 * with no value - a dialog simply belongs to a profile. (like
287 outbound calls profile). There is no other additional information
288 to describe the dialog's belonging to the profile;
289 * with value - a dialog belongs to a profile having a certain value
290 (like in caller profile, where the value is the caller ID). The
291 belonging of the dialog to the profile is strictly related to the
292 value.
293
294 A dialog can be added to multiple profiles in the same time.
295
296 Profiles are visible (at the moment) in the request route (for initial
297 and sequential requests) and in the branch, failure and reply routes of
298 the original request.
299
300 4. Dependencies
301
302 4.1. Kamailio Modules
303 4.2. External Libraries or Applications
304
305 4.1. Kamailio Modules
306
307 The following modules must be loaded before this module:
308 * TM - Transaction module
309 * RR - Record-Route module
310
311 4.2. External Libraries or Applications
312
313 The following libraries or applications must be installed before
314 running Kamailio with this module loaded:
315 * None.
316
317 5. Parameters
318
319 5.1. enable_stats (integer)
320 5.2. hash_size (integer)
321 5.3. rr_param (string)
322 5.4. dlg_flag (integer)
323 5.5. timeout_avp (string)
324 5.6. default_timeout (integer)
325 5.7. dlg_extra_hdrs (string)
326 5.8. dlg_match_mode (integer)
327 5.9. detect_spirals (integer)
328 5.10. db_url (string)
329 5.11. db_mode (integer)
330 5.12. db_update_period (integer)
331 5.13. db_fetch_rows (integer)
332 5.14. profiles_with_value (string)
333 5.15. profiles_no_value (string)
334 5.16. bridge_controller (string)
335 5.17. initial_cbs_inscript (string)
336
337 5.1. enable_stats (integer)
338
339 This function is currently not supported by the ims_dialog module. To
340 be incorporated in the future.
341
342 5.2. hash_size (integer)
343
344 The size of the hash table internally used to keep the dialogs. A
345 larger table is much faster but consumes more memory. The hash size
346 must be a power of two number.
347
348 IMPORTANT: If dialogs' information should be stored in a database, a
349 constant hash_size should be used, otherwise the restoring process will
350 not take place. If you really want to modify the hash_size you must
351 delete all table's rows before restarting the server.
352
353 Default value is “4096”.
354
355 Example 1.1. Set hash_size parameter
356 ...
357 modparam("ims_dialog", "hash_size", 1024)
358 ...
359
360 5.3. rr_param (string)
361
362 Name of the Record-Route parameter to be added with the dialog cookie.
363 It is used for the fast dialog matching of sequential requests.
364
365 Default value is “did”.
366
367 Example 1.2. Set rr_param parameter
368 ...
369 modparam("ims_dialog", "rr_param", "xyz")
370 ...
371
372 5.4. dlg_flag (integer)
373
374 Flag to be used for marking if a dialog should be constructed for the
375 current request (this makes sense only for initial requests).
376
377 Default value is “none”.
378
379 Example 1.3. Set dlg_flag parameter
380 ...
381 modparam("ims_dialog", "dlg_flag", 4)
382 ...
383
384 5.5. timeout_avp (string)
385
386 The specification of an AVP that contain a custom timeout (in seconds)
387 for the dialog. It may be used only in a request (initial or
388 sequential) context
389
390 Default value is “none”.
391
392 Example 1.4. Set timeout_avp parameter
393 ...
394 modparam("ims_dialog", "timeout_avp", "$avp(i:10)")
395 ...
396
397 5.6. default_timeout (integer)
398
399 The default dialog timeout (in seconds) if no custom one is set.
400
401 Default value is “43200 (12 hours)”.
402
403 Example 1.5. Set default_timeout parameter
404 ...
405 modparam("ims_dialog", "default_timeout", 21600)
406 ...
407
408 5.7. dlg_extra_hdrs (string)
409
410 A string containing the extra headers (full format, with EOH) to be
411 added in the requests generated by the module (like BYEs).
412
413 Default value is “NULL”.
414
415 Example 1.6. Set dlf_extra_hdrs parameter
416 ...
417 modparam("ims_dialog", "dlg_extra_hdrs", "Hint: credit expired\r\n")
418 ...
419
420 5.8. dlg_match_mode (integer)
421
422 Deprecated - in the new dialog module we always match using DID ONLY
423
424 5.9. detect_spirals (integer)
425
426 Whether spirals (i.e., messages routed through the proxy multiple
427 times) should be detected or not.
428
429 If set to 0, spirals will not be detected and result in the generation
430 of a new, possibly dangling dialog structure per occurring spiral. If
431 set to 1, spirals are detected and internally mapped to existing dialog
432 structures.
433
434 Default value is 1.
435
436 Example 1.7. Set detect_spirals parameter
437 ...
438 modparam("ims_dialog", "detect_spirals", 1)
439 ...
440
441 5.10. db_url (string)
442
443 In order to store information about dialogs in a database, a database
444 URL must be specified.
445
446 Default value is “mysql://kamailio:kamailiorw@localhost/kamailio”.
447
448 Example 1.8. Set db_url parameter
449 ...
450 modparam("ims_dialog", "db_url", "dbdriver://username:password@dbhost/dbname
451 ")
452 ...
453
454 5.11. db_mode (integer)
455
456 This is the database mode to be used for dialog persistent storage.
457 * 0 - NO_DB - the memory content is not flushed into DB;
458 * 1 - REALTIME - any dialog information changes will be reflected
459 into the database immediately.
460 * 2 - DELAYED - the dialog information changes will be flushed into
461 DB periodically, based on a timer routine.
462 * 3 - SHUTDOWN - the dialog information will be flushed into DB only
463 at shutdown - no runtime updates.
464
465 Default value is “0”.
466
467 Example 1.9. Set db_mode parameter
468 ...
469 modparam("ims_dialog", "db_mode", 1)
470 ...
471
472 5.12. db_update_period (integer)
473
474 The interval (seconds) at which to update dialogs' information, if the
475 server is configured to store the dialog information at a given
476 interval. A too short interval will generate intensive database
477 operations, while an excessively long one will miss dialogs with a
478 short lifetime.
479
480 Default value is “60” seconds.
481
482 Example 1.10. Set db_update_period parameter
483 ...
484 modparam("ims_dialog", "db_update_period", 120)
485 ...
486
487 5.13. db_fetch_rows (integer)
488
489 The number of the rows to be fetched at once from database when loading
490 the dialog records at startup from the database. This value can be used
491 to tune the load time at startup. For 1MB of private memory (default),
492 it should be below 400. The database driver must support the
493 fetch_result() capability. A value of 0 means the database fetch is not
494 limited.
495
496 Default value is “200”.
497
498 Example 1.11. Set db_fetch_rows parameter
499 ...
500 modparam("ims_dialog", "db_fetch_rows", 500)
501 ...
502
503 5.14. profiles_with_value (string)
504
505 List of names for profiles with values.
506
507 Default value is “empty”.
508
509 Example 1.12. Set profiles_with_value parameter
510 ...
511 modparam("ims_dialog", "profiles_with_value", "caller ; my_profile")
512 ...
513
514 5.15. profiles_no_value (string)
515
516 List of names for profiles without values.
517
518 Default value is “empty”.
519
520 Example 1.13. Set profiles_no_value parameter
521 ...
522 modparam("ims_dialog", "profiles_no_value", "inbound ; outbound")
523 ...
524
525 5.16. bridge_controller (string)
526
527 SIP address to be used in From header when initiating a call bridge.
528
529 Default value is “sip:[email protected]”.
530
531 Example 1.14. Set bridge_controller parameter
532 ...
533 modparam("ims_dialog", "bridge_controller", "sip:[email protected]")
534 ...
535
536 5.17. initial_cbs_inscript (string)
537
538 This has been deprecated since dlg_manage has been removed.
539
540 6. Functions
541
542 6.1. set_dlg_profile(profile[, value])
543 6.2. unset_dlg_profile(profile[, value])
544 6.3. is_in_profile(profile[, value])
545 6.4. get_profile_size(profile[, value], size)
546 6.5. dlg_isflagset(flag)
547 6.6. dlg_setflag(flag)
548 6.7. dlg_resetflag(flag)
549 6.8. dlg_terminate
550 6.9. dlg_refer(side, address)
551 6.10. dlg_manage()
552 6.11. dlg_bridge(from, to, op)
553 6.12. dlg_get(callid, ftag, ttag)
554 6.13. is_known_dlg()
555
556 6.1. set_dlg_profile(profile[, value])
557
558 Inserts the current dialog into a profile. Note that if the profile
559 does not supports values, this will be silently discarded. Also, there
560 is no check for inserting the same dialog in the same profile for
561 multiple times.
562
563 Meaning of the parameters is as follows:
564 * profile - name of the profile to be added to;
565 * value (optional) - string value to define the belonging of the
566 dialog to the profile - note that the profile must support values.
567 Pseudo-variables are supported.
568
569 This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
570 and FAILURE_ROUTE.
571
572 Example 1.15. set_dlg_profile usage
573 ...
574 set_dlg_profile("inbound_call");
575 set_dlg_profile("caller","$fu");
576 ...
577
578 6.2. unset_dlg_profile(profile[, value])
579
580 Removes the current dialog from a profile.
581
582 Meaning of the parameters is as follows:
583 * profile - name of the profile to be removed from;
584 * value (optional) - string value to define the belonging of the
585 dialog to the profile - note that the profile must support values.
586 Pseudo-variables are supported.
587
588 This function can be used from BRANCH_ROUTE, REPLY_ROUTE and
589 FAILURE_ROUTE.
590
591 Example 1.16. unset_dlg_profile usage
592 ...
593 unset_dlg_profile("inbound_call");
594 unset_dlg_profile("caller","$fu");
595 ...
596
597 6.3. is_in_profile(profile[, value])
598
599 Checks if the current dialog belongs to a profile. If the profile
600 supports values, the check can be reinforced to take into account a
601 specific value - if the dialog was inserted into the profile for a
602 specific value. If no value is passed, only the simply belonging of the
603 dialog to the profile is checked. Note that if the profile does not
604 supports values, this will be silently discarded.
605
606 Meaning of the parameters is as follows:
607 * profile - name of the profile to be checked against;
608 * value (optional) - string value to further restrict the check.
609 Pseudo-variables are supported.
610
611 This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
612 and FAILURE_ROUTE.
613
614 Example 1.17. is_in_profile usage
615 ...
616 if (is_in_profile("inbound_call")) {
617 log("this request belongs to an inbound call\n");
618 }
619 ...
620 if (is_in_profile("caller","XX")) {
621 log("this request belongs to a call of user XX\n");
622 }
623 ...
624
625 6.4. get_profile_size(profile[, value], size)
626
627 Returns the number of dialogs belonging to a profile. If the profile
628 supports values, the check can be reinforced to take into account a
629 specific value - how many dialogs were inserted into the profile with a
630 specific value. If no value is passed, only simply belonging of the
631 dialog to the profile is checked. Note that if the profile does not
632 supports values, this will be silently discarded.
633
634 Meaning of the parameters is as follows:
635 * profile - name of the profile to get the size for;
636 * value (optional) - string value to further restrict the check.
637 Pseudo-variables are supported;
638 * size - an AVP or script variable to return the profile size in.
639
640 This function can be used from REQUEST_ROUTE, BRANCH_ROUTE, REPLY_ROUTE
641 and FAILURE_ROUTE.
642
643 Example 1.18. get_profile_size usage
644 ...
645 if(get_profile_size("inbound_call","$avp(size)"))
646 xlog("currently there are $avp(size) inbound calls\n");
647 ...
648 if(get_profile_size("caller","$fu","$avp(size)"))
649 xlog("currently, the user $fu has $avp(size) active outgoing calls\n");
650 ...
651
652 6.5. dlg_isflagset(flag)
653
654 Check if the dialog flag is set or not.
655
656 Meaning of the parameters is as follows:
657 * flag - index of the flag - can be pseudo-variable.
658
659 This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
660 ONREPLY_ROUTE and FAILURE_ROUTE.
661
662 Example 1.19. dlg_isflagset usage
663 ...
664 if(dlg_isflagset("1"))
665 {
666 ...
667 }
668 ...
669
670 6.6. dlg_setflag(flag)
671
672 Set the dialog flag.
673
674 Meaning of the parameters is as follows:
675 * flag - index of the flag - can be pseudo-variable.
676
677 This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
678 ONREPLY_ROUTE and FAILURE_ROUTE.
679
680 Example 1.20. dlg_setflag usage
681 ...
682 dlg_setflag("1");
683 ...
684
685 6.7. dlg_resetflag(flag)
686
687 Reset the dialog flag.
688
689 Meaning of the parameters is as follows:
690 * flag - index of the flag - can be pseudo-variable.
691
692 This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
693 ONREPLY_ROUTE and FAILURE_ROUTE.
694
695 Example 1.21. dlg_resetflag usage
696 ...
697 dlg_resetflag("1");
698 ...
699
700 6.8. dlg_terminate
701
702 Terminates a dialog. In ims_dialog module this function now includes
703 support for early as well as confirmed dialogs.
704
705 Meaning of the parameters is as follows:
706 * side - which side to terminate. It can be: caller, callee or both
707 of them.
708 * reason - reason for termination.
709
710 This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
711 ONREPLY_ROUTE and FAILURE_ROUTE.
712
713 Example 1.22. dlg_terminate usage
714 ...
715 dlg_terminate("all", "Insufficient QoS");
716 ...
717
718 6.9. dlg_refer(side, address)
719
720 This function is currently not supported by the ims_dialog module. To
721 be incorporated in the future.
722
723 6.10. dlg_manage()
724
725 This has been deprecated in ims_dialog. Instead set dialog flag for
726 initial INVITE and Route-parameter-callback execution for within-dialog
727 requests.
728
729 6.11. dlg_bridge(from, to, op)
730
731 This function is currently not supported by the ims_dialog module. To
732 be incorporated in the future.
733
734 6.12. dlg_get(callid, ftag, ttag)
735
736 Search and set current dialog based on Call-ID, From-Tag and To-Tag
737 parameters.
738
739 Meaning of the parameters is as follows:
740 * callid - SIP call-id.
741 * ftag - SIP From tag.
742 * ttag - SIP To tag.
743
744 This function can be used from BRANCH_ROUTE, REQUEST_ROUTE,
745 ONREPLY_ROUTE and FAILURE_ROUTE.
746
747 Example 1.23. dlg_get usage
748 ...
749 if(dlg_get("abcdef", "123", "456"))
750 {
751 dlg_bye("all");
752 }
753 ...
754
755 6.13. is_known_dlg()
756
757 This function is currently not supported by the ims_dialog module. To
758 be incorporated in the future.
759
760 7. Exported statistics
761
762 7.1. active_dialogs
763 7.2. early_dialogs
764 7.3. processed_dialogs
765 7.4. expired_dialogs
766 7.5. failed_dialogs
767
768 7.1. active_dialogs
769
770 This function is currently not supported by the ims_dialog module. To
771 be incorporated in the future.
772
773 7.2. early_dialogs
774
775 This function is currently not supported by the ims_dialog module. To
776 be incorporated in the future.
777
778 7.3. processed_dialogs
779
780 This function is currently not supported by the ims_dialog module. To
781 be incorporated in the future.
782
783 7.4. expired_dialogs
784
785 This function is currently not supported by the ims_dialog module. To
786 be incorporated in the future.
787
788 7.5. failed_dialogs
789
790 This function is currently not supported by the ims_dialog module. To
791 be incorporated in the future.
792
793 8. MI Commands
794
795 8.1. dlg_list
796 8.2. dlg_list_ctx
797 8.3. dlg_end_dlg
798 8.4. dlg_terminate_dlg
799 8.5. profile_get_size
800 8.6. profile_list_dlgs
801 8.7. dlg_bridge
802
803 8.1. dlg_list
804
805 Lists the description of a dialog or of all dialogs (calls). If only
806 one dialogs is to be listed, the dialog identifiers are to be passed as
807 parameter (callid and fromtag). In ims_dialog module this also now also
808 lists all dlg_out entries for early dialogs.
809
810 Name: dlg_list
811
812 Parameters:
813 * callid (optional) - callid if a single dialog to be listed.
814 * from_tag (optional, but cannot be present without the callid
815 parameter) - from tag (as per initial request) of the dialog to be
816 listed. Note that if the from_tag is not specified, only dialogs
817 created by a request without a from tag are matched, which will
818 only occur with broken clients and is thus a very rare situation.
819
820 MI FIFO Command Format:
821 :dlg_list:_reply_fifo_file_
822 _empty_line_
823 :dlg_list:_reply_fifo_file_
824 [email protected]
825 AAdfeEFF33
826
827 8.2. dlg_list_ctx
828
829 This function is currently not supported by the ims_dialog module. To
830 be incorporated in the future.
831
832 8.3. dlg_end_dlg
833
834 This function is currently not supported by the ims_dialog module. To
835 be incorporated in the future.
836
837 8.4. dlg_terminate_dlg
838
839 Terminates a single dialog, identified by the call_id, ftag, ttag. In
840 ims_dialog module this dialog can be terminated in the early or
841 confirmed states.
842
843 Name: dlg_terminate_dlg
844
845 Parameters:
846 * callid - callid of the dialog to be terminated.
847 * ftag fromtag of dialog to be terminated.
848 * ttag totag of dialog to be terminated.
849
850 Note: Works for confirmed and early dialogs.
851
852 MI FIFO Command Format:
853 :dlg_terminate_dlg:_reply_fifo_file_
854 [email protected]
855 AAdfeEFF33 ftag-1234 t-tag1234
856
857 8.5. profile_get_size
858
859 This function is currently not supported by the ims_dialog module. To
860 be incorporated in the future.
861
862 8.6. profile_list_dlgs
863
864 This function is currently not supported by the ims_dialog module. To
865 be incorporated in the future.
866
867 8.7. dlg_bridge
868
869 This function is currently not supported by the ims_dialog module. To
870 be incorporated in the future.
871
872 9. RPC Commands
873
874 9.1. dlg.list
875 9.2. dlg.list_ctx
876 9.3. dlg.dlg_list
877 9.4. dlg.dlg_list_ctx
878 9.5. dlg.end_dlg
879 9.6. dlg.profile_get_size
880 9.7. dlg.profile_list
881 9.8. dlg.bridge_dlg
882
883 9.1. dlg.list
884
885 This function is currently not supported by the ims_dialog module. To
886 be incorporated in the future.
887
888 9.2. dlg.list_ctx
889
890 This function is currently not supported by the ims_dialog module. To
891 be incorporated in the future.
892
893 9.3. dlg.dlg_list
894
895 This function is currently not supported by the ims_dialog module. To
896 be incorporated in the future.
897
898 9.4. dlg.dlg_list_ctx
899
900 This function is currently not supported by the ims_dialog module. To
901 be incorporated in the future.
902
903 9.5. dlg.end_dlg
904
905 This function is currently not supported by the ims_dialog module. To
906 be incorporated in the future.
907
908 9.6. dlg.profile_get_size
909
910 This function is currently not supported by the ims_dialog module. To
911 be incorporated in the future.
912
913 9.7. dlg.profile_list
914
915 This function is currently not supported by the ims_dialog module. To
916 be incorporated in the future.
917
918 9.8. dlg.bridge_dlg
919
920 This function is currently not supported by the ims_dialog module. To
921 be incorporated in the future.
922
923 10. Exported pseudo-variables
924
925 10.1. $DLG_count
926 10.2. $DLG_status
927 10.3. $DLG_lifetime
928 10.4. $dlg(...)
929 10.5. $dlg_ctx(...)
930 10.6. $dlg_var(key)
931
932 10.1. $DLG_count
933
934 This function is currently not supported by the ims_dialog module. To
935 be incorporated in the future.
936
937 10.2. $DLG_status
938
939 This function is currently not supported by the ims_dialog module. To
940 be incorporated in the future.
941
942 10.3. $DLG_lifetime
943
944 This function is currently not supported by the ims_dialog module. To
945 be incorporated in the future.
946
947 10.4. $dlg(...)
948
949 This function is currently not supported by the ims_dialog module. To
950 be incorporated in the future.
951
952 10.5. $dlg_ctx(...)
953
954 This function is currently not supported by the ims_dialog module. To
955 be incorporated in the future.
956
957 10.6. $dlg_var(key)
958
959 This function is currently not supported by the ims_dialog module. To
960 be incorporated in the future.
961
962 Chapter 2. Developer Guide
963
964 Table of Contents
965
966 1. Available Functions
967
968 1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
969 1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)
970 1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned int
971 h_id, hdrs)
972
973 1.4. set_dlg_var (dlg, key, val)
974 1.5. get_dlg_var (dlg, key)
975 1.6. get_current_dialog ()
976
977 1. Available Functions
978
979 1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
980 1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)
981 1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned int h_id,
982 hdrs)
983
984 1.4. set_dlg_var (dlg, key, val)
985 1.5. get_dlg_var (dlg, key)
986 1.6. get_current_dialog ()
987
988 1.1. register_dlgcb (dialog, type, cb, param, free_param_cb)
989
990 Register a new callback to the dialog.
991
992 Meaning of the parameters is as follows:
993 * struct dlg_cell* dlg - dialog to register callback to. It may be
994 NULL only for DLGCB_CREATED callback type, which is not a per
995 dialog type.
996 * int type - types of callbacks; more types may be registered for the
997 same callback function; only DLGCB_CREATED must be registered
998 alone. Possible types:
999 + DLGCB_LOADED
1000 + DLGCB_CREATED - called when a new dialog is created - it's a
1001 global type (not associated to any dialog)
1002 + DLGCB_FAILED - called when the dialog was negatively replied
1003 (non-2xx) - it's a per dialog type.
1004 + DLGCB_CONFIRMED_NA - called when the dialog is confirmed (2xx
1005 replied) but the setup-concluding ACK message from the caller
1006 is yet pending - it's a per dialog type.
1007 + DLGCB_CONFIRMED - called when the dialog is confirmed (2xx
1008 replied) and the setup-concluding ACK message from the caller
1009 has been seen - it's a per dialog type.
1010 + DLGCB_REQ_WITHIN - called when the dialog matches a sequential
1011 request (excluding setup-concluding ACK messages which are
1012 handled in DLGCB_CONFIRMED) - it's a per dialog type.
1013 + DLGCB_TERMINATED - called when the dialog is terminated via
1014 BYE - it's a per dialog type.
1015 + DLGCB_TERMINATED_CONFIRMED - called when response to a BYE
1016 request is received - it's a per dialog type.
1017 + DLGCB_EXPIRED - called when the dialog expires without
1018 receiving a BYE - it's a per dialog type.
1019 + DLGCB_EARLY - called when the dialog is created in an early
1020 state (18x replied) - it's a per dialog type.
1021 + DLGCB_RESPONSE_FWDED - called when the dialog matches a reply
1022 to the initial INVITE request - it's a per dialog type.
1023 + DLGCB_RESPONSE_WITHIN - called when the dialog matches a reply
1024 to a subsequent in dialog request - it's a per dialog type.
1025 + DLGCB_MI_CONTEXT - called when the mi dlg_list_ctx command is
1026 invoked - it's a per dialog type.
1027 + DLGCB_SPIRALED - called when the dialog matches a spiraling
1028 request - it's a per dialog type.
1029 + DLGCB_DESTROY
1030 * dialog_cb cb - callback function to be called. Prototype is: “void
1031 (dialog_cb) (struct dlg_cell* dlg, int type, struct dlg_cb_params *
1032 params); ”
1033 * void *param - parameter to be passed to the callback function.
1034 * param_free callback_param_free - callback function to be called to
1035 free the param. Prototype is: “void (param_free_cb) (void *param);”
1036
1037 1.2. terminate_dlg (str callid, str ftag, str ttag, hdrs)
1038
1039 Terminate a Dialog identified by callid, ftag and ttag in early or
1040 confirmed state.
1041
1042 Meaning of parameters is as follows:
1043 * str* callid - callid of dialog to terminate.
1044 * str* ftag - from_tag of dialog to terminate.
1045 * str* ttag - to tag of dialog to terminate.
1046 * str* hdrs - string containing extra headers (full format) to be
1047 added to the BYE requests of the dialog.
1048
1049 1.3. lookup_terminate_dlg (unsigned int h_entry, unsigned int h_id, hdrs)
1050
1051 Terminate a Dialog identified by h_entry and h_id (similar to
1052 dlg_end_dlg command via XMLRPC).
1053
1054 Meaning of parameters is as follows:
1055 * unsigned int h_entry - Number of the table, where to find the
1056 dialog
1057 * unsigned int h_id - Number of the entry in the table, where to find
1058 the dialog terminate.
1059 * str* hdrs - string containing extra headers (full format) to be
1060 added to the BYE requests of the dialog.
1061
1062 1.4. set_dlg_var (dlg, key, val)
1063
1064 Add a variable to the dialog structure
1065
1066 Meaning of parameters is as follows:
1067 * struct dlg_cell* dlg - dialog to add to.
1068 * str* key - Name of the variable.
1069 * str* val - Value of the variable.
1070
1071 1.5. get_dlg_var (dlg, key)
1072
1073 Retrieves a variable attached to the dialog structure
1074
1075 Meaning of parameters is as follows:
1076 * struct dlg_cell* dlg - dialog to get the variable from.
1077 * str* key - Name of the variable.
1078
1079 1.6. get_current_dialog ()
1080
1081 Get the current dialog for a message, if exists
1082
1083 Chapter 3. Frequently Asked Questions
1084
1085 3.1. What happened with “use_tight_match” parameter?
1086 3.2. Why is there an ims_dialog module and a dialog module?
1087 3.3. Where can I find more about Kamailio?
1088 3.4. Where can I post a question about this module?
1089 3.5. How can I report a bug?
1090
1091 3.1.
1092
1093 What happened with “use_tight_match” parameter?
1094
1095 The parameter was removed with version 1.3 as the option of tight
1096 matching became mandatory and not configurable. Now, the tight matching
1097 is done all the time (when using DID matching).
1098
1099 3.2.
1100
1101 Why is there an ims_dialog module and a dialog module?
1102
1103 The ims_dialog module addresses shortcomings in the initial dialog
1104 module design. It makes some large changes to the API and therefore
1105 must be introduced slowly. It is currently in the early development
1106 stages. Eventually the ims_dialog module should replace the dialog
1107 module.
1108
1109 3.3.
1110
1111 Where can I find more about Kamailio?
1112
1113 Take a look at https://www.kamailio.org/.
1114
1115 3.4.
1116
1117 Where can I post a question about this module?
1118
1119 First at all check if your question was already answered on one of our
1120 mailing lists:
1121 * User Mailing List -
1122 https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.
1123 kamailio.org/
1124 * Developer Mailing List -
1125 https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.ka
1126 mailio.org/
1127
1128 E-mails regarding any stable Kamailio release should be sent to
1129 <[email protected]> and e-mails regarding development
1130 versions should be sent to <[email protected]>.
1131
1132 3.5.
1133
1134 How can I report a bug?
1135
1136 Please follow the guidelines provided at:
1137 https://github.com/kamailio/kamailio/issues.