<p>Now the calls per minute parameter is build as consisting of an initial<br>
time(t0) and a 60 seconds window(as was before). Each window slot holds the<br>
calls received in that second(as before). The difference is that now<br>
these parameters are updated based on three conditions:</p>

<ul>
<li>we receive the call between [t0; t0 + WINDOW_SIZE(60s)] - we only update
the number of calls for that slot(t0 + current time) and the calls per minute
parameter</li>
<li>we receive the call in the interval of [t0+WINDOW_SIZE; t0+2*WINDOW_SIZE] -
we do the following: move t0 in current call time - WINDOW_SIZE, invalidate
all the calls we knew of from t0 to current t0 (current call time - WINDOW_SIZE)</li>
<li>we receive a call after 2 * WINDOW_SIZE(60 seconds) + t0 - this invalidates
all the calls we knew of since the window is not does not contains calls newer
than the last 60 seconds;</li>
</ul>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>&nbsp;&nbsp;<a href='https://github.com/OpenSIPS/opensips/pull/665'>https://github.com/OpenSIPS/opensips/pull/665</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>fix calls per minute for fraud_detection module</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/OpenSIPS/opensips/pull/665/files#diff-0">modules/fraud_detection/fraud_detection.c</a>
    (29)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/665.patch'>https://github.com/OpenSIPS/opensips/pull/665.patch</a></li>
  <li><a href='https://github.com/OpenSIPS/opensips/pull/665.diff'>https://github.com/OpenSIPS/opensips/pull/665.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/OpenSIPS/opensips/pull/665">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AFOcid3Szu3NA09GpDItE9YbVDfYB4c9ks5o495ggaJpZM4GJ2Ej.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSIPS/opensips/pull/665"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>