So I am thinking of not thinking on auto-expire or create any code to corelate dialog/active call data with my hash table. Instead Just focus on latest version and then try this all.This new dialog keepalive function seems better.linking between my hashtable entry with the dialog is not required, event route is great for this.<br>
<br>So lets head to latest version <div>Thanks alot </div><div>Sammy G.</div><div><br><div class="gmail_quote">On Thu, Jun 14, 2012 at 1:26 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<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,<div class="im"><br>
    <br>
    <div>On 6/12/12 11:49 AM, SamyGo wrote:<br>
    </div>
    <blockquote type="cite">Yes, I saw the event routes in new version and that
      seems relevant. Yes deleting entries from hash table is definitely
      logical but what about hash entries for calls which are in-call
      for like 4~10 hours !! will hashtable delete those entries ! <br>
    </blockquote></div>
    auto-expire was designed for this purpose, but, iirc, you said you
    don&#39;t want to use it, any reason?<div class="im"><br>
    <blockquote type="cite">
      <div>
        <br>
      </div>
      <div>So I was thinking that I definitely need a mechanism in my
        hash table entries to refresh which enteries have corresponding
        active calls (dialogs) and which entries should be deleted as no
        call for them is found ! <br>
      </div>
    </blockquote>
    <br></div>
    You can correlate by call-id/dialog id the hash table content and
    the list of active dialogs from dialog module -- you will have to
    write some code for it.<div class="im"><br>
    <br>
    <blockquote type="cite">
      <div>I simply can&#39;t depend on the expiry time of hased entries -
        that will render the logic useless. Think of an entry which
        shouldn&#39;t be in the table , an new call for that destination
        comes in and Kamailio will think that (due to useless entry in
        h-table) destination is in call and lets not send him any more
        calls !!</div>
    </blockquote>
    <br></div>
    This is only when BYE is missing, which with old version of dialog
    was more or less the same -- dialog will look like being active
    until dialog timeout is triggered (if auto-exipre and dialog timout
    are the same value, then practically both modules will remove the
    data associated with that call at the same time). With newest
    version 3.3, dialog can do options keepalives, practically able to
    detect if a call is down, then the event route is triggered and you
    can delete from htable as well.<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <blockquote type="cite">
      <div><br>
      </div>
      <div><br>
        <br>
        <div class="gmail_quote">On Tue, Jun 12, 2012 at 2:36 PM,
          Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span> wrote:<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,
              <div><br>
                <br>
                <div>On 6/7/12 1:34 PM, SamyGo wrote:<br>
                </div>
                <blockquote type="cite">
                  <div>Hi,</div>
                  <div><br>
                  </div>
                  sure, I&#39;ll give that debug messages a try tonight,
                  Also I was thinking of alternative approach and like
                  you said, you are using htable. If I&#39;ve to use that
                  htable entry manually how do I make sure that any call
                  data gets only deleted/erased after the call hangsup
                  !? i.e I don&#39;t want the htable entry to get expired
                  and removed automatically for a call length greater
                  than 3 hours !!</blockquote>
                <br>
              </div>
              the call ends when the BYE is coming through, so at that
              time you can delete from htable -- if the BYE is missing,
              then the htable auto-expire will clean it (like dialog
              auto-expires will do it for dlg case).<br>
              <br>
              Just as side note, in 3.3.0, dialog module exports events
              routes executed when a call is started or ended, so you
              can do easier operations related to this events (e.g., no
              matter dialog is ended by a bye or timeout, you will get a
              specific event route executed), see:<br>
                * <a href="http://kamailio.org/docs/modules/3.3.x/modules_k/dialog.html#id2556156" target="_blank">http://kamailio.org/docs/modules/3.3.x/modules_k/dialog.html#id2556156</a><br>
              <br>
              Cheers,<br>
              Daniel
              <div>
                <div><br>
                  <blockquote type="cite">
                    <div> <br>
                    </div>
                    <div>Thanks alot,</div>
                    <div>Sammy</div>
                    <div><br>
                      <br>
                      <div class="gmail_quote">On Thu, Jun 7, 2012 at
                        4:17 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span>
                        wrote:<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>
                            do you get any hints about what happens if
                            you run with debug=3? When dialog is deleted
                            from database, is any other query sent to
                            delete the dialog vars? This features was
                            not used by me so far, still relying on
                            htable for my needs of such cases.<br>
                            <br>
                            You can send the logs here for
                            troubleshooting.<br>
                            <br>
                            Cheers,<br>
                            Daniel
                            <div>
                              <div><br>
                                <br>
                                <div>On 6/6/12 6:45 PM, SamyGo wrote:<br>
                                </div>
                                <blockquote type="cite">Hi Sir,
                                  <div>I&#39;ve used the funcation as you
                                    informed. <i>$dlg_var(incall) =
                                      $fU; </i> It do insert my desired
                                    value into the dialog_var table but
                                    it don&#39;t gets deleted on call hangup
                                    !</div>
                                  <div><br>
                                  </div>
                                  <div>I&#39;m executing this code in my
                                    ON_REPLY route:</div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <div><font face="courier new,
                                        monospace">onreply_route[REPLY_ONE]


                                        {</font></div>
                                    <div><font face="courier new,
                                        monospace">       
                                        xdbg(&quot;incoming reply\n&quot;);</font></div>
                                  </div>
                                  <div><font face="courier new,
                                      monospace">if(is_method(&quot;BYE&quot;))</font></div>
                                  <div>
                                    <div><font face="courier new,
                                        monospace">        {</font></div>
                                    <div><font face="courier new,
                                        monospace">        </font><span>       
                                        unset_dlg_profile(&quot;incall&quot;,&quot;$fU&quot;);</span></div>
                                    <div><font face="courier new,
                                        monospace">               
                                        dlg_resetflag(&quot;4&quot;);</font></div>
                                    <div><font face="courier new,
                                        monospace">        }</font></div>
                                    <div>....</div>
                                    <div><br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div>Still I can&#39;t seem to erase the
                                      values :(</div>
                                    <div><br>
                                    </div>
                                    <div>Please suggest.</div>
                                    <div><br>
                                    </div>
                                    <div>Best Regards,</div>
                                    <div>Sammy G.</div>
                                    <div><br>
                                    </div>
                                    <br>
                                    <div class="gmail_quote">On Mon, Jun
                                      4, 2012 at 12:41 PM, SamyGo <span dir="ltr">&lt;<a href="mailto:govoiper@gmail.com" target="_blank">govoiper@gmail.com</a>&gt;</span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks,
                                        <div><br>
                                          <div>The reason why I didn&#39;t
                                            scroll down to it was
                                            because it was not listed
                                            under the functions list.
                                            Thanks for this. I&#39;ll give
                                            it a try. </div>
                                          <div>Next question is, will
                                            the values stored in this
                                            dialog_vars be matched if I
                                            execute the function <i>is_in_profile(&quot;my-profile&quot;)


                                              ?</i></div>
                                          <div><br>
                                          </div>
                                          <div>The problem with the
                                            alternative approach ,what I
                                            think, could be that I&#39;d
                                            have to make sure that the
                                            required KVPs are stored in
                                            my hashtable for the length
                                            of the call active.</div>
                                          <div>I&#39;d definitely not want
                                            my configurations file to
                                            behave abnormally if the
                                            hastable entry value gets
                                            expired meanwhile the
                                            corresponding call is still
                                            active.</div>
                                          <div><br>
                                          </div>
                                          <div>Also Sir, I posted a
                                            previous email regarding the
                                            values not getting expired
                                            from &quot;dialog&quot; table even
                                            after the BYE !</div>
                                          <div><br>
                                          </div>
                                          <div>Thanks again,</div>
                                          <div>Regards,</div>
                                          <div>Sammy G.</div>
                                          <div>
                                            <div>
                                              <div><br>
                                              </div>
                                              <div><br>
                                                <div class="gmail_quote">On
                                                  Mon, Jun 4, 2012 at
                                                  12:02 PM,
                                                  Daniel-Constantin
                                                  Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>&gt;</span>
                                                  wrote:<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>
                                                      to store in a
                                                      value in a
                                                      dialog_var record,
                                                      you have to set a
                                                      PV for it:<br>
                                                      <br>
                                                      <a href="http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2555403" target="_blank">http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2555403</a><br>

                                                      <br>
                                                      Alternative, you
                                                      can use hashtable
                                                      with a key
                                                      composed from
                                                      dialog id (or
                                                      callid) and some
                                                      other string to
                                                      identify your
                                                      value.<br>
                                                      <br>
                                                      Cheers,<br>
                                                      Daniel
                                                      <div>
                                                        <div><br>
                                                          <br>
                                                          <div>On 6/2/12
                                                          9:47 AM,
                                                          SamyGo wrote:<br>
                                                          </div>
                                                        </div>
                                                      </div>
                                                      <blockquote type="cite">
                                                        <div>
                                                          <div>Hello
                                                          <div><br>
                                                          </div>
                                                          <div><br>
                                                          </div>
                                                          <div>I&#39;ve two
                                                          problems
                                                          regarding
                                                          dialog module-
                                                          used for
                                                          profiling
                                                          users that are
                                                          in-a-call.</div>
                                                          <div><br>
                                                          </div>
                                                          <div>My
                                                          topology is
                                                          quiet simple.</div>
                                                          <div><br>
                                                          </div>
                                                          <div>
                                                          <div><br>
SIP-USER-71141----&gt;Kamailio-------------&gt;Asterisk[AGI]||</div>
                                                          <div>CALLEE&lt;-----------------Kamailio&lt;--------------------------------||</div>
                                                          <br>
                                                          </div>
                                                          <div><br>
                                                          </div>
                                                          <div>1- I wish
                                                          to store my
                                                          custom SIP
                                                          header value
                                                          in profiles.</div>
                                                          <div><br>
                                                          </div>
                                                          <div>I&#39;m
                                                          having trouble
                                                          in figuring
                                                          out on how to
                                                          use
                                                          Dialog_vars
                                                          table in my
                                                          kamailio
                                                          server. I&#39;m
                                                          using dialog
                                                          module to
                                                          profile SIP
                                                          users that are
                                                          in call or
                                                          making a call.
                                                          It works well
                                                          and the dialog
                                                          maintains an
                                                          entry when the
                                                          call is
                                                          established.
                                                          Now, the
                                                          difficult part
                                                          is that I want
                                                          my custom
                                                          header to be
                                                          inserted into
                                                          either dialog
                                                          table or
                                                          dialog_vars
                                                          table such
                                                          that when I do
                                                          a query &quot;<b>is_in_profile(&quot;$avp(my_value)&quot;)</b>&quot;
                                                          it returns me
                                                          a result.</div>
                                                          <div><br>
                                                          </div>
                                                          <div><br>
                                                          </div>
                                                          <div>2-
                                                          Alternative to
                                                          1, I can log
                                                          A,B leg
                                                          separately but
                                                          it doesn&#39;t
                                                          erase all data
                                                          on call
                                                          hangup.</div>
                                                          <div><br>
                                                          </div>
                                                          <div>Asterisk
                                                          AGI changes
                                                          the caller-id
                                                          of SIP-USERA
                                                          such that if
                                                          it was 71141
                                                          it would be
                                                          something like
                                                          &quot;007&quot; on its
                                                          way out to
                                                          destination
                                                          via kamailio.
                                                          Now, at this
                                                          point in
                                                          kamailio when
                                                          the call is
                                                          answered by
                                                          destination
                                                          the dialog
                                                          module saves
                                                          the call data
                                                          with values
                                                          corresponding
                                                          to &quot;007&quot; and
                                                          not &quot;71141&quot;.</div>
                                                          <div>I have to
                                                          disable the <span style="background-color:rgb(254,254,238)">&quot;dialog&quot;, &quot;detect_spirals&quot; in
                                                          order to count
                                                          this one call
                                                          as two
                                                          separate
                                                          entities BUT
                                                          problem occurs
                                                          when on hangup
                                                          the B-Leg gets
                                                          erased from
                                                          the table but
                                                          the A-leg
                                                          remains in DB
                                                          for as long as
                                                           infinity.</span></div>
                                                          <div><span style="background-color:rgb(254,254,238)"><br>
                                                          </span></div>
                                                          <div><span style="background-color:rgb(254,254,238)">Please


                                                          help me in
                                                          this. </span></div>
                                                          <div><span style="background-color:rgb(254,254,238)">Let


                                                          me know if
                                                          more details
                                                          are required
                                                          from me.</span></div>
                                                          <div><span style="background-color:rgb(254,254,238)"><br>
                                                          </span></div>
                                                          <div><span style="background-color:rgb(254,254,238)">Regards,</span></div>
                                                          <div><span style="background-color:rgb(254,254,238)">Sammy


                                                          G.</span></div>
                                                          <br>
                                                          <fieldset></fieldset>
                                                          <br>
                                                          </div>
                                                        </div>
                                                        <pre>_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><span><font color="#888888">
</font></span></pre>
                                                        <span><font color="#888888">
                                                          </font></span></blockquote>
                                                      <span><font color="#888888">
                                                          <br>
                                                          <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/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 Advanced Training, Seattle, USA, Sep 23-26, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a>
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - <a href="http://asipto.com/u/kpw" target="_blank">http://asipto.com/u/kpw</a></pre>
                                                          <br>
                                                          <br>
                                                        </font></span></div>
                                                  </blockquote>
                                                </div>
                                                <br>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                                <br>
                                <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/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 Advanced Training, Seattle, USA, Sep 23-26, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a>
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - <a href="http://asipto.com/u/kpw" target="_blank">http://asipto.com/u/kpw</a></pre>
                                <br>
                                <br>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                  <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<a href="http://twitter.com/#%21/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 Advanced Training, Seattle, USA, Sep 23-26, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a>
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - <a href="http://asipto.com/u/kpw" target="_blank">http://asipto.com/u/kpw</a></pre>
                  <br>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <pre cols="72">-- 
Daniel-Constantin Mierla - <a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
<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 Advanced Training, Seattle, USA, Sep 23-26, 2012 - <a href="http://asipto.com/u/katu" target="_blank">http://asipto.com/u/katu</a>
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - <a href="http://asipto.com/u/kpw" target="_blank">http://asipto.com/u/kpw</a></pre>
    <br>
    <br>
  </div></div></div>

</blockquote></div><br></div>