<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    some of my thoughts on the topic, presented as concepts ...<br>
    <br>
    There is a function dlg_remote_profile() that can be used to mirror
    only profiles from one sip server to another:<br>
    <br>
      -
<a class="moz-txt-link-freetext" href="http://kamailio.org/docs/modules/stable/modules/dialog.html#dialog.f.dlg_remote_profile">http://kamailio.org/docs/modules/stable/modules/dialog.html#dialog.f.dlg_remote_profile</a><br>
    <br>
    The idea is that when you add a dialog on a local profile, trigger
    an action to the other server to add a remote profile. It can be
    done via uac_req_send() or some http query to the other server.<br>
    <br>
    This is one way to go, ans should work fine (maybe a bit more
    testing needed) for few nodes, but I am actually not using this one,
    because it is a matter of what kind of routing architecture you go
    for. Lately I found that replication can bring lots of headaches
    when dealing with a lot of traffic and having lots of nodes. You
    can't replicate everything everywhere (usrloc, dialog, etc...),
    because then practically you have only HA, no scalability -- each
    node has the same data, so when one node is full, all are full
    (expecting to be same hardware capacity more or less with each
    node).<br>
    <br>
    The architecture I am going lately is sort of hierarchical nodes,
    with edge nodes (EN) keeping all the information, and next layer
    (let's name it super node/SN) retrieving far more less information
    and very rare. Like when alice registers to edge node A, A will
    inform few supper nodes that alice is with it. This is done only at
    first registration (when alice is not registered when processing
    REGISTER). When bob is calling alice via its EN B, then B routes to
    a SN because alice is not found locally. The SN sends to EN A --
    after answer, based on record routing, the singaling can end up
    bob-ENB-ENA-alice. If alice unregistered meanwhile, EN A can return
    404, if it didn't removed info from SN. Instead of replicating a
    location record every 10minutes, an invite is routed only when
    needed.<br>
    <br>
    More or less same architecture I use for dialog profiles. I leverage
    event routes from dialog module to know when a dialog ended to
    remove information from a storage engine. The storage engine can be
    sql or nosql database, which has HA by itself (when needed, with
    replication) -- you can use modules such as sqlops, ndb_redis,
    ndb_cassandra, ndb_mongodb, memchaced. The logic is:<br>
    <br>
    - when dialog is initiated, verify if the number of active calls for
    the user has a limit (select/find by userid)<br>
    - add data for the new dialog<br>
    - when dialog is cancelled or ended, remove the data for the dialog<br>
    <br>
    Data to be stored: userid, profile name, call-id (+fromtag/totag)
    or/and dialog id+label.<br>
    <br>
    If there are lots of active calls, I use few storage systems,
    partitioning the profiles by userid, so all records of active calls
    for a user are in the same storage system.<br>
    <br>
    Everything above should need only config file scripting, no c
    coding.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 04/09/15 15:18, José Seabra wrote:<br>
    </div>
    <blockquote
cite="mid:CAEVZRWv2QJ25qbPU3=1f-8i2s7n0g-RsWeJ4_A4kB1cRA2af_A@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi,
        <div><br>
          <div>I'm also using the same <span
              style="font-size:12.8000001907349px">mechanism that
              Carsten is using(</span><span
              style="font-size:12.8000001907349px">htable and DMQ</span><span
              style="font-size:12.8000001907349px">), the only issue
              about this solution is when one of your kamailio instances
              goes down and up, this instance looses the number of
              current calls.</span></div>
          <div><br>
          </div>
          <div>Regards</div>
          <div>José Seabra</div>
          <div><span style="font-size:12.8000001907349px"><br>
            </span></div>
          <div><span style="font-size:12.8000001907349px"><br>
            </span></div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2015-09-04 13:53 GMT+01:00 Daniel Tryba
          <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:d.tryba@pocos.nl" target="_blank">d.tryba@pocos.nl</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex"><span
              class="">On Friday 04 September 2015 10:56:21 Carsten Bock
              wrote:<br>
              > i did implement such mechanism once using a htable
              and DMQ, that<br>
              > worked like a charm.<br>
              <br>
            </span>Sound good, my current solution misses concurrent
            call setup that happen<br>
            withing the dialog db_update_period timeout.<br>
            <div class="HOEnZb">
              <div class="h5"><br>
                _______________________________________________<br>
                SIP Express Router (SER) and Kamailio (OpenSER) -
                sr-users mailing list<br>
                <a moz-do-not-send="true"
                  href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
                <a moz-do-not-send="true"
                  href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
                  rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">Cumprimentos
          <div>José Seabra</div>
        </div>
      </div>
      <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>
Book: SIP Routing With Kamailio - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a></pre>
  </body>
</html>