Skip to content

Commit

Permalink
dialog: document replication tag related param, MI cmd and script fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
rvlad-patrascu committed Mar 27, 2018
1 parent 879c4d4 commit 10977d8
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 32 deletions.
134 changes: 102 additions & 32 deletions modules/dialog/README
Expand Up @@ -78,6 +78,7 @@ Vladut-Stefan Paiu
1.6.48. replicate_profiles_check (string)
1.6.49. replicate_profiles_timer (string)
1.6.50. replicate_profiles_expire (string)
1.6.51. dlg_repl_tag (string)

1.7. Exported Functions

Expand All @@ -97,6 +98,7 @@ Vladut-Stefan Paiu
1.7.14. is_dlg_flag_set(idx)
1.7.15. store_dlg_value(name,val)
1.7.16. fetch_dlg_value(name,pvar)
1.7.17. set_dlg_repl_tag(tag_name)

1.8. Exported statistics

Expand Down Expand Up @@ -124,6 +126,8 @@ Vladut-Stefan Paiu
1.9.8. dlg_db_sync
1.9.9. dlg_restore_db
1.9.10. list_all_profiles
1.9.11. set_repl_tag_active
1.9.12. list_repl_tags

1.10. Exported pseudo-variables

Expand Down Expand Up @@ -202,22 +206,24 @@ Vladut-Stefan Paiu
1.48. Set replicate_profiles_check parameter
1.49. Set replicate_profiles_timer parameter
1.50. Set replicate_profiles_expire parameter
1.51. create_dialog() usage
1.52. match_dialog() usage
1.53. validate_dialog() usage
1.54. fix_route_dialog() usage
1.55. get_dialog_info usage
1.56. get_dialog_vals usage
1.57. set_dlg_profile usage
1.58. unset_dlg_profile usage
1.59. is_in_profile usage
1.60. get_profile_size usage
1.61. set_dlg_flag usage
1.62. test_and_set_dlg_flag usage
1.63. reset_dlg_flag usage
1.64. is_dlg_flag_set usage
1.65. store_dlg_value usage
1.66. fetch_dlg_value usage
1.51. Set dlg_repl_tag parameter
1.52. create_dialog() usage
1.53. match_dialog() usage
1.54. validate_dialog() usage
1.55. fix_route_dialog() usage
1.56. get_dialog_info usage
1.57. get_dialog_vals usage
1.58. set_dlg_profile usage
1.59. unset_dlg_profile usage
1.60. is_in_profile usage
1.61. get_profile_size usage
1.62. set_dlg_flag usage
1.63. test_and_set_dlg_flag usage
1.64. reset_dlg_flag usage
1.65. is_dlg_flag_set usage
1.66. store_dlg_value usage
1.67. fetch_dlg_value usage
1.68. set_dlg_repl_tag usage

Chapter 1. Admin Guide

Expand Down Expand Up @@ -980,6 +986,24 @@ modparam("dialog", "replicate_profiles_timer", 100)
modparam("dialog", "replicate_profiles_expire", 10)
...

1.6.51. dlg_repl_tag (string)

This parameter can be set(mutiple times) in order to define
tags, along with their initial states, useful in dialog
replication.

Format: "tag_name=state" where state may have the "active" or
"backup" values.

If this parameter is not defined for a specific tag, and that
tag is encountered at runtime, it will have the initial state
of backup.

Example 1.51. Set dlg_repl_tag parameter
...
modparam("dialog", "dlg_repl_tag", "vip1=active")
...

1.7. Exported Functions

1.7.1. create_dialog()
Expand All @@ -1006,7 +1030,7 @@ modparam("dialog", "replicate_profiles_expire", 10)

This function can be used from REQUEST_ROUTE.

Example 1.51. create_dialog() usage
Example 1.52. create_dialog() usage
...
create_dialog();
...
Expand Down Expand Up @@ -1041,7 +1065,7 @@ create_dialog("B");

This function can be used from REQUEST_ROUTE.

Example 1.52. match_dialog() usage
Example 1.53. match_dialog() usage
...
if (has_totag()) {
loose_route();
Expand Down Expand Up @@ -1071,7 +1095,7 @@ create_dialog("B");

This function can be used from REQUEST_ROUTE.

Example 1.53. validate_dialog() usage
Example 1.54. validate_dialog() usage
...
if (has_totag()) {
loose_route();
Expand All @@ -1093,7 +1117,7 @@ create_dialog("B");

This function can be used from REQUEST_ROUTE.

Example 1.54. fix_route_dialog() usage
Example 1.55. fix_route_dialog() usage
...
if (has_totag()) {
loose_route();
Expand Down Expand Up @@ -1131,7 +1155,7 @@ create_dialog("B");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE, FAILURE_ROUTE and LOCAL_ROUTE.

Example 1.55. get_dialog_info usage
Example 1.56. get_dialog_info usage
...
if ( get_dialog_info("callee","$var(x)","caller","$fu") ) {
xlog("caller $fU has another ongoing, talking to callee $var(x)\
Expand Down Expand Up @@ -1168,7 +1192,7 @@ $dlg_val(callee) = $ru;

This function can be used from any type of route.

Example 1.56. get_dialog_vals usage
Example 1.57. get_dialog_vals usage
...
if ( get_dialog_vals("$avp(d_names)","$avp(d_vals)","$var(callid)") ) {
xlog("the call $var(callid) has the variables:\n);
Expand Down Expand Up @@ -1201,7 +1225,7 @@ als)[$var(i)])'\n");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.57. set_dlg_profile usage
Example 1.58. set_dlg_profile usage
...
set_dlg_profile("inbound_call");
set_dlg_profile("caller","$fu");
Expand All @@ -1224,7 +1248,7 @@ set_dlg_profile("caller","$fu");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.58. unset_dlg_profile usage
Example 1.59. unset_dlg_profile usage
...
unset_dlg_profile("inbound_call");
unset_dlg_profile("caller","$fu");
Expand Down Expand Up @@ -1252,7 +1276,7 @@ unset_dlg_profile("caller","$fu");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.59. is_in_profile usage
Example 1.60. is_in_profile usage
...
if (is_in_profile("inbound_call")) {
log("this request belongs to a inbound call\n");
Expand Down Expand Up @@ -1284,7 +1308,7 @@ if (is_in_profile("caller","XX")) {
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.60. get_profile_size usage
Example 1.61. get_profile_size usage
modparam("dialog", "profiles_no_value", "inboundCalls")
modparam("dialog", "profiles_with_value", "caller")
...
Expand All @@ -1309,7 +1333,7 @@ xlog("currently, the user $fu has $var(size) active outgoing calls\n");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.61. set_dlg_flag usage
Example 1.62. set_dlg_flag usage
...
set_dlg_flag("3");
...
Expand All @@ -1330,7 +1354,7 @@ set_dlg_flag("3");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.62. test_and_set_dlg_flag usage
Example 1.63. test_and_set_dlg_flag usage
...
test_and_set_dlg_flag("3", "0");
...
Expand All @@ -1349,7 +1373,7 @@ test_and_set_dlg_flag("3", "0");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.63. reset_dlg_flag usage
Example 1.64. reset_dlg_flag usage
...
reset_dlg_flag("16");
...
Expand All @@ -1368,7 +1392,7 @@ reset_dlg_flag("16");
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.64. is_dlg_flag_set usage
Example 1.65. is_dlg_flag_set usage
...
if (is_dlg_flag_set("16")) {
xlog("dialog flag 16 is set\n");
Expand All @@ -1393,7 +1417,7 @@ if (is_dlg_flag_set("16")) {
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.65. store_dlg_value usage
Example 1.66. store_dlg_value usage
...
store_dlg_value("inv_src_ip","$si");
store_dlg_value("account type","prepaid");
Expand All @@ -1419,14 +1443,35 @@ $dlg_val(account_type) = "prepaid";
This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.66. fetch_dlg_value usage
Example 1.67. fetch_dlg_value usage
...
fetch_dlg_value("inv_src_ip","$avp(2)");
fetch_dlg_value("account type","$var(account)");
# or
$var(account) = $dlg_val(account_type);
...

1.7.17. set_dlg_repl_tag(tag_name)

Marks the current dialog with the replication tag tag_name.
From now on, actions like in-dialog pinging, DB updates etc.
will depend on the tag state.

If the tag is not already defined through the dlg_repl_tag
param and/or have it's state changed by the set_repl_tag_active
MI command, the initial state will be backup.

NOTE: the dialog must be created before using this function
(use create_dialog() function before).

This function can be used from REQUEST_ROUTE, BRANCH_ROUTE,
REPLY_ROUTE and FAILURE_ROUTE.

Example 1.68. set_dlg_repl_tag usage
...
set_dlg_repl_tag("vip1");
...

1.8. Exported statistics

1.8.1. active_dialogs
Expand Down Expand Up @@ -1670,6 +1715,31 @@ wZjAzNGM1ZDY
MI FIFO Command Format:
opensipsctl fifo list_all_profiles

1.9.11. set_repl_tag_active

Sets the given replication tag to the active state. The
information about this change is also broadcasted in the
cluster in order to force any other node that may be active on
this tag to go backup.

Name: set_repl_tag_active

Parameters: tag - name of the tag to be set active

MI FIFO Command Format:
opensipsctl fifo set_repl_tag_active vip1

1.9.12. list_repl_tags

Lists all known replication tags and their states.

Name: list_repl_tags

Parameters: Command takes no parameters

MI FIFO Command Format:
opensipsctl fifo list_repl_tags

1.10. Exported pseudo-variables

1.10.1. $DLG_count
Expand Down

0 comments on commit 10977d8

Please sign in to comment.