<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello,</p>
<p>as I said, for authentication you just need to fetch the password
from redis -- see:</p>
<p> -
<a class="moz-txt-link-freetext" href="https://www.kamailio.org/docs/modules/stable/modules/ndb_redis.html#ndb_redis.f.redis_cmd">https://www.kamailio.org/docs/modules/stable/modules/ndb_redis.html#ndb_redis.f.redis_cmd</a></p>
<p>Then pass it as parameter to pv_auth_check():</p>
<p> -
<a class="moz-txt-link-freetext" href="https://www.kamailio.org/docs/modules/stable/modules/auth.html#auth.f.pv_auth_check">https://www.kamailio.org/docs/modules/stable/modules/auth.html#auth.f.pv_auth_check</a><br>
</p>
The idea is very similar with the Ldap password storage, a mini
how-to that you can adjust is available at:<br>
<br>
-
<a class="moz-txt-link-freetext" href="https://www.kamailio.org/wiki/tutorials/mini-howto-admin/ldap-user-auth">https://www.kamailio.org/wiki/tutorials/mini-howto-admin/ldap-user-auth</a><br>
<br>
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.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<div class="moz-cite-prefix">On 13.06.17 23:29, Marko Tirs wrote:<br>
</div>
<blockquote
cite="mid:371743752.8843757.1497389361743@mail.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:16px">
<div id="yui_3_16_0_1_1497368750189_8885"><span
id="yui_3_16_0_1_1497368750189_9480">Hello Daniel,</span></div>
<div dir="ltr" id="yui_3_16_0_1_1497368750189_9378"><span
id="yui_3_16_0_1_1497368750189_9436">ok, no db_redis module
yet.<br>
</span></div>
How about accounting with Redis, is there any example how to use
Redis for authentication and accounting?
<div id="yui_3_16_0_1_1497368750189_9228">Thank you</div>
<div id="yui_3_16_0_1_1497368750189_9470">Regards</div>
<div id="yui_3_16_0_1_1497368750189_9438">Marko</div>
<div id="yui_3_16_0_1_1497368750189_9440"><br>
</div>
<div class="qtdSeparateBR"><br>
<br>
</div>
<div class="yahoo_quoted" id="yui_3_16_0_1_1497368750189_8831"
style="display: block;">
<div style="font-family: Helvetica Neue, Helvetica, Arial,
Lucida Grande, sans-serif; font-size: 16px;"
id="yui_3_16_0_1_1497368750189_8830">
<div style="font-family: HelveticaNeue, Helvetica Neue,
Helvetica, Arial, Lucida Grande, sans-serif; font-size:
16px;" id="yui_3_16_0_1_1497368750189_8829">
<div dir="ltr" id="yui_3_16_0_1_1497368750189_8828"> <font
id="yui_3_16_0_1_1497368750189_8901" face="Arial"
size="2"> <br>
----- Forwarded Message -----<br>
<b><span style="font-weight:bold;">From:</span></b>
Daniel-Constantin Mierla <a class="moz-txt-link-rfc2396E" href="mailto:miconda@gmail.com"><miconda@gmail.com></a><br>
<b><span style="font-weight: bold;">To:</span></b>
Marko Tirs <a class="moz-txt-link-rfc2396E" href="mailto:marko.tirs@yahoo.com"><marko.tirs@yahoo.com></a>; Kamailio
(SER) - Users Mailing List
<a class="moz-txt-link-rfc2396E" href="mailto:sr-users@lists.kamailio.org"><sr-users@lists.kamailio.org></a> <br>
<b><span style="font-weight: bold;">Sent:</span></b>
Thursday, June 1, 2017 5:04 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b>
Re: [SR-Users] REDIS load problem - Kamailio 5.0.1 -
db_redis not found<br>
</font> </div>
<div class="y_msg_container"
id="yui_3_16_0_1_1497368750189_9017"><br>
<div id="yiv4111971949">
<div id="yui_3_16_0_1_1497368750189_9016">
<div>Hello,</div>
<div>at this moment there is no db_redis module in
Kamailio, some people are working on it:</div>
<div id="yui_3_16_0_1_1497368750189_9051"> - <a
moz-do-not-send="true" rel="nofollow"
shape="rect"
class="yiv4111971949moz-txt-link-freetext"
target="_blank"
href="https://github.com/kamailio/kamailio/issues/1137"
id="yui_3_16_0_1_1497368750189_9381">https://github.com/kamailio/kamailio/issues/1137</a></div>
<div id="yui_3_16_0_1_1497368750189_9021">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.</div>
<div id="yui_3_16_0_1_1497368750189_9023">Cheers,<br
clear="none">
Daniel<br clear="none">
</div>
<br clear="none">
<div class="yiv4111971949yqt5180140495"
id="yiv4111971949yqtfd48753">
<div class="yiv4111971949moz-cite-prefix"
id="yui_3_16_0_1_1497368750189_9379">On 31.05.17
18:19, Marko Tirs wrote:<br clear="none">
</div>
</div>
<blockquote type="cite"
id="yui_3_16_0_1_1497368750189_9015">
<div class="yiv4111971949yqt5180140495"
id="yiv4111971949yqtfd59737">
<div
style="color:#000;background-color:#fff;font-family:Helvetica
Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:16px;"
id="yui_3_16_0_1_1497368750189_9014">
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2433">Hi
all,</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2707"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2899">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.</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2898"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2897">When
I try to start Kamailio I get following
errors:<br clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2896"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2706"> 0(16737)
ERROR: <core> [db.c:203]:
db_bind_mod(): Module db_redis not found.
Missing loadmodule? <br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2567"
clear="none">
0(16737) ERROR: auth_db
[auth_db_mod.c:175]: mod_init(): unable to
bind to a database driver<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2568"
clear="none">
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)<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2569" clear="none">
ERROR: error while initializing modules<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2570"
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2775"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2854">Bellow
are the relevant parts from config files.</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2877"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2878">
Is there any example of kamailio.cfg with
Redis configuration and commands for
authentication and accounting?<br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2852"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2869">Please
help me to use Kamailio with Redis.</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2832"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2850">Thank
you</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2833">Regards</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2834">Marko<br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2835"><br
clear="none">
</div>
<div dir="ltr"
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2837"><br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2571" clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2572"
clear="none">
kamctlrc<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2573"
clear="none">
---------<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2574"
clear="none">
DBENGINE=DBTEXT<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2575"
clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2576"
clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2577"
clear="none">
kamailio.cfg<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2578"
clear="none">
-------------<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2579"
clear="none">
#!define WITH_REDIS<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2580"
clear="none">
#!define WITH_AUTH<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2581"
clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2582"
clear="none">
#!ifdef WITH_REDIS<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2583"
clear="none">
#!define DBURL "redis://localhost:6379/"<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2584" clear="none">
#!endif<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2585"
clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2586"
clear="none">
#!ifdef WITH_AUTH<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2587"
clear="none">
loadmodule "auth.so"<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2588"
clear="none">
loadmodule "auth_db.so"<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2589"
clear="none">
#!endif<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2590"
clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2591"
clear="none">
#!ifdef WITH_REDIS<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2592"
clear="none">
loadmodule "ndb_redis.so"<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2593"
clear="none">
#!endif<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2594"
clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2595"
clear="none">
# ----- ndb_redis params -----<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2596"
clear="none">
modparam("ndb_redis", "server",
"name=srv1;addr=127.0.0.1;port=6379;db=1")<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2597" clear="none">
<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2598"
clear="none">
# ----- auth_db params -----<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2599"
clear="none">
#!ifdef WITH_AUTH<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2600"
clear="none">
modparam("auth_db", "db_url", DBURL)<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2601"
clear="none">
modparam("auth_db", "calculate_ha1", yes)<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2602" clear="none">
modparam("auth_db", "password_column",
"password")<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2603"
clear="none">
modparam("auth_db", "load_credentials", "")<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2604" clear="none">
modparam("auth_db", "use_domain",
MULTIDOMAIN)<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2605"
clear="none">
#!endif<br
id="yiv4111971949yui_3_16_0_ym19_1_1496246614425_2606"
clear="none">
<br clear="none">
</div>
</div>
</div>
<div
id="yiv4111971949DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2">
<div class="yiv4111971949yqt5180140495"
id="yiv4111971949yqtfd31376"><br clear="none">
</div>
<table style="border-top:1px solid #D3D4DE;"
class="yahoo-compose-table-card">
<tbody>
<tr>
<td colspan="1" rowspan="1"
style="width:55px;padding-top:18px;"><a
moz-do-not-send="true" rel="nofollow"
shape="rect" target="_blank"
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"><img
moz-do-not-send="true"
src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif"
alt=""
style="width:46px;min-height:29px;"
data-id="cd36d588-625d-d73f-d11a-a6b4ca93f790" height="29" width="46"></a></td>
<td colspan="1" rowspan="1"
style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,
Helvetica, sans-serif;line-height:18px;">
<div class="yiv4111971949yqt5180140495"
id="yiv4111971949yqtfd32555">Virenfrei.
<a moz-do-not-send="true"
rel="nofollow" shape="rect"
target="_blank"
href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail"
style="color:#4453ea;">www.avast.com</a></div>
</td>
</tr>
</tbody>
</table>
</div>
<br clear="none">
<fieldset
class="yiv4111971949mimeAttachmentHeader"></fieldset>
<br clear="none">
<pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a moz-do-not-send="true" rel="nofollow" shape="rect" class="yiv4111971949moz-txt-link-abbreviated" ymailto="mailto:sr-users@lists.kamailio.org" target="_blank" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a moz-do-not-send="true" rel="nofollow" shape="rect" class="yiv4111971949moz-txt-link-freetext" target="_blank" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br clear="none">
<pre class="yiv4111971949moz-signature">--
Daniel-Constantin Mierla
<a moz-do-not-send="true" rel="nofollow" shape="rect" class="yiv4111971949moz-txt-link-abbreviated" target="_blank" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a moz-do-not-send="true" rel="nofollow" shape="rect" class="yiv4111971949moz-txt-link-abbreviated" target="_blank" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a moz-do-not-send="true" rel="nofollow" shape="rect" class="yiv4111971949moz-txt-link-abbreviated" target="_blank" href="http://www.asipto.com/">www.asipto.com</a>
Kamailio World Conference - <a moz-do-not-send="true" rel="nofollow" shape="rect" class="yiv4111971949moz-txt-link-abbreviated" target="_blank" href="http://www.kamailioworld.com/">www.kamailioworld.com</a></pre>
<div class="yiv4111971949yqt5180140495"
id="yiv4111971949yqtfd59413"> </div>
</div>
</div>
<br>
<br>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>