26-Feb-2016 16:50

Case study: automatic bonus recharge

goantifraud

The history

The client is using a brand new SIM-cards. To make calls termination with this card profitable he needs to request the bonuses from GSM-operator. Bonus price is 4000 units. Before cards will request bonuses they should not make any calls. After bonus will expire, the client needs to make same procedure: recharge the cards, request bonuses and then calls until bonus limit will exceed.


Solution

STEP 1: RECHARGING

  • Needs:

GoAntiFraud service can make auto-recharge via USSD requests.

The amount of 1 voucher card is 1000, so we need simply request for recharge 4 times (1000 x 4) to have an ability to request bonuses.

  • Implementation:

We need to create USSD-request for recharge and assign it to the tariff with no calls allowed until the balance tops 4000 units.

After the balance is OK we need to set another USSD-request logic. We can split this logic into two steps USSD responses:

  • First: balance is lower than 4000 units -> no changes / update balance and request again;
  • Second: balance is higher than 4000 units -> switch the tariff to another one and request for bonuses.

Simply we just need to add 2 cases and handle it with different actions


Example: USSD response on recharge request looks like this:

Your balance was recharged by 1000;

Current balance is 2800;

*** etc. etc. etc. ****

Using the capabilities of regular expression we can split the response with different balance values on 2 cases:

([\w\W])*Current balance is (?P<sim__balance>-?[1-9]?[4-9]\d\d\d+(\.\d*)?)([\w\W])*

In first case balance parsing will be unsuccessful if the balance is lower than 4000 units.

([\w\W])*Current balance is (?P<sim__balance>-?(([1-3]\d{3}|[0-9]{1,3}\))(\s*|\.\d*)?)([\w\W])*

– In second case balance parsing will fail if the balance is higher than 4000 units.


! If you don’t know how to use regular expression template engine our specialist can help you with it!


So cases will look like this:


Success case balance is higher than 4000 -> switch the tariff



Unsuccessful case balance is still lower than 4000 -> request recharge again.



Ok let's save this USSD-requests and assign them to tariff with recharge requests.

First we need to create recharge:



And assign it to START tariff with no calls:



STEP 2: REQUEST FOR BALANCE

We need to create another tariff with no calls. The main purpose is to request the bonus.

So we need to create empty tariff with one option:

For this option, we need to assign bonus request.


Example: If response looks like this:

Your bonuses are now available!

You have 1000 minutes till 2016-02-25


Then USSD editor will look like this:



So after the bonus is now available we are switching to third tariff WORK and it will handle our main calls while bonuses are available.


STEP 3: ROLLBACK

Only one moment we have left: when bonus has expired and we need to switch back to START. We can do this just like other cases.

We need to take unsuccessful responses and switch them to tariff START.


Example: When bonuses are were gone you will get response from carrier like this

No bonuses left.

To request a bonus send *222#

Price is 4000

***etc.etc.etc.***

USSD Editor will look like this:


So we have an extensible and flex logic to implement any of your needs.

Have fun :)

You don't know how to use this case?

– Fill in an application form for a free webinar and we will instruct you! Or you can start your presentation right now in our chat.

goantifraud
1748
5/5
2
votes

Related Articles

GoAntiFraud

Case Study: What's new in GoAntiFraud Patch 0.99.08?

19 Jul 2016 16:36
GoAntiFraud has recently released a new patch - 0.99.08.Consider the main innovations:The SIM bank options window is addedFrom now on you can specify the SIM bank name and set a different password for the web interface of your SIM bank without having to re-add it.Change the GoIP SIM bank identificat...
GoAntiFraud

Automatic Topping Up of SIM-cards Using Specified Limits

17 Feb 2016 14:01
Some mobile operators have the feature unpleasant for termination: voice balance notification. For example, when making an outgoing call say, "You have less than ... units on your account." The message, of course, misleads originator’s customers. Naturally, to avoid the notification, you shoul...
GoAntiFraud

Case study:Processing balance checks USSD-responses with floating point

04 Mar 2016 15:36
The HistoryA client needs to check his SIM cards' balances. He can recieve 2 different types of messages when sending the USSD request:“Your balance is 40 USD and 50 cents”.” Your balance is minus 40 USD and 50 cents”SolutionWe need to create USSD-template for balance check and assign it to the acti...
GoAntiFraud

Case Study: Tarification in GoAntiFraud

04 Apr 2016 10:25
Options and principles for automatic calculation of SIM-card balance without frequent USSD-requests in GoAntiFraud system. From this video you will learn how to set up the function of charging the balance of SIM-cards. Why is it useful for the terminator? Termination requires monitoring the ba...
GoAntiFraud

Case Study: Channels status and what do they mean?

18 Mar 2016 15:54
The video explains the meaning of various statuses of GSM channels that are displayed in the GoAntiFraud user's personal account. The "Channels" window displays the current status for each channel: No SIM. It means that there is no SIM-card in the gateway. Simply insert the card into...
GoAntiFraud

Case Study: Traffic distribution with Carriers setup

15 Apr 2016 14:59
To diversify areas of your calls, GoAntiFraud makes "Carriers" settings available. All you need to do is to go to Config-> Carriers tab and create a possible direction for the call.To create a direction, you need to specify the area code and the number of digits.You can also add or remove digit...
GoAntiFraud

Case Study: Generation of incoming calls

01 Apr 2016 14:35
One of the main parameters of human behavior, which Antifraud systems monitor, is incoming calls to SIM-cards: namely, the percentage ratio of incoming calls to outgoing calls. GoAntiFraud can help you simulate the behavior of a person for a given parameter. All you need to do is go to the "Tari...

GoAntiFraud

GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud
GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud GoAntiFraud