Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-23 Thread zenichev
@miconda Ok I understood it clearly. Thank you for your answer.
Will try to start discussion on sr-users list.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-368049038___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-23 Thread Daniel-Constantin Mierla
@zenichev - as said, db_redis cannot be used with cnxcc. Start a discussion on 
sr-us...@lists.kamailio.org with what you need to achieve. The issue tracker is 
only for bug reports, pull requests should be discussed in the context of the 
committed code: to review, improve, etc... it is not how to use the new 
features.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-368047152___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-23 Thread zenichev
@miconda - as I mentioned above, I need working authentication for cnxcc (that 
is not able to work with authentication).
So that, I'm trying to find a way to do that, this time by db_redis.
Do you think this is a wrong way?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-368045881___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-23 Thread Daniel-Constantin Mierla
@zenichev - cnxcc connects directly to redis, doesn't use a DB connector at 
all, such as db_mysql or db_redis. In other words, there is no relation between 
db_redis and cnxcc.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-368044418___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-23 Thread zenichev
Well, for that moment it doesn't work.

My configuration is as follows:

#!define DBURL_CNXCC "redis://here_my_passw...@redis.domain.com:6379/1"
loadmodule "db_redis.so"
modparam("db_redis", "schema_path", "/usr/share/kamailio/db_redis/kamailio")

modparam("cnxcc", "redis", DBURL_CNXCC)

I think this is wrong way to do that.
cnxcc module uses redis db as htable and stores real-time values (like credit, 
call duration etc.) that exist only when call is up for certain customer, then 
it drops whole key.

Should I use: 'modparam("db_redis", "keys"...'  ?
Or db_redis is to be improved to work with cnxcc? (cuz it uses not "db_url" 
modparam but "redis" modparam).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-368041757___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-21 Thread Andreas Granig
Try redis://password@host:port/db and let me know if it works for you.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-367418291___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-21 Thread zenichev
The relevant question - how to implement authentication while connecting to 
redis storage?
I read this document: 
https://kamailio.org/docs/modules/devel/modules/db_redis.html
and didn't find any reference in it.

As I understood we use following syntax to connect to the redis db:
redis://[username]@host:port/database

But authentication capability is not provided as I can see.

Of course there is an excellent module named ndb_redis.
But my main goal is to perform authentication with cnxcc module, which is not 
able to do that (Carlos Ruiz Díaz will add this possibility later?).

Please correct me if I'm wrong.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-367265258___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-14 Thread Daniel-Constantin Mierla
A quick note that I updated the path for including hiredis.h:

```
diff --git a/src/modules/db_redis/redis_connection.h 
b/src/modules/db_redis/redis_connection.h
index d6ed4e4ec3..35d58e46a4 100644
--- a/src/modules/db_redis/redis_connection.h
+++ b/src/modules/db_redis/redis_connection.h
@@ -23,7 +23,7 @@
 #ifndef _REDIS_CONNECTION_H_
 #define _REDIS_CONNECTION_H_
 
-#include 
+#include 
 
 #include "db_redis_mod.h"
```

On Debian 9 is where the file is located based on pkg-config output, it doesn't 
compile otherwise (same on MacOS with macports).

I looked in ndb_redis module and has the same path. If you have it in your 
system working without ``, then we need to do some defines 
to set the proper path so it works on common distros.

Thanks again for this contribution!

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-365562086___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-14 Thread Andreas Granig
Merged #1432.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#event-1473375435___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-13 Thread Andreas Granig
Hi @miconda, I've improved the module with the suggestions you made:

* utilize xml schema definitions and load them from files to avoid having to 
define them as mod params
* allow multiple keys mod params definitions to make config more readable
* reconnect improvements
* documentation fixes and improvements

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-365275003___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-13 Thread Andreas Granig
@agranig pushed 1 commit.

609c350  db_redis: Use schema files and improve keys def


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/kamailio/kamailio/pull/1432/files/53e746b5c527fa542e4b2b7353af5a3b4042d7d2..609c35077886b090b62f7515f5c18c9887696a89
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-09 Thread Daniel-Constantin Mierla
miconda approved this pull request.





-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#pullrequestreview-95420639___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-09 Thread Daniel-Constantin Mierla
IMO, this one can be merged.

I haven't had the time for an in depth analyzis, spotted a small type in the 
readme, ndb_redis can be used to send any command to redis.

Then, as you expressed in some comments, having schema definition in a file may 
make possible to generate it from the xml db schema definitions from 
src/lib/srdb1/schema, in a simialar matter done for `db_text` or `db_mongodb`. 
If the parameter is kept, might be good to use function callbacks for it in 
order to allow setting it many times without overwriting previous value, 
otherwise its value can become too big for a single modparm (e.g., like done 
for htable parameter for htable module). Anyhow, these are enhancements that 
can be done over the time, as I said, merging at this phase is ok from my point 
of view, it will make it easier for others to test and improve its stability.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1432#issuecomment-364435219___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-08 Thread Andreas Granig
@agranig pushed 1 commit.

2378fb9  db_redis: Fix missed freeing redis reply objects


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/kamailio/kamailio/pull/1432/files/dcb86110b481a32071d1b87a7c6066dbc8ce810c..2378fb9371a5ccd564c0b06d6d80d9fb7dfbb6f5
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev


Re: [sr-dev] [kamailio/kamailio] db_redis: Implement db_redis generic db driver (#1432)

2018-02-08 Thread Andreas Granig
@agranig pushed 1 commit.

dcb8611  db_redis: Cleanups and fixes


-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/kamailio/kamailio/pull/1432/files/aab86a5595b4b6294d9a1073321d623520f3fc0c..dcb86110b481a32071d1b87a7c6066dbc8ce810c
___
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev