<div dir="ltr"><span style="font-size:12.8000001907349px">Daniel, I want to ask you for some help with my idea. Just for some advices and explanations of some structures.</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">Thanks for help.</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">The first of all:</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">I think not write to create new module for integration of usrloc and redis. I thing it is good idea to add new features to existing usrloc and use ndb_redis module for connection.</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">As I undersand when learning source code of usrloc module - this module use /kamailio/lib/srdb1/db.h</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">This header implements 2 structures that i see at ul_mod files:</span><br style="font-size:12.8000001907349px"><br style="font-size:12.8000001907349px"><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" style="font-size:12.8000001907349px"><span style="line-height:18.2000007629395px">extern db1_con_t* ul_dbh;   </span></font><table style="font-size:12.8000001907349px;border-collapse:collapse;border-spacing:0px"></table><font color="#333333" face="Helvetica, arial, nimbussansl, liberationsans, freesans, clean, sans-serif, Segoe UI Emoji, Segoe UI Symbol" style="font-size:12.8000001907349px"><span style="line-height:18.2000007629395px">extern db_func_t ul_dbf;<br><br>This structures handle SQL connections.<br><br>I ask this because at the README i see<br></span></font><pre style="white-space:pre-wrap;overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:15px;margin-top:0px;margin-bottom:0px;font-stretch:normal;color:rgb(51,51,51)">modparam("usrloc", "db_url", "dbdriver://username:password@dbhost/dbname")<br></pre><pre style="white-space:pre-wrap;overflow:auto;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:15px;margin-top:0px;margin-bottom:0px;font-stretch:normal;color:rgb(51,51,51)"><br></pre><table style="font-size:12.8000001907349px;border-collapse:collapse;border-spacing:0px"></table><span style="font-size:12.8000001907349px">Looking at the API documentation I find API that use DB detection, then I look at db.c at my kamailio ( kamailio 4.3.0-dev5 (x86_64/linux) e172b7</span><br style="font-size:12.8000001907349px"><div style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">) too but can not find any strings about mongo</span>.<br>The second As I see - location not working with redis because it use API for DB and  API not omplement redis integration. So I thing it is write way to rewrite module with external connection to redis, not using API, Isn't it?<br><br>Thanks once again</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-27 0:51 GMT+03:00 Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    might worth reading the devel guide:<br>
    <br>
    - <a href="http://www.asipto.com/pub/kamailio-devel-guide/" target="_blank">http://www.asipto.com/pub/kamailio-devel-guide/</a><br>
    <br>
    It is for an older version, but still good.<br>
    <br>
    Then, if you want to implement a db_redis module (a module that can
    be used instead of other db modules, such as db_mysql), maybe
    checking db_mongodb is good to learn by example, given the mongodb
    is nosql system as well.<br>
    <br>
    I think for redis the main things to sort out is how you serialize
    the structures that are going to be saved (maybe using serialized
    json will allow reusing code from mongodb) and what will be the key
    value, as redis is practically a (key, value) storage. Maybe storing
    a redis hash structure is an alternative. Then, how the expressions
    to select records are built to match in redis system.<br>
    <br>
    Not being very familiar with redis, I cannot assert properly the
    complexity to get the above sorted out nicely.<br>
    <br>
    Cheers,<br>
    Daniel<span class=""><br>
    <br>
    <div>On 26/03/15 22:27, Yuriy Gorlichenko
      wrote:<br>
    </div>
    </span><blockquote type="cite"><span class="">
      <div dir="ltr">Daniel, hello. Our service need to translate
        location table to redis, and we want start to write own module
        for kamailio. Akn you give us some advices and documentation for
        API of kamailio, that we may to use for creation own module.<br>
        Thks</div>
      <br>
      <fieldset></fieldset>
      <br>
      </span><pre>_______________________________________________
sr-dev mailing list
<a href="mailto:sr-dev@lists.sip-router.org" target="_blank">sr-dev@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><span class="HOEnZb"><font color="#888888">
</font></span></pre><span class="HOEnZb"><font color="#888888">
    </font></span></blockquote><span class="HOEnZb"><font color="#888888">
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla
<a href="http://twitter.com/#!/miconda" target="_blank">http://twitter.com/#!/miconda</a> - <a href="http://www.linkedin.com/in/miconda" target="_blank">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - <a href="http://www.kamailioworld.com" target="_blank">http://www.kamailioworld.com</a></pre>
  </font></span></div>

<br>_______________________________________________<br>
sr-dev mailing list<br>
<a href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a><br>
<br></blockquote></div><br></div>