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