Goantifraud
Case study:Processing balance checks USSD-responses with floating point
Case study:Processing balance checks USSD-responses with floating point
04-Mar-2016 15:36

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

corporate

The History

A 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”

Solution


We need to create USSD-template for balance check and assign it to the active tariff.

Using the power of regular expression, we can split the response with different types of answer into 2 types of the response processing:

  • In the first case, we receive: “Your balance is 40 USD and 50 cents” message.

Example of USSD-processing algorythm:

Your balance is (?P<sim__balance_USD>-?\d+(\.\d*)?) USD and (?P<sim__balance_cents>-?\d+(\.\d*)?) cents

  • In the second case, we receive “Your balance is minus 40 USD and 50 cents” message.

Example of USSD-processing algorythm:

Your balance is minus (?P<s[pim__balance_USD>-?\d+(\.\d*)?) USD and (?P<sim__balance_censt>-?\d+(\.\d*)?) cents


The logic of input the values with floating point into the system


We split balance value to the 2 different variables:

  • sim__balance__USD – for whole numbers
  • sim_balance_cents – for digits after the decimal point

After parse, we transform this two values into the one float value using next expression.

  • The first case: float({sim__balance_USD}+"."+{sim__balance_cents})
  • The second case: float("-"+{sim__balance_USD}+"."{sim__balance_censt})

Let's see visual example.

First case:


Second case:


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
2436
5/5
4
votes

Related Articles

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

New GoAntiFraud Features:the Dashboard to Work with the Service

31 Jan 2017 09:11
From now GoAntiFraud customers can use a convenient dashboard. It allows the user to create a set of widgets to display the overall system status and basic call statistics. Dashboard will make GoAntiFraud easy to use and make your workflow more productive.You can track your system status based on va...
GoAntiFraud

Case study: automatic bonus recharge

26 Feb 2016 16:50
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 m...
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: 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

Case Study: Whats new in GoAntiFraud Patch 0.99.03?

06 May 2016 12:46
GoAntiFraud has recently released a new patch - 0.99.03 Consider the main innovations:- The status is added to the USSD / SMS historyNow, in the USSD history makes the status of the request visible:Answered – the request was successfulOptions not found - No appropriate options found in the USSD...
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

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