Hello,
as I said, for authentication you just need to fetch the password from
redis -- see:
-
The idea is very similar with the Ldap password storage, a mini how-to
that you can adjust is available at:
-
Also accounting can be done with ndb_redis -- just store your needed
details for call start with redis_cmd() when you get 200ok for INVITE
(in an onreply_route block) and for call stop when you get BYE. For
other events, just call the redis cmd when that event happens.
Cheers,
Daniel
On 13.06.17 23:29, Marko Tirs wrote:
Hello Daniel,
ok, no db_redis module yet.
How about accounting with Redis, is there any example how to use Redis
for authentication and accounting?
Thank you
Regards
Marko
----- Forwarded Message -----
*From:* Daniel-Constantin Mierla <miconda(a)gmail.com>
*To:* Marko Tirs <marko.tirs(a)yahoo.com>om>; Kamailio (SER) - Users
Mailing List <sr-users(a)lists.kamailio.org>
*Sent:* Thursday, June 1, 2017 5:04 PM
*Subject:* Re: [SR-Users] REDIS load problem - Kamailio 5.0.1 -
db_redis not found
Hello,
at this moment there is no db_redis module in Kamailio, some people
are working on it:
-
https://github.com/kamailio/kamailio/issues/1137
ndb_redis cannot be used as a db driver, in the way you try. If you
need to fetch the password for authentication from redis, then use
ndb_redis to get it and auth module to do authentication -- see
pv_auth_check(...) functions.
Cheers,
Daniel
On 31.05.17 18:19, Marko Tirs wrote:
Hi all,
I'm trying to use the Redis database for authentication and later for
accounting. I installed Redis on the server, I compiled Kamailio with
ndb_redis and the module exists.
When I try to start Kamailio I get following errors:
0(16737) ERROR: <core> [db.c:203]: db_bind_mod(): Module db_redis
not found. Missing loadmodule?
0(16737) ERROR: auth_db [auth_db_mod.c:175]: mod_init(): unable to
bind to a database driver
0(16737) ERROR: <core> [core/sr_module.c:968]: init_mod(): Error
while initializing module auth_db
(/usr/local/lib64/kamailio/modules/auth_db.so)
ERROR: error while initializing modules
Bellow are the relevant parts from config files.
Is there any example of kamailio.cfg with Redis configuration and
commands for authentication and accounting?
Please help me to use Kamailio with Redis.
Thank you
Regards
Marko
kamctlrc
---------
DBENGINE=DBTEXT
kamailio.cfg
-------------
#!define WITH_REDIS
#!define WITH_AUTH
#!ifdef WITH_REDIS
#!define DBURL "redis://localhost:6379/"
#!endif
#!ifdef WITH_AUTH
loadmodule "auth.so"
loadmodule "auth_db.so"
#!endif
#!ifdef WITH_REDIS
loadmodule "ndb_redis.so"
#!endif
# ----- ndb_redis params -----
modparam("ndb_redis", "server",
"name=srv1;addr=127.0.0.1;port=6379;db=1")
# ----- auth_db params -----
#!ifdef WITH_AUTH
modparam("auth_db", "db_url", DBURL)
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "use_domain", MULTIDOMAIN)
#!endif
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virenfrei.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users(a)lists.kamailio.org <mailto:sr-users@lists.kamailio.org>
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
www.twitter.com/miconda <http://www.twitter.com/miconda> --
www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
Kamailio Advanced Training -
www.asipto.com <http://www.asipto.com/>
Kamailio World Conference -
www.kamailioworld.com <http://www.kamailioworld.com/>
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users(a)lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users