<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 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.<u></u>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 href="http://kamailio.org/docs/modules/4.1.x/modules/htable.html" target="_blank">http://kamailio.org/docs/<u></u>modules/4.1.x/modules/htable.<u></u>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 href="tel:%2B1-678-954-0670" value="+16789540670" target="_blank">+1-678-954-0670</a><br>
Web: <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.alexbalashov.com/" target="_blank">http://www.alexbalashov.com/</a><br>
<br>
Please be kind to the English language:<br>
<br>
<a href="http://www.entrepreneur.com/article/232906" target="_blank">http://www.entrepreneur.com/<u></u>article/232906</a><br>
<br>
______________________________<u></u>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a><br>
</blockquote></div><br></div>