<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Look at the definition of htable parameter, there you have various
    ways to set expires for each item in hash table.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 13/08/14 05:26, AliReza Khoshgoftar
      Monfared wrote:<br>
    </div>
    <blockquote
cite="mid:CABoSzTs45VHNJOCJj272Z6DKfZ8=j10TQ3GVE9Jm5yR8aaqcvg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Thanks Alex,
        <div><br>
        </div>
        <div>This is exactly the module I needed.</div>
        <div>Now just another small usage question.</div>
        <div>How can I reset the value of all entries in my hash table
          to 0 every, say "10" seconds?</div>
        <div><br>
        </div>
        <div>---------------------</div>
        <div><br>
        </div>
        <div>Here is what I tried, but the values seem to persist:</div>
        <div><br>
        </div>
        <div>Option 1) in the parameter definition set "initval" to 0
          (to have all items 0 initially), "autoexpire" to "10" seconds
          and "updateexpire" to 0 (to force expiration upon the end of
          10 seconds)</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Option 2) Create a fake route block executed every 10
          seconds (using "rtimer" module), and call
          "sht_rm_value_re("ha=>.*")" inside it.</div>
        <div><br>
        </div>
        <div>None of these seem to be resetting "all" of my entries in
          the hash table to 0, in fact, I can see that the values
          persist and continue increment (as I increment them upon
          receipt of messages). Am I missing sth here?</div>
        <div><br>
        </div>
        <div>Thanks</div>
        <div>Alireza</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Tue, Aug 12, 2014 at 3:58 PM, Alex
          Balashov <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div class="HOEnZb">
              <div class="h5">On 08/12/2014 03:56 PM, AliReza
                Khoshgoftar Monfared wrote:<br>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  Hi List,<br>
                  <br>
                  I am trying to keep a counter for number of messages
                  received per source<br>
                  ip in my kamailio script.<br>
                  <br>
                  The basic challenge is to keep this data in a neat
                  structure.<br>
                  Ideally, I want some array with keys named after
                  source IP addresses,<br>
                  <br>
                  sth like number_of_messages["10.10.10.10"] = 23<br>
                  <br>
                  Of course, this data structure shall be
                  script-persistent (as opposed to<br>
                  transaction persistent)<br>
                  <br>
                  Is there any suggestion to do this? (keep a record of
                  # of messages<br>
                  received from each source IP address and log them)?<br>
                </blockquote>
                <br>
              </div>
            </div>
            It sounds to me like you're looking for:<br>
            <br>
            <a moz-do-not-send="true"
              href="http://kamailio.org/docs/modules/4.1.x/modules/htable.html"
              target="_blank">http://kamailio.org/docs/modules/4.1.x/modules/htable.html</a><br>
            <br>
            The hash tables reside in shared memory, so the data is of
            global scope and script-persistent.<br>
            <br>
            -- <br>
            Alex Balashov - Principal<br>
            Evariste Systems LLC<br>
            Tel: <a moz-do-not-send="true" href="tel:%2B1-678-954-0670"
              value="+16789540670" target="_blank">+1-678-954-0670</a><br>
            Web: <a moz-do-not-send="true"
              href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>,
            <a moz-do-not-send="true"
              href="http://www.alexbalashov.com/" target="_blank">http://www.alexbalashov.com/</a><br>
            <br>
            Please be kind to the English language:<br>
            <br>
            <a moz-do-not-send="true"
              href="http://www.entrepreneur.com/article/232906"
              target="_blank">http://www.entrepreneur.com/article/232906</a><br>
            <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"
              target="_blank">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"
              target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
          </blockquote>
        </div>
        <br>
      </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>
Next Kamailio Advanced Trainings 2014 - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA</pre>
  </body>
</html>