Module: sip-router
Branch: mariuszbihlei/p_usrloc
Commit: ace6ce17edf6affe6cb144bbe055d8a6d2537281
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ace6ce1…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Tue Jan 11 13:45:49 2011 +0200
modules_k/p_usrloc Updated documentation
---
modules_k/p_usrloc/README | 61 +++++++++++++++++++++++++++---
modules_k/p_usrloc/doc/p_usrloc_user.xml | 46 +++++++++++++++++++++-
2 files changed, 99 insertions(+), 8 deletions(-)
diff --git a/modules_k/p_usrloc/README b/modules_k/p_usrloc/README
index edf137e..95ba3f6 100644
--- a/modules_k/p_usrloc/README
+++ b/modules_k/p_usrloc/README
@@ -54,6 +54,8 @@ Marius Zbihlei
3.20. write_on_db (int)
3.21. connection_expires (int)
3.22. alg_location (int)
+ 3.23. domain_db(str)
+ 3.24. default_db_type(str)
4. Changes from usrloc module
@@ -119,14 +121,16 @@ Marius Zbihlei
1.20. Set write_on_db parameter
1.21. Set connection_expires parameter
1.22. Set alg_location parameter
- 1.23. Set db_mode parameter
- 1.24. Example database content - reg_table (locdb) table
+ 1.23. Set domain_db parameter
+ 1.24. Set default_db_type parameter
+ 1.25. Set db_mode parameter
+ 1.26. Example database content - reg_table (locdb) table
Chapter 1. User's Guide
Revision History
- Revision $Revision: 2 $ $Date: 2005-06-13 18:47:24 +0200 (Mo, 13 Jun
- 2005) $
+ Revision $Revision: 3 $ $Date: 2011-01-10 12:00:00 +0200 (Mo, 10 Jan
+ 2011) $
Table of Contents
@@ -160,6 +164,8 @@ Chapter 1. User's Guide
3.20. write_on_db (int)
3.21. connection_expires (int)
3.22. alg_location (int)
+ 3.23. domain_db(str)
+ 3.24. default_db_type(str)
4. Changes from usrloc module
@@ -225,6 +231,11 @@ Chapter 1. User's Guide
activated. It also supports the manual deactivation of redundant
databases for maintenance purposes.
+Warning
+
+ The p_usrloc module still has some missing feature, like automatic
+ expiry of contacts and dumping of all users via the fifo cmd.
+
2. Dependencies
2.1. Kamailio Modules
@@ -266,6 +277,8 @@ Chapter 1. User's Guide
3.20. write_on_db (int)
3.21. connection_expires (int)
3.22. alg_location (int)
+ 3.23. domain_db(str)
+ 3.24. default_db_type(str)
3.1. write_db_url (string)
@@ -550,6 +563,42 @@ modparam("p_usrloc", "connection_expires", "300")
modparam("p_usrloc", "alg_location", 1)
...
+3.23. domain_db(str)
+
+ Specify the way the lookup is made. In can be either partitioned or
+ single. For example, if you have a location table that is large and
+ needs to be partitioned, and a smaller table cfa that is ok to be on
+ only the master db(so there is no need to have it distributed), you can
+ set this parameter to “location=cluster,cfa=single”. This means that a
+ call to
+lookup(location)
+
+ will be done via the partition databases configured via the
+ reg_db_table parameter, but a call to
+lookup(cfa)
+
+ will be done on only the master database (as with usrloc module)
+
+ Default value is “location=cluster,cfa=single”.
+
+ Example 1.23. Set domain_db parameter
+...
+modparam("p_usrloc", "domain_db", "location=cluster,cfa=single")
+...
+
+3.24. default_db_type(str)
+
+ In case of a domain (like location,cfa) is not matched by a domain_db
+ definition, the type is configured by using this parameter. Accepted
+ values are single and cluster.
+
+ Default value is “single”.
+
+ Example 1.24. Set default_db_type parameter
+...
+modparam("p_usrloc", "default_db_type", "cluster")
+...
+
4. Changes from usrloc module
4.1. db_mode (integer)
@@ -583,7 +632,7 @@ modparam("p_usrloc", "alg_location", 1)
Default value is 3.
- Example 1.23. Set db_mode parameter
+ Example 1.25. Set db_mode parameter
...
modparam("p_usrloc", "db_mode", 2)
...
@@ -617,7 +666,7 @@ modparam("p_usrloc", "db_mode", 2)
complete database documentation on the project webpage,
http://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.
- Example 1.24. Example database content - reg_table (locdb) table
+ Example 1.26. Example database content - reg_table (locdb) table
...
+----+----+------+--------+--------+---------------------+-------+----+
| id | no | url | status | errors | failover | spare | rg |
diff --git a/modules_k/p_usrloc/doc/p_usrloc_user.xml b/modules_k/p_usrloc/doc/p_usrloc_user.xml
index 6690909..0ee113a 100644
--- a/modules_k/p_usrloc/doc/p_usrloc_user.xml
+++ b/modules_k/p_usrloc/doc/p_usrloc_user.xml
@@ -4,8 +4,8 @@
<chapterinfo>
<revhistory>
<revision>
- <revnumber>$Revision: 2 $</revnumber>
- <date>$Date: 2005-06-13 18:47:24 +0200 (Mo, 13 Jun 2005) $</date>
+ <revnumber>$Revision: 3 $</revnumber>
+ <date>$Date: 2011-01-10 12:00:00 +0200 (Mo, 10 Jan 2011) $</date>
</revision>
</revhistory>
</chapterinfo>
@@ -63,6 +63,10 @@
of a database error with the usage of spare databases that are automatically activated.
It also supports the manual deactivation of redundant databases for maintenance purposes.
</para>
+
+ <para><warning>
+ The p_usrloc module still has some missing feature, like automatic expiry of contacts and dumping of all users via the fifo cmd.
+ </warning></para>
</section>
<section>
<title>Dependencies</title>
@@ -559,6 +563,44 @@ modparam("p_usrloc", "alg_location", 1)
</programlisting>
</example>
</section>
+ <section>
+ <title><varname>domain_db</varname>(str)</title>
+ <para>
+ Specify the way the lookup is made. In can be either partitioned or single. For example, if you have a location table that is large and needs to be partitioned, and a smaller table cfa that is ok to be on only the master db(so there is no need to have it distributed), you can set this parameter to <quote>location=cluster,cfa=single</quote>. This means that a call to <programlisting>lookup(location)</programlisting> will be done via the partition databases configured via the reg_db_table parameter, but a call to <programlisting>lookup(cfa)</programlisting> will be done on only the master database (as with usrloc module)
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>location=cluster,cfa=single</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>domain_db</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("p_usrloc", "domain_db", "location=cluster,cfa=single")
+...
+</programlisting>
+ </example>
+ </section>
+ <section>
+ <title><varname>default_db_type</varname>(str)</title>
+ <para>
+ In case of a domain (like location,cfa) is not matched by a domain_db definition, the type is configured by using this parameter. Accepted values are single and cluster.
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>single</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>default_db_type</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("p_usrloc", "default_db_type", "cluster")
+...
+</programlisting>
+ </example>
+ </section>
</section>
<section>
<title> Changes from usrloc module </title>
Module: sip-router
Branch: mariuszbihlei/p_usrloc
Commit: edef9f7b0d3a67a349b53b8f5779550eb0a56b98
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=edef9f7…
Author: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Committer: Marius Zbihlei <marius.zbihlei(a)1and1.ro>
Date: Tue Jan 11 12:19:06 2011 +0200
modules/p_usrloc Updated documentation
---
modules_k/p_usrloc/README | 96 +++++++++++++++++++++++-------
modules_k/p_usrloc/doc/p_usrloc_user.xml | 63 +++++++++++++++++++
2 files changed, 138 insertions(+), 21 deletions(-)
diff --git a/modules_k/p_usrloc/README b/modules_k/p_usrloc/README
index 90e3b75..edf137e 100644
--- a/modules_k/p_usrloc/README
+++ b/modules_k/p_usrloc/README
@@ -55,14 +55,19 @@ Marius Zbihlei
3.21. connection_expires (int)
3.22. alg_location (int)
- 4. Installation & Running
+ 4. Changes from usrloc module
- 4.1. Database setup
+ 4.1. db_mode (integer)
+ 4.2. db_url
- 4.1.1. Configuration Table
+ 5. Installation & Running
- 4.2. Maintenance
- 4.3. Additional configuration
+ 5.1. Database setup
+
+ 5.1.1. Configuration Table
+
+ 5.2. Maintenance
+ 5.3. Additional configuration
2. Developer's Guide
@@ -114,7 +119,8 @@ Marius Zbihlei
1.20. Set write_on_db parameter
1.21. Set connection_expires parameter
1.22. Set alg_location parameter
- 1.23. Example database content - reg_table (locdb) table
+ 1.23. Set db_mode parameter
+ 1.24. Example database content - reg_table (locdb) table
Chapter 1. User's Guide
@@ -155,14 +161,19 @@ Chapter 1. User's Guide
3.21. connection_expires (int)
3.22. alg_location (int)
- 4. Installation & Running
+ 4. Changes from usrloc module
+
+ 4.1. db_mode (integer)
+ 4.2. db_url
+
+ 5. Installation & Running
- 4.1. Database setup
+ 5.1. Database setup
- 4.1.1. Configuration Table
+ 5.1.1. Configuration Table
- 4.2. Maintenance
- 4.3. Additional configuration
+ 5.2. Maintenance
+ 5.3. Additional configuration
1. Overview
@@ -539,18 +550,61 @@ modparam("p_usrloc", "connection_expires", "300")
modparam("p_usrloc", "alg_location", 1)
...
-4. Installation & Running
+4. Changes from usrloc module
+
+ 4.1. db_mode (integer)
+ 4.2. db_url
+
+4.1. db_mode (integer)
+
+ The p_usrloc module must utilize database for persistent contact
+ storage. So mode 0 makes no sense in this setup.
+ * 1 - Write-Through scheme. All changes to usrloc are immediately
+ reflected in database too. This is very slow, but very reliable.
+ Use this scheme if speed is not your priority but need to make sure
+ that no registered contacts will be lost during crash or reboot.
+ * 2 - Write-Back scheme. This is a combination of previous two
+ schemes. All changes are made to memory and database
+ synchronization is done in the timer. The timer deletes all expired
+ contacts and flushes all modified or new contacts to database. Use
+ this scheme if you encounter high-load peaks and want them to
+ process as fast as possible. The mode will not help at all if the
+ load is high all the time. Also, latency of this mode is much lower
+ than latency of mode 1, but slightly higher than latency of mode 0.
+ * 3 - DB-Only scheme. No memory cache is kept, all operations being
+ directly performed with the database. The timer deletes all expired
+ contacts from database - cleans after clients that didn't
+ un-register or re-register. The mode is useful if you configure
+ more servers sharing the same DB without any replication at SIP
+ level. The mode may be slower due the high number of DB operation.
+ For example NAT pinging is a killer since during each ping cycle
+ all nated contact are loaded from the DB; The lack of memory
+ caching also disable the statistics exports.
+
+ Default value is 3.
+
+ Example 1.23. Set db_mode parameter
+...
+modparam("p_usrloc", "db_mode", 2)
+...
+
+4.2. db_url
+
+ This parameters is now obsolete, and replaced by specific p_usrloc
+ parameters
+
+5. Installation & Running
- 4.1. Database setup
+ 5.1. Database setup
- 4.1.1. Configuration Table
+ 5.1.1. Configuration Table
- 4.2. Maintenance
- 4.3. Additional configuration
+ 5.2. Maintenance
+ 5.3. Additional configuration
-4.1. Database setup
+5.1. Database setup
-4.1.1. Configuration Table
+5.1.1. Configuration Table
Before running Kamailio with p_usrloc, you have to setup the master
database table where the module will find data about the distributed
@@ -563,7 +617,7 @@ modparam("p_usrloc", "alg_location", 1)
complete database documentation on the project webpage,
http://www.kamailio.org/docs/db-tables/kamailio-db-devel.html.
- Example 1.23. Example database content - reg_table (locdb) table
+ Example 1.24. Example database content - reg_table (locdb) table
...
+----+----+------+--------+--------+---------------------+-------+----+
| id | no | url | status | errors | failover | spare | rg |
@@ -583,7 +637,7 @@ modparam("p_usrloc", "alg_location", 1)
This table contains two database groups. The first with id one, and the
second with the id two.
-4.2. Maintenance
+5.2. Maintenance
The module supports the decativation of redundant databases for
maintenance reasons. This can be done by setting the status column of
@@ -606,7 +660,7 @@ modparam("p_usrloc", "alg_location", 1)
then also used to read contacts from, the cluster is in normal
operation with full redundancy again.
-4.3. Additional configuration
+5.3. Additional configuration
As this module is only used internally from other modules, there is no
additional configuration except for the module parameter setup
diff --git a/modules_k/p_usrloc/doc/p_usrloc_user.xml b/modules_k/p_usrloc/doc/p_usrloc_user.xml
index 537a327..6690909 100644
--- a/modules_k/p_usrloc/doc/p_usrloc_user.xml
+++ b/modules_k/p_usrloc/doc/p_usrloc_user.xml
@@ -561,6 +561,69 @@ modparam("p_usrloc", "alg_location", 1)
</section>
</section>
<section>
+ <title> Changes from usrloc module </title>
+ <section>
+ <title><varname>db_mode</varname> (integer)</title>
+ <para>
+ The p_usrloc module must utilize database for persistent contact storage.
+ So mode 0 makes no sense in this setup.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ 1 - Write-Through scheme. All changes to usrloc are immediately
+ reflected in database too. This is very slow, but very reliable.
+ Use this scheme if speed is not your priority but need to make
+ sure that no registered contacts will be lost during crash or
+ reboot.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 2 - Write-Back scheme. This is a combination of previous two
+ schemes. All changes are made to memory and database
+ synchronization is done in the timer. The timer deletes all
+ expired contacts and flushes all modified or new contacts to
+ database. Use this scheme if you encounter high-load peaks
+ and want them to process as fast as possible. The mode will
+ not help at all if the load is high all the time. Also, latency
+ of this mode is much lower than latency of mode 1, but slightly
+ higher than latency of mode 0.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 3 - DB-Only scheme. No memory cache is kept, all operations being
+ directly performed with the database. The timer deletes all
+ expired contacts from database - cleans after clients that didn't
+ un-register or re-register. The mode is useful if you configure
+ more servers sharing the same DB without any replication at SIP
+ level. The mode may be slower due the high number of DB operation.
+ For example NAT pinging is a killer since during each ping cycle
+ all nated contact are loaded from the DB; The lack of memory
+ caching also disable the statistics exports.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ <emphasis>
+ Default value is 3.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>db_mode</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("p_usrloc", "db_mode", 2)
+...
+</programlisting>
+ </example>
+ </section>
+ <section>
+ <title><varname>db_url</varname></title> <para> This parameters is now obsolete, and replaced by specific p_usrloc parameters</para>
+ </section>
+ </section>
+ <section>
<title>Installation & Running</title>
<section>
<title>Database setup</title>