Skip to content

Commit

Permalink
dispatcher: doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Mar 17, 2015
1 parent 388ce73 commit 4d019ce
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 44 deletions.
103 changes: 59 additions & 44 deletions modules/dispatcher/README
Expand Up @@ -58,15 +58,16 @@ Carsten Bock
1.3.15. cnt_avp (str)
1.3.16. sock_avp (str)
1.3.17. pvar_algo_pattern (str)
1.3.18. table_name (string)
1.3.19. partition (string)
1.3.20. setid_col (string)
1.3.21. destination_col (string)
1.3.22. state_col (string)
1.3.23. weight_col (string)
1.3.24. priority_col (string)
1.3.25. attrs_col (string)
1.3.26. socket_col (string)
1.3.18. persistent_state (int)
1.3.19. table_name (string)
1.3.20. partition (string)
1.3.21. setid_col (string)
1.3.22. destination_col (string)
1.3.23. state_col (string)
1.3.24. weight_col (string)
1.3.25. priority_col (string)
1.3.26. attrs_col (string)
1.3.27. socket_col (string)

1.4. Exported Functions

Expand Down Expand Up @@ -121,19 +122,20 @@ Carsten Bock
1.16. Set the 'default' partition's “cnt_avp” parameter
1.17. Set the 'default' partition's “sock_avp” parameter
1.18. Set the “pvar_algo_pattern” parameter
1.19. Set the 'default' partition's “table_name” parameter
1.20. Create a new partition called 'part2'
1.21. Set “setid_col” parameter
1.22. Set “destination_col” parameter
1.23. Set “state_col” parameter
1.24. Set “weight_col” parameter
1.25. Set “priority_col” parameter
1.26. Set “attrs_col” parameter
1.27. Set “socket_col” parameter
1.28. ds_select_dst usage
1.29. ds_count usage
1.30. ds_is_in_list usage
1.31. OpenSIPS config script - sample dispatcher usage
1.19. Set the persistent_state parameter
1.20. Set the 'default' partition's “table_name” parameter
1.21. Create a new partition called 'part2'
1.22. Set “setid_col” parameter
1.23. Set “destination_col” parameter
1.24. Set “state_col” parameter
1.25. Set “weight_col” parameter
1.26. Set “priority_col” parameter
1.27. Set “attrs_col” parameter
1.28. Set “socket_col” parameter
1.29. ds_select_dst usage
1.30. ds_count usage
1.31. ds_is_in_list usage
1.32. OpenSIPS config script - sample dispatcher usage

Chapter 1. Admin Guide

Expand Down Expand Up @@ -466,7 +468,20 @@ modparam("dispatcher", "sock_avp", "$avp(275)")
modparam("dispatcher", "pvar_algo_pattern", "$stat(load_%u)")
...

1.3.18. table_name (string)
1.3.18. persistent_state (int)

Specifies whether the state column should be loaded at startup
and flushed during runtime or not.

Default value is “1” (enabled).

Example 1.19. Set the persistent_state parameter
...
# disable all DB operations with the state of a destination
modparam("dispatcher", "persistent_state", 0)
...

1.3.19. table_name (string)

If you want to load the sets of gateways from the database you
must set this parameter as the database name. Setting this
Expand All @@ -476,13 +491,13 @@ modparam("dispatcher", "pvar_algo_pattern", "$stat(load_%u)")

For every partition the default value is “dispatcher”.

Example 1.19. Set the 'default' partition's “table_name”
Example 1.20. Set the 'default' partition's “table_name”
parameter
...
modparam("dispatcher", "table_name", "my_dispatcher")
...

1.3.19. partition (string)
1.3.20. partition (string)

Using this parameter the partition specific parameters (db_url,
table_name, dst_avp, grp_avp, cnt_avp, sock_avp, attrs_avp,
Expand All @@ -496,93 +511,93 @@ modparam("dispatcher", "table_name", "my_dispatcher")
be automatically created. The 'default' partition can also be
defined using this parameter.

Example 1.20. Create a new partition called 'part2'
Example 1.21. Create a new partition called 'part2'
...
modparam("dispatcher", "partition", "part2 : db_url=mysql://user:passwd@
localhost/database; table_name = ds_table; ds_define_blacklist= list2= 4
,6;")
...

1.3.20. setid_col (string)
1.3.21. setid_col (string)

The column's name in the database storing the gateway's group
id.

Default value is “setid”.

Example 1.21. Set “setid_col” parameter
Example 1.22. Set “setid_col” parameter
...
modparam("dispatcher", "setid_col", "groupid")
...

1.3.21. destination_col (string)
1.3.22. destination_col (string)

The column's name in the database storing the destination's sip
uri.

Default value is “destination”.

Example 1.22. Set “destination_col” parameter
Example 1.23. Set “destination_col” parameter
...
modparam("dispatcher", "destination_col", "uri")
...

1.3.22. state_col (string)
1.3.23. state_col (string)

The column's name in the database storing the state of the
destination uri.

Default value is “state”.

Example 1.23. Set “state_col” parameter
Example 1.24. Set “state_col” parameter
...
modparam("dispatcher", "state_col", "dststate")
...

1.3.23. weight_col (string)
1.3.24. weight_col (string)

The column's name in the database storing the weight for
destination uri.

Default value is “weight”.

Example 1.24. Set “weight_col” parameter
Example 1.25. Set “weight_col” parameter
...
modparam("dispatcher", "weight_col", "dstweight")
...

1.3.24. priority_col (string)
1.3.25. priority_col (string)

The column's name in the database storing the priority for
destination uri.

Default value is “priority”.

Example 1.25. Set “priority_col” parameter
Example 1.26. Set “priority_col” parameter
...
modparam("dispatcher", "priority_col", "dstprio")
...

1.3.25. attrs_col (string)
1.3.26. attrs_col (string)

The column's name in the database storing the attributes
(opaque string) for destination uri.

Default value is “attrs”.

Example 1.26. Set “attrs_col” parameter
Example 1.27. Set “attrs_col” parameter
...
modparam("dispatcher", "attrs_col", "dstattrs")
...

1.3.26. socket_col (string)
1.3.27. socket_col (string)

The column's name in the database storing the socket (as
string) for destination uri.

Default value is “socket”.

Example 1.27. Set “socket_col” parameter
Example 1.28. Set “socket_col” parameter
...
modparam("dispatcher", "socket_col", "my_sock")
...
Expand Down Expand Up @@ -655,7 +670,7 @@ modparam("dispatcher", "socket_col", "my_sock")

This function can be used from REQUEST_ROUTE and FAILURE_ROUTE.

Example 1.28. ds_select_dst usage
Example 1.29. ds_select_dst usage
...
ds_select_dst("1", "0");
...
Expand Down Expand Up @@ -763,7 +778,7 @@ ds_select_dst("$var(part_name):$var(setid)","$var(alg)","$var(flags)");
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE, LOCAL_ROUTE, TIMER_ROUTE, EVENT_ROUTE

Example 1.29. ds_count usage
Example 1.30. ds_count usage
...
if (ds_count("1", "a", "$avp(result)")) {
...
Expand Down Expand Up @@ -801,7 +816,7 @@ if (ds_count("$avp(partition) : $avp(set)", "ip", "$avp(result)")) {
This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
BRANCH_ROUTE and ONREPLY_ROUTE.

Example 1.30. ds_is_in_list usage
Example 1.31. ds_is_in_list usage
...
if (ds_is_in_list("$si", "$sp")) {
# source IP:PORT is in a dispatcher list
Expand Down Expand Up @@ -889,7 +904,7 @@ _empty_line_

Next picture displays a sample usage of dispatcher.

Example 1.31. OpenSIPS config script - sample dispatcher usage
Example 1.32. OpenSIPS config script - sample dispatcher usage
...
#
# $Id$
Expand Down
20 changes: 20 additions & 0 deletions modules/dispatcher/doc/dispatcher_admin.xml
Expand Up @@ -506,6 +506,26 @@ modparam("dispatcher", "pvar_algo_pattern", "$stat(load_%u)")
</example>
</section>

<section>
<title><varname>persistent_state</varname> (int)</title>
<para>
Specifies whether the <emphasis>state</emphasis> column
should be loaded at startup and flushed during runtime or not.
</para>
<para>
<emphasis>Default value is <quote>1</quote> (enabled).
</emphasis>
</para>
<example>
<title>Set the <varname>persistent_state</varname> parameter</title>
<programlisting format="linespecific">
...
# disable all DB operations with the state of a destination
modparam("dispatcher", "persistent_state", 0)
...
</programlisting>
</example>
</section>

<section>
<title><varname>table_name</varname> (string)</title>
Expand Down

0 comments on commit 4d019ce

Please sign in to comment.