Skip to content

Commit

Permalink
usrloc: Document the new "kv_store" column
Browse files Browse the repository at this point in the history
  • Loading branch information
liviuchircu committed Jan 23, 2018
1 parent 2333d0d commit f7bf268
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 63 deletions.
131 changes: 72 additions & 59 deletions modules/usrloc/README
Expand Up @@ -51,20 +51,21 @@ Ovidiu Sas
1.3.14. socket_column (string)
1.3.15. path_column (string)
1.3.16. sip_instance_column (string)
1.3.17. attr_column (string)
1.3.18. use_domain (integer)
1.3.19. desc_time_order (integer)
1.3.20. timer_interval (integer)
1.3.21. db_url (string)
1.3.22. db_mode (integer)
1.3.23. matching_mode (integer)
1.3.24. cseq_delay (integer)
1.3.25. accept_replicated_contacts (integer)
1.3.26. replicate_contacts_to (integer)
1.3.27. skip_replicated_db_ops (int)
1.3.28. max_contact_delete (int)
1.3.29. hash_size (integer)
1.3.30. regen_broken_contactid (integer)
1.3.17. kv_store_column (string)
1.3.18. attr_column (string)
1.3.19. use_domain (integer)
1.3.20. desc_time_order (integer)
1.3.21. timer_interval (integer)
1.3.22. db_url (string)
1.3.23. db_mode (integer)
1.3.24. matching_mode (integer)
1.3.25. cseq_delay (integer)
1.3.26. accept_replicated_contacts (integer)
1.3.27. replicate_contacts_to (integer)
1.3.28. skip_replicated_db_ops (int)
1.3.29. max_contact_delete (int)
1.3.30. hash_size (integer)
1.3.31. regen_broken_contactid (integer)

1.4. Exported Functions
1.5. Exported MI Functions
Expand Down Expand Up @@ -145,20 +146,21 @@ Ovidiu Sas
1.14. Set socket_column parameter
1.15. Set path_column parameter
1.16. Set sip_instance_column parameter
1.17. Set attr_column parameter
1.18. Set use_domain parameter
1.19. Set desc_time_order parameter
1.20. Set timer_interval parameter
1.21. Set db_url parameter
1.22. Set db_mode parameter
1.23. Set matching_mode parameter
1.24. Set cseq_delay parameter
1.25. Setting the accept_replicated_contacts parameter
1.26. Setting the replicate_contacts_to parameter
1.27. Setting the skip_replicated_db_ops parameter
1.28. Setting the max_contact_delete parameter
1.29. Set hash_size parameter
1.30. Set regen_broken_contactid parameter
1.17. Set kv_store_column parameter
1.18. Set attr_column parameter
1.19. Set use_domain parameter
1.20. Set desc_time_order parameter
1.21. Set timer_interval parameter
1.22. Set db_url parameter
1.23. Set db_mode parameter
1.24. Set matching_mode parameter
1.25. Set cseq_delay parameter
1.26. Setting the accept_replicated_contacts parameter
1.27. Setting the replicate_contacts_to parameter
1.28. Setting the skip_replicated_db_ops parameter
1.29. Setting the max_contact_delete parameter
1.30. Set hash_size parameter
1.31. Set regen_broken_contactid parameter

Chapter 1. Admin Guide

Expand Down Expand Up @@ -195,7 +197,7 @@ Chapter 1. Admin Guide

For more details on how to control/select the contact matching
algorithm, please see the module parameter matching_mode at
Section 1.3.23, “matching_mode (integer)”.
Section 1.3.24, “matching_mode (integer)”.

1.1.2. Contact replication

Expand Down Expand Up @@ -434,71 +436,82 @@ modparam("usrloc", "path_column", "path")
modparam("usrloc", "sip_instance_column", "sip_instance")
...

1.3.17. attr_column (string)
1.3.17. kv_store_column (string)

Name of column containing generic key-value data.

Default value is “kv_store”.

Example 1.17. Set kv_store_column parameter
...
modparam("usrloc", "kv_store_column", "json_data")
...

1.3.18. attr_column (string)

Name of column containing additional registration-related
information.

Default value is “NULL”.
Default value is “attr”.

Example 1.17. Set attr_column parameter
Example 1.18. Set attr_column parameter
...
modparam("usrloc", "attr_column", "attr")
modparam("usrloc", "attr_column", "attributes")
...

1.3.18. use_domain (integer)
1.3.19. use_domain (integer)

If the domain part of the user should be also saved and used
for identifing the user (along with the username part). Useful
in multi domain scenarios. Non 0 value means true.

Default value is “0 (false)”.

Example 1.18. Set use_domain parameter
Example 1.19. Set use_domain parameter
...
modparam("usrloc", "use_domain", 1)
...

1.3.19. desc_time_order (integer)
1.3.20. desc_time_order (integer)

If the user's contacts should be kept timestamp ordered;
otherwise the contact will be ordered based on q value. Non 0
value means true.

Default value is “0 (false)”.

Example 1.19. Set desc_time_order parameter
Example 1.20. Set desc_time_order parameter
...
modparam("usrloc", "desc_time_order", 1)
...

1.3.20. timer_interval (integer)
1.3.21. timer_interval (integer)

Number of seconds between two timer runs. The module uses timer
to delete expired contacts, synchronize with database and other
tasks, that need to be run periodically.

Default value is 60.

Example 1.20. Set timer_interval parameter
Example 1.21. Set timer_interval parameter
...
modparam("usrloc", "timer_interval", 120)
...

1.3.21. db_url (string)
1.3.22. db_url (string)

URL of the database that should be used.

Default value is
“mysql://opensips:opensipsrw@localhost/opensips”.

Example 1.21. Set db_url parameter
Example 1.22. Set db_url parameter
...
modparam("usrloc", "db_url", "dbdriver://username:password@dbhost/dbname
")
...

1.3.22. db_mode (integer)
1.3.23. db_mode (integer)

The usrloc module can utilize database for persistent contact
storage. If you use database, your contacts will survive
Expand Down Expand Up @@ -542,12 +555,12 @@ Warning

Default value is 0.

Example 1.22. Set db_mode parameter
Example 1.23. Set db_mode parameter
...
modparam("usrloc", "db_mode", 2)
...

1.3.23. matching_mode (integer)
1.3.24. matching_mode (integer)

What contact matching algorithm to be used. Refer to section
Section 1.1.1, “Contact matching” for the description of the
Expand All @@ -559,12 +572,12 @@ modparam("usrloc", "db_mode", 2)

Default value is 0 (CONTACT_ONLY).

Example 1.23. Set matching_mode parameter
Example 1.24. Set matching_mode parameter
...
modparam("usrloc", "matching_mode", 1)
...

1.3.24. cseq_delay (integer)
1.3.25. cseq_delay (integer)

Delay (in seconds) for accepting as retransmissions register
requests with same Call-ID and Cseq. The delay is calculated
Expand All @@ -579,12 +592,12 @@ modparam("usrloc", "matching_mode", 1)

Default value is “20 seconds”.

Example 1.24. Set cseq_delay parameter
Example 1.25. Set cseq_delay parameter
...
modparam("usrloc", "cseq_delay", 5)
...

1.3.25. accept_replicated_contacts (integer)
1.3.26. accept_replicated_contacts (integer)

Set this to a valid cluster id in order to accept and process
user-location related information received from other OpenSIPS
Expand All @@ -598,12 +611,12 @@ modparam("usrloc", "cseq_delay", 5)
More details on the user location replication mechanism are
available in Section 1.1.2, “Contact replication”

Example 1.25. Setting the accept_replicated_contacts parameter
Example 1.26. Setting the accept_replicated_contacts parameter
...
modparam("usrloc", "accept_replicated_contacts", 1)
...

1.3.26. replicate_contacts_to (integer)
1.3.27. replicate_contacts_to (integer)

Defines the OpenSIPS instances that belong to a ceratin cluster
which will receive all the user-location related information
Expand All @@ -615,12 +628,12 @@ modparam("usrloc", "accept_replicated_contacts", 1)
More details on the user location replication mechanism are
available in Section 1.1.2, “Contact replication”

Example 1.26. Setting the replicate_contacts_to parameter
Example 1.27. Setting the replicate_contacts_to parameter
...
modparam("usrloc", "replicate_contacts_to", 1)
...

1.3.27. skip_replicated_db_ops (int)
1.3.28. skip_replicated_db_ops (int)

Prevent OpenSIPS from performing any DB-related contact
operations when events are received over the Binary Interface.
Expand All @@ -632,12 +645,12 @@ modparam("usrloc", "replicate_contacts_to", 1)
More details on the user location replication mechanism are
available in Section 1.1.2, “Contact replication”

Example 1.27. Setting the skip_replicated_db_ops parameter
Example 1.28. Setting the skip_replicated_db_ops parameter
...
modparam("usrloc", "skip_replicated_db_ops", 1)
...

1.3.28. max_contact_delete (int)
1.3.29. max_contact_delete (int)

Relevant only in WRITE_THROUGH or WRITE_BACK schemes. The
maximum number of contacts to be deleted from the database at
Expand All @@ -646,12 +659,12 @@ modparam("usrloc", "skip_replicated_db_ops", 1)

Default value is "10"

Example 1.28. Setting the max_contact_delete parameter
Example 1.29. Setting the max_contact_delete parameter
...
modparam("usrloc", "max_contact_delete", 10)
...

1.3.29. hash_size (integer)
1.3.30. hash_size (integer)

The number of entries of the hash table used by usrloc to store
the location records is 2^hash_size. For hash_size=4, the
Expand All @@ -661,12 +674,12 @@ modparam("usrloc", "max_contact_delete", 10)

Default value is “9”.

Example 1.29. Set hash_size parameter
Example 1.30. Set hash_size parameter
...
modparam("usrloc", "hash_size", 10)
...

1.3.30. regen_broken_contactid (integer)
1.3.31. regen_broken_contactid (integer)

Since version 2.2, contact_id concept was introduced. Since
this parameter validates a contact each time OpenSIPS is
Expand All @@ -678,7 +691,7 @@ modparam("usrloc", "hash_size", 10)

Default value is “0(not enabled)”

Example 1.30. Set regen_broken_contactid parameter
Example 1.31. Set regen_broken_contactid parameter
...
modparam("usrloc", "regen_broken_contactid", 1)
...
Expand Down
24 changes: 22 additions & 2 deletions modules/usrloc/doc/usrloc_admin.xml
Expand Up @@ -495,21 +495,41 @@ modparam("usrloc", "sip_instance_column", "sip_instance")
</example>
</section>

<section>
<title><varname>kv_store_column</varname> (string)</title>
<para>
Name of column containing generic key-value data.
</para>
<para>
<emphasis>
Default value is <quote>kv_store</quote>.
</emphasis>
</para>
<example>
<title>Set <varname>kv_store_column</varname> parameter</title>
<programlisting format="linespecific">
...
modparam("usrloc", "kv_store_column", "json_data")
...
</programlisting>
</example>
</section>

<section>
<title><varname>attr_column</varname> (string)</title>
<para>
Name of column containing additional registration-related information.
</para>
<para>
<emphasis>
Default value is <quote>NULL</quote>.
Default value is <quote>attr</quote>.
</emphasis>
</para>
<example>
<title>Set <varname>attr_column</varname> parameter</title>
<programlisting format="linespecific">
...
modparam("usrloc", "attr_column", "attr")
modparam("usrloc", "attr_column", "attributes")
...
</programlisting>
</example>
Expand Down
4 changes: 2 additions & 2 deletions modules/usrloc/ul_mod.c
Expand Up @@ -121,7 +121,7 @@ str path_col = str_init(PATH_COL); /*!< Name of column containing the Pa
str sock_col = str_init(SOCK_COL); /*!< Name of column containing the received socket */
str methods_col = str_init(METHODS_COL); /*!< Name of column containing the supported methods */
str last_mod_col = str_init(LAST_MOD_COL); /*!< Name of column containing the last modified date */
str kv_store_col = str_init(KV_STORE_COL); /*!< Name of column containing generic key-value data*/
str kv_store_col = str_init(KV_STORE_COL); /*!< Name of column containing generic key-value data */
str attr_col = str_init(ATTR_COL); /*!< Name of column containing additional info */
str sip_instance_col = str_init(SIP_INSTANCE_COL);
str contactid_col = str_init(CONTACTID_COL);
Expand Down Expand Up @@ -182,7 +182,7 @@ static param_export_t params[] = {
{"socket_column", STR_PARAM, &sock_col.s },
{"methods_column", STR_PARAM, &methods_col.s },
{"sip_instance_column",STR_PARAM, &sip_instance_col.s},
{"kv_store", STR_PARAM, &kv_store_col.s },
{"kv_store_column", STR_PARAM, &kv_store_col.s },
{"attr_column", STR_PARAM, &attr_col.s },
{"matching_mode", INT_PARAM, &matching_mode },
{"cseq_delay", INT_PARAM, &cseq_delay },
Expand Down

0 comments on commit f7bf268

Please sign in to comment.