[Spce-user] Fraud Prevention

Andreas Granig agranig at sipwise.com
Thu May 2 05:57:05 EDT 2013


Hi,
On 05/02/2013 10:24 AM, Martin Wong wrote:
> Hi Andreas, so I've updated ngcp and do a config apply. All is ok and I
> see the new script there.
>
> I have 0.10 for the account fraud daily limit with outgoing lock.
> However, after running the /usr/sbin/ngcp-fraud-daily-lock, it is not
> locking the account up.
>
> Under account balance, I have $0.00 and also there is a $0.05 under
> "Spent this billing interval"
>
> Can you let me know how the account balance co-relate to the fraud
> limits? How does the "Spent this billing interval" get calculated and
> also how do I define an interval? Is it a month?
>
> Sorry but if you can sort of help me understand how it works, it'll be
> much appreciated.

Looks like there's some need to put more details into the handbook :)

In your account settings, you have interval lock limits and daily lock 
limits. For testing, set the lock limit to "none" and put your email 
address there, so you'll get a notification email every time the script 
runs (or you run it manually).

Now the way it works is this:

For the "monthly settings", the ngcp-fraud-auto-lock is used, and it 
checks your current Cash field in "Spent this billing interval". This is 
the accumulated cost of all subscribers within this account within the 
current month.

For the "daily settings", the ngcp-fraud-daily-lock is used, and it sums 
up the accumulated costs of all subscribers within this account within 
the current day in the CDR table.

Note that the amount you have to enter in the Limit field is in EUR (or 
USD). So if your current Cash field in "spent this billing interval" is 
0.05, you can try to set the monthly limit to 0.01 and run 
ngcp-fraud-auto-lock, and it should send you the email to the address 
you specify in the notify field.

For daily limits, it depends. You can execute this command to get the 
spendings of an account for the current day from your shell:

account_id=2;
mysql accounting -e "select sum(source_customer_cost) from cdr where 
source_account_id = $account_id and start_time >= unix_timestamp(curdate())"

Take this value (which is in cents) and put it into your daily limit 
(e.g. if above's result is 1234, you can put 10.00 into the daily 
limit), then run the ngcp-fraud-daily-lock, and you should get an email 
(or have all subscribers within the account locked, if you specifiy a 
lock setting).

Andreas




More information about the Spce-user mailing list