diff --git a/modules/cachedb_redis/cachedb_redis_dbase.c b/modules/cachedb_redis/cachedb_redis_dbase.c index ec4514e379..2f63aad0c6 100644 --- a/modules/cachedb_redis/cachedb_redis_dbase.c +++ b/modules/cachedb_redis/cachedb_redis_dbase.c @@ -1234,7 +1234,7 @@ static char *redis_dict_to_json_root(const cdb_dict_t *dict, break; case CDB_INT64: - i += sprintf(obj+i, "%ld", pair->val.val.i64); + i += sprintf(obj+i, "%lld", (long long)pair->val.val.i64); break; case CDB_NULL: @@ -1479,6 +1479,9 @@ int redis_update_subkeys(cachedb_con *_con, const cdb_filter_t *row_filter, } set_expire: + if (fts_json_mset_expire <= 0) + goto out; + /* refresh the expiry on the JSON */ argv[0] = "EXPIRE"; argvlen[0] = strlen(argv[0]); @@ -1510,6 +1513,7 @@ int redis_update_subkeys(cachedb_con *_con, const cdb_filter_t *row_filter, LM_DBG("successful EXPIRE query\n"); +out: freeReplyObject(rpl); pkg_free(argv[1]); pkg_free(argv[3]); diff --git a/modules/cachedb_redis/doc/cachedb_redis_admin.xml b/modules/cachedb_redis/doc/cachedb_redis_admin.xml index c063cb49a9..dd7edb2e63 100644 --- a/modules/cachedb_redis/doc/cachedb_redis_admin.xml +++ b/modules/cachedb_redis/doc/cachedb_redis_admin.xml @@ -64,6 +64,27 @@ +
+ Redis Stack Support + + Starting with OpenSIPS 3.6, the cachedb_redis + module implements the column-oriented cacheDB API functions. This makes it a suitable + cacheDB storage in scenarios such as user location federation + and full-sharing, which require this API to be available. + + + The implementation makes use of RedisJSON and RediSearch -- + these relatively new features are available in Redis Stack Server, instead of the usual Redis Server + (Redis OSS project). More documentation is available on the Redis website. + + + OpenSIPS will auto-detect availability of the RedisJSON support when necessary and log + the appropriate messages. + + + +
+
Limitations @@ -238,7 +259,7 @@ modparam("cachedb_redis", "shutdown_on_error", 1)
-
+
<varname>use_tls</varname> (integer) Setting this parameter will allow you to use TLS for Redis connections. @@ -274,6 +295,99 @@ modparam("tls_mgm", "ca_list", "[redis]/etc/pki/tls/certs/ca.pem") modparam("cachedb_redis", "use_tls", 1) modparam("cachedb_redis", "cachedb_url","redis://localhost:6379/?tls_domain=redis") ... + + +
+ +
+ <varname>ftsearch_index_name</varname> (string) + + Only relevant with RedisJSON and + RediSearch server-side support. + + + A global index name to be used for all internal JSON full-text search operations. + Future extensions may add, e.g., a connection-level index name setting. + + + Default value is "idx:usrloc". + + + Set the <varname>ftsearch_index_name</varname> parameter + + +modparam("cachedb_redis", "ftsearch_index_name", "ix::usrloc") + + + +
+ +
+ <varname>ftsearch_json_prefix</varname> (string) + + Only relevant with RedisJSON and + RediSearch server-side support. + + + A key naming prefix for all internally-created Redis JSON objects (e.g. + created with JSON.SET or JSON.MSET). + + + Default value is "usrloc:". + + + Set the <varname>ftsearch_json_prefix</varname> parameter + + +modparam("cachedb_redis", "ftsearch_json_prefix", "userlocation:") + + + +
+ +
+ <varname>ftsearch_max_results</varname> (integer) + + Only relevant with RedisJSON and + RediSearch server-side support. + + + The maximum number of results returned by each internally-triggered + FT.SEARCH JSON lookup query. + + + Default value is 10000 max results. + + + Set the <varname>ftsearch_max_results</varname> parameter + + +modparam("cachedb_redis", "ftsearch_max_results", 100) + + + +
+ +
+ <varname>ftsearch_json_mset_expire</varname> (integer) + + Only relevant with RedisJSON and + RediSearch server-side support. + + + A Redis EXPIRE timer to set/refresh on the JSON key after each JSON.MSET operation + (create the JSON or add/remove subkeys), in seconds. A value of 0 + disables the EXPIRE queries completely. + + + Default value is 3600 seconds. + + + Set the <varname>ftsearch_json_mset_expire</varname> parameter + + +modparam("cachedb_redis", "ftsearch_json_mset_expire", 7200) +