<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    long story short: if you write a db connector module then implement
    srdb1 interface because most of the modules are relying on that.
    srdb2 comes from ser branch, only some of the uid_* modules use it.
    There are couple of goodies in srdb2, but perhaps is easier to
    migrate them to srdb1 rather than migrate all the modules to srdb1.
    Also, srdb1 is more reach in exported API than srdb2 (which was more
    or less in early phase of development at the merge time and remained
    like that).<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 10/02/15 21:19, Davidson, Erik
      wrote:<br>
    </div>
    <blockquote cite="mid:D0FFC3E2.38B%25erik.davidson@corvisa.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div>Hey Everyone!</div>
      <div><br>
      </div>
      <div>I’m currently working on a database module and I’ve come
        across some issues/confusion that I was hoping someone could
        clear up for me.  I’ve been looking at the existing modules and
        the docs online for help but I can’t find a definitive answer
        for them.</div>
      <ol>
        <li>I see there are 2 DB APIs (srdb1 and srdb2) and I gather
          that srdb2 is the newer version?  Should I aim to use srdb2
          exclusively or should I also use srdb1?</li>
        <li>It looks like srdb2 provides a db_uri command that can be
          used to implement custom URI parsing but I can’t figure out
          how to hook into it.  I added it to my exported commands but
          it was never called.  When I looked through the code I saw the
          only place that ever really uses it is db_ctx, which itself
          looks to be used in the child_init of modules.  I’m developing
          a database module that I want to be a drop-in replacement for
          others, but it needs multiple hosts specified in the
          connection uri (similar to the URI example here <a
            moz-do-not-send="true"
            href="http://docs.mongodb.org/manual/reference/connection-string">
            http://docs.mongodb.org/manual/reference/connection-string</a>/)
          and I can’t figure out the best place to do it.  Should I be
          doing it in db_func_t.init because it has the full string
          version of the uri and parse it there? Do I then have to
          reimplement everything that db_do_init would be doing?</li>
        <li>Do I need to implement multiple database interfaces to get
          full module coverage in Kamailio? I was looking at db_berkeley
          as a reference and it looks like it has the
          KAMAILIO_MOD_INTERFACE as well as the SER_MOD_INTERFACE
          implemented.</li>
        <li>Is there a preferred way to handle the API binding (such as
          db_ commands vs db_bind_api)?</li>
      </ol>
      <div>Thanks for any help or direction you can give me!</div>
      <div><br>
      </div>
      <div>- Erik Davidson</div>
      <br>
      <hr size="1">
      <p><strong>CONFIDENTIALITY NOTICE: The information contained in
          this e-mail message and any attachments is for the sole use of
          the intended recipients and may contain confidential and
          privileged information. Any unauthorized review, use,
          disclosure or distribution is prohibited. If you are not the
          intended recipient and have received this communication in
          error, please contact the sender by reply e-mail and destroy
          all copies of the original message. Thank you.</strong></p>
        ­­  
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.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-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a>
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - <a class="moz-txt-link-freetext" href="http://www.kamailioworld.com">http://www.kamailioworld.com</a></pre>
  </body>
</html>