<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I pushed some patches to the master branch in order to remove the
    dialog from its associated profiles when it gets in terminated
    state. I encountered such issue (not that) recently, but I haven't
    gotten the time to get to it before.<br>
    <br>
    Then, the second patch is to not add dialogs in profiles when
    loading from database and the state is terminated (5).<br>
    <br>
    Here are the links to the patches:<br>
    <br>
    -
<a class="moz-txt-link-freetext" href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=edf61acb57ed5e8ee0ca9ec1f796e43ce993be48">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=edf61acb57ed5e8ee0ca9ec1f796e43ce993be48</a><br>
    -
<a class="moz-txt-link-freetext" href="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9b88eb7ee2d243882383a44f601baa21fd679cd5">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=9b88eb7ee2d243882383a44f601baa21fd679cd5</a><br>
    <br>
    Should be straightforward to cherry pick to 4.1 (even 4.0 I expect).
    If you test and all goes fine, I will backport -- here I had no time
    for real testing.<br>
    <br>
    I plan also to not add the dialogs in memory for state terminated,
    but destroy them at db load time. But this needs a bit of a review,
    to be sure that all necessary callbacks are executed.<br>
    <br>
    On the other hand, if the dialogs are not removed from db, might be
    an issue with the database driver (cassandra in this case, which is
    rather new module). Do you get any syslog errors from kamailio or
    database server? I expect that people would have reported such issue
    for other database engines so far. Still it might be an issue, just
    that was not noticed...<br>
    <br>
    Cheers,<br>
    Daniel <br>
    <br>
    <div class="moz-cite-prefix">On 24/02/14 11:19, jay binks wrote:<br>
    </div>
    <blockquote
cite="mid:CAO47Hpdcbt4zka6KtnEQu0r5xRNKCTjyz+5NiWgvb3FWzUqYaA@mail.gmail.com"
      type="cite">
      <div dir="ltr">So poking round the code for the dialog module....
         
        <div>Im not sure what im missing here.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>get_profile_size dosnt care bout the state of a dialog...
          so you get ALL dialogs that are in the hash table.<br>
        </div>
        <div class="gmail_extra">( which is interesting if you want to
          use dialog module to enforce channel limits etc )</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">So you go... OK...  kamailio only
          expects to have "ACTIVE" dialogs in the hash table... kewl..</div>
        <div class="gmail_extra">lets assume that to be the case.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">but then in dlg_db_handler.c , <span
            style="color:rgb(0,0,0);white-space:pre-wrap">load_dialog_info_from_db
            loads all dialogs from the DB, regardless of state.</span></div>
        <div class="gmail_extra"><span
            style="color:rgb(0,0,0);white-space:pre-wrap">so all dialogs
            in the DB ( ones that didnt get deleted yet... but were in
            state 5 ) get re-created in kamailio</span></div>
        <div class="gmail_extra">
          <span style="color:rgb(0,0,0);white-space:pre-wrap">upon
            startup.</span></div>
        <div class="gmail_extra"><span
            style="color:rgb(0,0,0);white-space:pre-wrap"><br>
          </span></div>
        <div class="gmail_extra">what this means is...</div>
        <div class="gmail_extra">( assume starting with empty DB )</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">I start kamailio, make some calls...
          they get synced to the DB.</div>
        <div class="gmail_extra">I end the calls,  kamailio removes from
          dialogs module internal hash, but the sync to DB hasnt
          happened yet.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">I kill kamailio ( or crash .. whatever
          )....  restart kamailio and it re-loads all those dialogs</div>
        <div class="gmail_extra">and thinks they are still active calls.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">Im SURE Im missing something here,
          because it seems to be VERY common to use dialogs for channel
          limiting..</div>
        <div class="gmail_extra">maybe not so much using cassandra db
          behind the scenes, but as of yet ... Im still yet to find
          anything that makes me thing this is db_cassandra
          mis-behaving.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">if im wrong, please point me in the
          right direction.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">Jay</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra"><br>
          <br>
          <div class="gmail_quote">
            On 24 February 2014 17:54, jay binks <span dir="ltr"><<a
                moz-do-not-send="true" href="mailto:jaybinks@gmail.com"
                target="_blank">jaybinks@gmail.com</a>></span> wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div dir="ltr">Am I REALLY the only person who has ever
                run into this !?</div>
              <div class="gmail_extra">
                <div>
                  <div><br>
                    <br>
                    <div class="gmail_quote">On 19 February 2014 14:08,
                      jay binks <span dir="ltr"><<a
                          moz-do-not-send="true"
                          href="mailto:jaybinks@gmail.com"
                          target="_blank">jaybinks@gmail.com</a>></span> wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0px
                        0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
                        <div dir="ltr">Hi all, im using the dialog
                          module with db_cassandra backend..
                          <div>
                            I dont believe this issue is related to
                            cassandra, but its worth mentioning anyways.</div>
                          <div><br>
                          </div>
                          <div>so... I run kamailio, make calls, see
                            dialogs in the DB..</div>
                          <div>and I Can use "kamctl mi dlg_list" and
                            see that dialogs go away when I hangup a
                            call..</div>
                          <div><br>
                          </div>
                          <div>When I query the DB Backend, I still see
                            the queries, but they have a state of 5.</div>
                          <div>I Initially thought this was a bug, but
                            it seems dialogs in state 5 get cleaned up
                            after a period.</div>
                          <div>
                            so I moved on.<br>
                          </div>
                          <div><br>
                          </div>
                          <div>now , lets restart kamailio..</div>
                          <div>kamailio loads all dialogs on startup,
                            after kamailio starts I call "kamctl mi
                            dlg_list" again, and it shows all my dialogs
                            from the DB.   they DO show as "State 5"</div>
                          <div>but for some reason, these dialogs appear
                            to stick around for a long time, and the
                            bigger issue it causes me is that my channel
                            limiting ( using get_profile_size ) seems to
                            consider these dialogs ( in state 5 ) as
                            being active calls.  </div>
                          <div><br>
                          </div>
                          <div>Please someone point me in the right
                            direction... :)</div>
                          <div><br>
                          </div>
                          <div>what am I doing wrong ?</div>
                          <div>( or is this a bug somewhere )</div>
                          <div><br>
                          </div>
                          <div>Sincerely<font color="#888888"><br>
                            </font></div>
                          <font color="#888888"><br>
                            Jay</font></div>
                      </blockquote>
                    </div>
                    <br>
                    <br clear="all">
                    <div><br>
                    </div>
                  </div>
                </div>
                <span><font color="#888888">-- <br>
                    Sincerely<br>
                    <br>
                    Jay</font></span></div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          Sincerely<br>
          <br>
          Jay</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<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></pre>
  </body>
</html>