Module: kamailio
Branch: master
Commit: 5c71f59324cd0ced6f73577acd56e234337dfd30
URL: https://github.com/kamailio/kamailio/commit/5c71f59324cd0ced6f73577acd56e23…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-09-24T15:56:10+02:00
db_redis: fixed typos from previous commit
---
Modified: src/modules/db_redis/doc/db_redis_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/5c71f59324cd0ced6f73577acd56e23…
Patch: https://github.com/kamailio/kamailio/commit/5c71f59324cd0ced6f73577acd56e23…
---
diff --git a/src/modules/db_redis/doc/db_redis_admin.xml b/src/modules/db_redis/doc/db_redis_admin.xml
index 12d054712a..50271ac735 100644
--- a/src/modules/db_redis/doc/db_redis_admin.xml
+++ b/src/modules/db_redis/doc/db_redis_admin.xml
@@ -220,7 +220,7 @@ HMSET address:entry::4 id 4 grp 2 ip_addr "127.0.0.4" mask 32 port 0 tag "test"
</example>
<para>
Note that is some cases, the optional values in database tables can be
- ommitted. For 'address' table, the 'tag' value may be ommitted. To avoid
+ omitted. For 'address' table, the 'tag' value may be omitted. To avoid
any issues, set unused fields to their default values as defined by database
schema. When definition allows 'NULL', that field can be unset.
</para>
Module: kamailio
Branch: master
Commit: cc2714a8df27c4e4a5e179bc0443600ec673ff63
URL: https://github.com/kamailio/kamailio/commit/cc2714a8df27c4e4a5e179bc0443600…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2018-09-24T15:46:28+02:00
modules: readme files regenerated - db_redis ... [skip ci]
---
Modified: src/modules/db_redis/README
---
Diff: https://github.com/kamailio/kamailio/commit/cc2714a8df27c4e4a5e179bc0443600…
Patch: https://github.com/kamailio/kamailio/commit/cc2714a8df27c4e4a5e179bc0443600…
---
diff --git a/src/modules/db_redis/README b/src/modules/db_redis/README
index 8378057da5..4f6d8150be 100644
--- a/src/modules/db_redis/README
+++ b/src/modules/db_redis/README
@@ -45,6 +45,7 @@ Alex Balashov
1.1. Setting schema_path module parameter
1.2. Setting keys module parameter
1.3. Usage
+ 1.4. Usage
Chapter 1. Admin Guide
@@ -121,6 +122,15 @@ nce/string,server_id/int,connection_id/int,keepalive/int,partition/int
module also write mappings besides the actual records for billing
systems to correlate start and stop records faster).
+ The key is always prefixed with 'tablename:entry::'. For example the
+ record in 'subscriber' table for user 'alice(a)sip.com' has the key:
+ 'subscriber:entry::alice:sip.com'. If all the records are just loaded
+ at startup (or all reloaded at runtime), the key can just be made
+ unique using whatever values added after 'tablename:entry::' prefix.
+ For example, keys for 'address' table records can be:
+ 'address:entry::1', address:entry::2', address:entry::3', ... No 'keys'
+ modparam of 'db_redis' for 'address' table needs to be defined.
+
The mappings can be freely defined in the "keys" module parameter,
which is composed of a semi-colon separated list of definitions in the
format
@@ -182,7 +192,7 @@ m:username,domain&timer:partition,keepalive")
6. Usage
Load the module and set the "db_url" modparam for specific modules to:
- redis://[username]@host:port/database. Username is optional. The
+ 'redis://[username]@host:port/database'. Username is optional. The
database portion must be a valid Redis database number.
Example 1.3. Usage
@@ -192,16 +202,39 @@ loadmodule "db_redis.so"
#!define DBURL_USRLOC "redis://127.0.0.1:6379/5"
#!define DBURL_ACC "redis://127.0.0.1:6379/6"
#!define DBURL_AUTH "redis://127.0.0.1:6379/7"
+#!define DBURL_PERM "redis://127.0.0.1:6379/8"
...
modparam("db_redis", "schema_path", "/usr/share/kamailio/db_redis/kamailio")
modparam("db_redis", "keys", "location=entry:ruid&usrdom:username,domain&timer:p
artition,keepalive")
modparam("db_redis", "keys", "acc=entry:callid,time_hires&cid:callid")
modparam("db_redis", "keys", "subscriber=entry:username,domain")
+...
modparam("usrloc", "db_url", DBURL_USRLOC)
+...
modparam("acc_db", "db_url", DBURL_ACC)
+...
modparam("auth_db", "db_url", DBURL_AUTH)
...
+modparam("permissions", "db_url", DBURL_PERM)
+...
+
+ Samples adding records for address table using 'redis-cli':
+
+ Example 1.4. Usage
+...
+SELECT 8
+HMSET address:entry::1 id 1 grp 1 ip_addr "127.0.0.1" mask 32 port 0
+HMSET address:entry::2 id 2 grp 1 ip_addr "127.0.0.2" mask 32 port 0
+HMSET address:entry::3 id 3 grp 2 ip_addr "127.0.0.3" mask 32 port 0
+HMSET address:entry::4 id 4 grp 2 ip_addr "127.0.0.4" mask 32 port 0 tag "test"
+...
+
+ Note that is some cases, the optional values in database tables can be
+ ommitted. For 'address' table, the 'tag' value may be ommitted. To
+ avoid any issues, set unused fields to their default values as defined
+ by database schema. When definition allows 'NULL', that field can be
+ unset.
7. Module specific considerations
Module: kamailio
Branch: master
Commit: d4cd77119b55478a6bd35b76a9e7c196c0a71698
URL: https://github.com/kamailio/kamailio/commit/d4cd77119b55478a6bd35b76a9e7c19…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-09-24T15:39:27+02:00
db_redis: docs about keys format and sample records
---
Modified: src/modules/db_redis/doc/db_redis_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/d4cd77119b55478a6bd35b76a9e7c19…
Patch: https://github.com/kamailio/kamailio/commit/d4cd77119b55478a6bd35b76a9e7c19…
---
diff --git a/src/modules/db_redis/doc/db_redis_admin.xml b/src/modules/db_redis/doc/db_redis_admin.xml
index f57fa8064e..12d054712a 100644
--- a/src/modules/db_redis/doc/db_redis_admin.xml
+++ b/src/modules/db_redis/doc/db_redis_admin.xml
@@ -67,6 +67,15 @@ username/string,domain/string,contact/string,received/string,path/string,expires
also write mappings besides the actual records for billing systems to
correlate start and stop records faster).
</para>
+ <para>
+ The key is always prefixed with 'tablename:entry::'. For example the record in
+ 'subscriber' table for user 'alice(a)sip.com' has the key:
+ 'subscriber:entry::alice:sip.com'. If all the records are just loaded at
+ startup (or all reloaded at runtime), the key can just be made unique using whatever
+ values added after 'tablename:entry::' prefix. For example, keys for 'address' table
+ records can be: 'address:entry::1', address:entry::2', address:entry::3', ... No
+ 'keys' modparam of 'db_redis' for 'address' table needs to be defined.
+ </para>
<para>
The mappings can be freely defined in the "keys" module parameter, which is
composed of a semi-colon separated list of definitions in the format
@@ -165,7 +174,7 @@ modparam("db_redis", "keys", "version=entry:table_name;location=entry:ruid&u
<title>Usage</title>
<para>
Load the module and set the "db_url" modparam for specific modules to:
- redis://[username]@host:port/database. Username is optional.
+ 'redis://[username]@host:port/database'. Username is optional.
The database portion must be a valid Redis database number.
</para>
<example>
@@ -177,17 +186,44 @@ loadmodule "db_redis.so"
#!define DBURL_USRLOC "redis://127.0.0.1:6379/5"
#!define DBURL_ACC "redis://127.0.0.1:6379/6"
#!define DBURL_AUTH "redis://127.0.0.1:6379/7"
+#!define DBURL_PERM "redis://127.0.0.1:6379/8"
...
modparam("db_redis", "schema_path", "/usr/share/kamailio/db_redis/kamailio")
modparam("db_redis", "keys", "location=entry:ruid&usrdom:username,domain&timer:partition,keepalive")
modparam("db_redis", "keys", "acc=entry:callid,time_hires&cid:callid")
modparam("db_redis", "keys", "subscriber=entry:username,domain")
+...
modparam("usrloc", "db_url", DBURL_USRLOC)
+...
modparam("acc_db", "db_url", DBURL_ACC)
+...
modparam("auth_db", "db_url", DBURL_AUTH)
+...
+modparam("permissions", "db_url", DBURL_PERM)
...
</programlisting>
</example>
+ <para>
+ Samples adding records for address table using 'redis-cli':
+ </para>
+ <example>
+ <title>Usage</title>
+ <programlisting format="linespecific">
+...
+SELECT 8
+HMSET address:entry::1 id 1 grp 1 ip_addr "127.0.0.1" mask 32 port 0
+HMSET address:entry::2 id 2 grp 1 ip_addr "127.0.0.2" mask 32 port 0
+HMSET address:entry::3 id 3 grp 2 ip_addr "127.0.0.3" mask 32 port 0
+HMSET address:entry::4 id 4 grp 2 ip_addr "127.0.0.4" mask 32 port 0 tag "test"
+...
+ </programlisting>
+ </example>
+ <para>
+ Note that is some cases, the optional values in database tables can be
+ ommitted. For 'address' table, the 'tag' value may be ommitted. To avoid
+ any issues, set unused fields to their default values as defined by database
+ schema. When definition allows 'NULL', that field can be unset.
+ </para>
</section>
<section>