Skip to content

Commit

Permalink
modules: readme files regenerated - db_redis ... [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kamailio-dev committed Jun 20, 2023
1 parent d29d435 commit d7ae9f1
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 16 deletions.
62 changes: 58 additions & 4 deletions src/modules/db_redis/README
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Alex Balashov

<abalashov@evaristesys.com>

Joel Centelles Martin

<joel_centellesmartin@baxter.com>

Copyright © 2018 sipwise.com
__________________________________________________________________

Expand All @@ -33,6 +37,9 @@ Alex Balashov
4.1. schema_path (string)
4.2. keys (string)
4.3. verbosity (int)
4.4. opt_tls (int)
4.5. db_pass (string)
4.6. ac_path (string)

5. Usage
6. Module Specific Considerations
Expand All @@ -44,8 +51,11 @@ Alex Balashov
1.1. Setting schema_path module parameter
1.2. Setting keys module parameter
1.3. Setting verbosity module parameter
1.4. Usage
1.5. Usage
1.4. Enabling TLS connection
1.5. Setting a password
1.6. Setting CA path
1.7. Usage
1.8. Usage

Chapter 1. Admin Guide

Expand All @@ -63,6 +73,9 @@ Chapter 1. Admin Guide
4.1. schema_path (string)
4.2. keys (string)
4.3. verbosity (int)
4.4. opt_tls (int)
4.5. db_pass (string)
4.6. ac_path (string)

5. Usage
6. Module Specific Considerations
Expand Down Expand Up @@ -188,6 +201,9 @@ allid,time_hires&cid:callid
4.1. schema_path (string)
4.2. keys (string)
4.3. verbosity (int)
4.4. opt_tls (int)
4.5. db_pass (string)
4.6. ac_path (string)

4.1. schema_path (string)

Expand Down Expand Up @@ -226,6 +242,40 @@ m:username,domain&timer:partition,keepalive")
modparam("db_redis", "verbosity", 0)
...

4.4. opt_tls (int)

Controls TLS usage while connecting to a remote DB. If set to 1, TLS is
used to connect to the DB.

Default value: 0.

Example 1.4. Enabling TLS connection
...
modparam("db_redis", "opt_tls", 1)
...

4.5. db_pass (string)

Sets the password to connect to the DB.

Default value: "" (empty).

Example 1.5. Setting a password
...
modparam("db_redis", "db_pass", "r3d1sPass")
...

4.6. ac_path (string)

Sets the path where Certificates Authorities certs are stored.

Default value: "" (empty).

Example 1.6. Setting CA path
...
modparam("db_redis", "ca_path", "/etc/ssl/certs")
...

5. Usage

Load the module and set the "db_url" modparam for specific modules to:
Expand All @@ -236,7 +286,11 @@ modparam("db_redis", "verbosity", 0)
separated list of cluster hosts: 'redis://host1:port1,host2:port2/'.
The database portion is not supported in cluster mode.

Example 1.4. Usage
If accessed DB requires TLS connections, you need to enable TLS support
setting the "opt_tls" parameter to 1. In case the DB requires a
password, that should be set using the "db_pass" parameter.

Example 1.7. Usage
...
loadmodule "db_redis.so"
...
Expand Down Expand Up @@ -269,7 +323,7 @@ modparam("dialog", "db_url", DBURL_DLG)

Samples adding records for address table using 'redis-cli':

Example 1.5. Usage
Example 1.8. Usage
...
SELECT 8
HMSET address:entry::1 id 1 grp 1 ip_addr "127.0.0.1" mask 32 port 0
Expand Down
46 changes: 34 additions & 12 deletions src/modules/ndb_redis/README
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Carsten Bock

<carsten@ng-voice.com>

Joel Centelles Martin

<joel_centellesmartin@baxter.com>

Copyright © 2011 asipto.com

Copyright © 2012 www.systemonenoc.com
Expand Down Expand Up @@ -51,6 +55,7 @@ Carsten Bock
3.8. flush_on_reconnect (integer)
3.9. allow_dynamic_nodes (integer)
3.10. debug (integer)
3.11. ac_path (string)

4. Functions

Expand All @@ -71,9 +76,10 @@ Carsten Bock
1.8. Set flush_on_reconnect parameter
1.9. Set allow_dynamic_nodes parameter
1.10. Set debug parameter
1.11. redis_cmd usage
1.12. redis_execute usage
1.13. redis_free usage
1.11. Setting CA path
1.12. redis_cmd usage
1.13. redis_execute usage
1.14. redis_free usage

Chapter 1. Admin Guide

Expand All @@ -97,6 +103,7 @@ Chapter 1. Admin Guide
3.8. flush_on_reconnect (integer)
3.9. allow_dynamic_nodes (integer)
3.10. debug (integer)
3.11. ac_path (string)

4. Functions

Expand Down Expand Up @@ -142,18 +149,20 @@ Chapter 1. Admin Guide
3.8. flush_on_reconnect (integer)
3.9. allow_dynamic_nodes (integer)
3.10. debug (integer)
3.11. ac_path (string)

3.1. server (str)

Specify the details to connect to REDIS server. It takes a list of
attribute=value separated by semicolon, the attributes can be name,
unix, addr, port, db and pass. Name is a generic identifier to be used
with module functions. unix is the path to the unix domain socket
unix, addr, port, db, pass and tls. Name is a generic identifier to be
used with module functions. unix is the path to the unix domain socket
provided by redis server. addr and port are the IP address and the port
to connect to REDIS server. pass is the server password. unix and
(addr, port) are mutually exclusive. If both appear in same server
settings unix domain socket is configured. db is the DB number to use
(defaults to 0 if not specified).
to connect to REDIS server. pass is the server password. tls is to
enable TLS connectivity. unix and (addr, port) are mutually exclusive.
If both appear in same server settings unix domain socket is
configured. db is the DB number to use (defaults to 0 if not
specified).

You can set this parameter many times, in case you want to connect to
many REDIS servers, just give different attributes and use the specific
Expand All @@ -166,6 +175,8 @@ Chapter 1. Admin Guide
modparam("ndb_redis", "server", "name=srvN;addr=127.0.0.1;port=6379;db=1")
modparam("ndb_redis", "server", "name=srvX;addr=127.0.0.2;port=6379;db=4;pass=my
password")
modparam("ndb_redis", "server", "name=srvY;addr=127.0.0.3;port=6379;db=5;pass=my
password;tls=1")

# Unix domain socket
modparam("ndb_redis", "server", "name=srvY;unix=/tmp/redis.sock;db=3")
Expand Down Expand Up @@ -335,6 +346,17 @@ modparam("ndb_redis", "allow_dynamic_nodes", 1)
modparam("ndb_redis", "debug", 1)
...

3.11. ac_path (string)

Sets the path where Certificates Authorities certs are stored.

Default value: "" (empty).

Example 1.11. Setting CA path
...
modparam("db_redis", "ca_path", "/etc/ssl/certs")
...

4. Functions

4.1. redis_cmd(srvname, command, ..., replyid)
Expand Down Expand Up @@ -375,7 +397,7 @@ modparam("ndb_redis", "debug", 1)
value. The key can be: rpl_str, rpl_arr, rpl_int, rpl_err, rpl_sts,
rpl_nil.

Example 1.11. redis_cmd usage
Example 1.12. redis_cmd usage
...
if(redis_cmd("srvN", "INCR cnt", "r")) {
# success - the incremented value is in $redis(r=>value)
Expand Down Expand Up @@ -454,7 +476,7 @@ if (redis_cmd("srvN", "EXEC", "r")) {
If cluster parameter is set to 1, this function will log an error and
do nothing.

Example 1.12. redis_execute usage
Example 1.13. redis_execute usage
...
After several redis command calls:
redis_pipe_cmd("srvA", "SET foo bar", "r1");
Expand Down Expand Up @@ -502,7 +524,7 @@ d commands. The call is not necessary
function. When ndb_redis module closes, all pending replies are freed
automatically.

Example 1.13. redis_free usage
Example 1.14. redis_free usage
...
After a redis command call:
redis_cmd("srvN", "INCR cnt", "r");
Expand Down

0 comments on commit d7ae9f1

Please sign in to comment.