[OpenSIPS-Devel] [OpenSIPS/opensips] 0c26f9: fix calls per minute for fraud_detection module

ionutrazvanionita ionutionita at opensips.org
Mon Jan 18 15:14:31 CET 2016


  Branch: refs/heads/2.1
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 0c26f91288d1c480df648a01583dbc2ffd2b474e
      https://github.com/OpenSIPS/opensips/commit/0c26f91288d1c480df648a01583dbc2ffd2b474e
  Author: ionutrazvanionita <ionutionita at opensips.org>
  Date:   2016-01-18 (Mon, 18 Jan 2016)

  Changed paths:
    M modules/fraud_detection/fraud_detection.c

  Log Message:
  -----------
  fix calls per minute for fraud_detection module

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

(cherry picked from commit dd25c63adb8832d59861cf98b6fba1a2ad89a307)




More information about the Devel mailing list