Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix calls per minute for fraud_detection module #665

Merged
merged 1 commit into from Jan 12, 2016

Conversation

ionutrazvanionita
Copy link
Contributor

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;

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;
liviuchircu added a commit that referenced this pull request Jan 12, 2016
fix calls per minute for fraud_detection module
@liviuchircu liviuchircu merged commit acb9f72 into OpenSIPS:master Jan 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants