Difference between monetary (*default) balance amount and sum of cdr's costs

344 views
Skip to first unread message

Александр Чудов

unread,
Dec 21, 2017, 4:25:05 AM12/21/17
to CGRateS
Hi, everyone.
I have next problem:
As an example (see attachment).
I got sum of all cdr's costs (from field cost_details.Cost from cdrs table). After that I got amount of balance "ID":"*default","Type":"*monetary" (from API GetAccount).
And total sum of CDR's = 0, but monetary balance = -0.32313.

After that I start investigate CDRs? and found that last CDR was without cost_details (it's NULL), but in "account_summary" I found monetary balance that has got "Value":-0.31612 (still not monetary balance = -0.32313).

All this confuse me a lot.
Next I start check another numbers, and found that almost always monetary (*default) balance amount and sum of cdr's costs are DIFFERENT. Some times it's just 0.00001 (in the fifth sign), some times more.

Can someone explain me how monetary balance calculates? I thought it's current amount of client money.
And why CDRs amount sum difference from monetary balance?

Thanks for any help!
34684427361.csv

DanB

unread,
Dec 21, 2017, 4:34:02 AM12/21/17
to cgr...@googlegroups.com
Hi cho...@gmail.com,

The differences can come due to rounding.
In CDR we place the cost we calculate (also sum of all costs of all
balance operations) and the balance can be again rounded standalone
when operating on the balance itself. The two processes are independent
of each other and can create some residual values due to rounding
different values.

Moreover the Cost is rounded using rounding decimals you define in
tariff plans and balance is rounded based on the rounding decimals you
define in your cgrates.json settings.

What you can do is increase the number of decimals in both places and
at some point you will have very close values.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/72f79021-2bc9-413c-b64c-69ed3a3f5757%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.

Александр Чудов

unread,
Dec 21, 2017, 5:17:33 AM12/21/17
to CGRateS
Hi, DanB.

Thanks for your answer.
I'd checked these two places with round settings:
- in tariff we got rounding_method=*up и rounding_decimals=5
- in cgrates setting we have commented line with round settings
// "rounding_decimals": 5,
so I think cgrates you default number = 5.

I understand your proposal about increasing these round number to get very close values.

But I still cannot understand:
why monetary balance, that I found in CDR get "Value":-0.31612, but monetary balance = -0.32313? Difference is about 0.00701 and I cannot be "The differences can come due to rounding"

Or I am wrong?

Alexander.

--------------------------------------------------------------

DanB

unread,
Dec 21, 2017, 5:27:12 AM12/21/17
to cgr...@googlegroups.com
Hi Alexander,

Can you post here the CDR/Account? Just to make sure I understand your
question properly.

Thanks,
DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/0e571fe2-01e8-40d0-8806-4b39f8cd1880%40googlegroups.com

Александр Чудов

unread,
Dec 21, 2017, 5:56:37 AM12/21/17
to CGRateS
Sorry, DanB.
I cannot understand what exactly I should post here? What do you mean by "CDR/Account"?

Aleksandr

четверг, 21 декабря 2017 г., 12:27:12 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 21, 2017, 6:17:47 AM12/21/17
to cgr...@googlegroups.com
Alexandr,

I am talking about the CDR and Account data which looks suspicious to
you.

DanB
> msgid/cgrates/0c9786d3-098b-4d10-bb3d-7dab0e295590%40googlegroups.com

Александр Чудов

unread,
Dec 21, 2017, 6:22:59 AM12/21/17
to CGRateS
I already attached in first message example of all CDRs for number 34684427361.
Monetary balance amount that cgrates return is "-0.32313"

Alexsander

четверг, 21 декабря 2017 г., 13:17:47 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 21, 2017, 7:53:27 AM12/21/17
to cgr...@googlegroups.com
Alexsander,

Please let me know the CGRID of the CDR you are complaining about.
Also, what version of CGRateS are you using?

Ta,
DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/7b793a4e-7e76-4b59-b77e-585fd5b6662f%40googlegroups.com

Александр Чудов

unread,
Dec 21, 2017, 9:13:12 AM12/21/17
to CGRateS
DanB,
CGRID = 0cbb95a4dda80e40ff0166960e285f1dfa0e649b
ID = 1616128

CGRateS version:
>>cgr-engine -version
CGRateS 0.9.1~rc8

commit b6857bf9bd68fdc6b4fa43bd07e6aed68d962702

Alexander.

четверг, 21 декабря 2017 г., 14:53:27 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 21, 2017, 9:26:21 AM12/21/17
to cgr...@googlegroups.com
Alexander,

The CDR shows a rating timeout (CDRs did not get a reply from your
RALs), when calculating that CDR. I don't see any cost log inside that
record.
Most probably the balance was deducted by SM and it could be that there
are the missing funds also.

DanB
> msgid/cgrates/d28e6638-c600-436f-b82d-fe2ed3a36f3b%40googlegroups.com

Александр Чудов

unread,
Dec 21, 2017, 10:20:30 AM12/21/17
to CGRateS
DanB,
Can you explain this part "Most probably the balance was deducted by SM and it could be that there 
are the missing funds also." more deeply, please?
Who is SM?

четверг, 21 декабря 2017 г., 16:26:21 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 21, 2017, 10:23:20 AM12/21/17
to cgr...@googlegroups.com
Alexander,

How are you receiving your CDRs?

DanB
> msgid/cgrates/7a4512c0-df8a-47c1-8ee2-5e5157bd21c2%40googlegroups.com

Александр Чудов

unread,
Dec 21, 2017, 10:28:25 AM12/21/17
to CGRateS
DanB,

from freeshwitch.

четверг, 21 декабря 2017 г., 17:23:20 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 21, 2017, 10:29:55 AM12/21/17
to cgr...@googlegroups.com
Alexander,

Sessions should be controlled by a component named Session Manager.
This will debit the balances in real-time for *prepaid calls.

DanB
> msgid/cgrates/92ca3ddc-999b-405c-8371-0c11bde995e3%40googlegroups.com

Александр Чудов

unread,
Dec 21, 2017, 10:38:52 AM12/21/17
to CGRateS
DanB, 
ok, SM is Session Manager, and SM deducted money from balance.
I cannot understand one thing.
How prepaid client with 0(zero) money on account get deduction from balance and get negative balance, if there is not cost in CDRs?
I mean, one line didn't do calls/sms beyond 'free minuts/sms in plan', and got negative balance.

четверг, 21 декабря 2017 г., 17:29:55 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 21, 2017, 10:43:11 AM12/21/17
to cgr...@googlegroups.com
Alexander,

The session processing and CDR processing are decoupled in CGRateS.
There are various corner cases when you can debit more than available
credit, some of them bellow:
* Simultaneous calls out of same account
* Double charging
* Rounding
* Parallel debits out of different systems (ie: manual debit via API).

DanB
> > > > > > > msgid/cgrates/d28e6638-c600-436f-b82d-
> > > > > > fe2ed3a36f3b%40googlegroups.com
> > > > > > > .
> > > > > > > For more options, visit https://groups.google.com/d/optou
> > t.
> > > > >
> > > > > --
> > > > > You received this message because you are subscribed to the
> > > > Google
> > > > > Groups "CGRateS" group.
> > > > > To unsubscribe from this group and stop receiving emails
> > from
> > > > it,
> > > > > send an email to cgrates+u...@googlegroups.com.
> > > > > To post to this group, send email to cgr...@googlegroups.com.
> >
> > > > > To view this discussion on the web visit https://groups.googl
> > e.co
> > > > m/d/
> msgid/cgrates/3fcd76ae-7362-4139-9e35-ff9c74f4da99%40googlegroups.com

Александр Чудов

unread,
Dec 22, 2017, 2:09:00 AM12/22/17
to CGRateS
Thank you DanB for answer.
Am I right understand that not all account debits are save in CDRs?

Alexander

четверг, 21 декабря 2017 г., 17:43:11 UTC+2 пользователь DanB написал:
Alexander,

DanB

unread,
Dec 22, 2017, 4:23:12 AM12/22/17
to cgr...@googlegroups.com
Alexander,

All account debits are saved in storDB.
If it is session manager doing the debits, it will back them up in
sm_costs and these costs will be retrieved when the CDR will show up
(as said the process is decoupled). The CDR will not longer be rated by
RALs but directly out of cost saved in sm_costs. In case of CDRs doing
the calculation, the cost will be attached to the CDR directly.

Hope this helps!
DanB


Александр Чудов

unread,
Dec 22, 2017, 4:41:23 AM12/22/17
to CGRateS
DanB,
this information is very useful. Thanks.
I found SM costs for example number 34684427361 (see attachment).
But there is no cost that more then zero.
And still I cannot solve this equation:
debits from SM + CDR debits = monetary balance
every time monetary balance are less then debits from CDRs and SM.

Maybe there is one more "
term"? and equation is:
??? +  debits from SM + CDR debits = monetary balance

Alexander

пятница, 22 декабря 2017 г., 11:23:12 UTC+2 пользователь DanB написал:
34684427361_SM_costs.csv

DanB

unread,
Dec 22, 2017, 4:58:23 AM12/22/17
to cgr...@googlegroups.com
Alexander,

Not sure about your environment. Another place where balance can be
consumed can be via derived charging. Are you having such configured?

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/78355c7a-9df8-421c-9f9f-55049aa46a12%40googlegroups.com

Александр Чудов

unread,
Dec 22, 2017, 5:05:18 AM12/22/17
to CGRateS
DanB,
Should this " derived charging... such configured" be in cgrates config file?
Or you mean do we use debit and credit monetary balance by api? If yes, than "Yes, we use debit/credit user account"

Alexander

пятница, 22 декабря 2017 г., 11:58:23 UTC+2 пользователь DanB написал:
Alexander,

DanB

unread,
Dec 22, 2017, 5:06:42 AM12/22/17
to cgr...@googlegroups.com
Alexander,

DerivedCharging is configured in your tariff plans. If you also use
debit APIs that is another extra place where your balance can be
debitted.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/843c6911-2ab4-45c1-a7b7-0b255a86df94%40googlegroups.com

Александр Чудов

unread,
Dec 22, 2017, 5:17:17 AM12/22/17
to CGRateS
DanB,

all info about example number's derived chargers you can find it in attachment.

Sorry, for disturbing a lot :)
I just try to find way to get all parts that can change monetary balance, 
and to be able calculate the same amount from these parts as amount in monetary balance:

X + Y + Z = amount = amount in monetary balance

Alexander

пятница, 22 декабря 2017 г., 12:06:42 UTC+2 пользователь DanB написал:
Alexander,

34684427361_derived_chargers.csv

DanB

unread,
Dec 22, 2017, 5:30:54 AM12/22/17
to cgr...@googlegroups.com
Hi Alexander,

I don't understand your question in your last email, or was there one?

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/6766bc9c-dce2-462b-b754-e115170bbcc1%40googlegroups.com

Александр Чудов

unread,
Dec 22, 2017, 5:37:02 AM12/22/17
to CGRateS
DanB,

now monetary balance for example number = -0.32313
How to find ALL costs that form this sum?

Alexander

пятница, 22 декабря 2017 г., 12:30:54 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 22, 2017, 5:59:22 AM12/22/17
to cgr...@googlegroups.com
Alexander,

Costs should be reflected in the CDRs, as previously stated. In your
case you had a CDR with missing costs due to RALs timing out when
replying. This could happen due to a number of reasons (one of it could
be overload of RALs or db slow down).
Other costs can be deducted via APIs which we don't log. We only log
debits which we do ourselves during billing process and consider that
you will be logging your actions externally.

DanB
> msgid/cgrates/b63da44b-1ee9-4d1d-b0df-83e0cf8370af%40googlegroups.com

Александр Чудов

unread,
Dec 22, 2017, 6:17:42 AM12/22/17
to CGRateS
DanB,
as a conclusion, there is no way to get all info that I need, because some cdrs/debits can be lost, right?

Alexandr

пятница, 22 декабря 2017 г., 12:59:22 UTC+2 пользователь DanB написал:
Alexander,

DanB

unread,
Dec 22, 2017, 8:31:09 AM12/22/17
to cgr...@googlegroups.com
Alexandr,

It is not easy to loose CDRs since there are multiple layers of
security against this:

1. FreeSWITCH will save the CDR locally on disk if it fails delivering
to CGRateS.
2. CGRateS does not take any billing action unless the *raw CDR is
successfully saved and moreover reports back error if it failed saving
it (so FreeSWITCH can store it again offline locally).
3. Syslog errors in case of failing of the storage.
4. Local storage to file if online exports are failing.

So as you see, you need to identify a leak we did not think of if you
claim missing CDRs.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/1a2a8713-4678-42ec-8815-f0ef4d9c915c%40googlegroups.com

Александр Чудов

unread,
Dec 26, 2017, 4:58:55 AM12/26/17
to CGRateS
Hi, DanB.
Sorry for delay with answer.

I am thinking about another problem. Generally, why PREPAID number get negative account?
Our example number 34684427361 get key in cgrtaes (radis) with "RequestType" = *prepaid  
As I understand prepaid number cannot go beyond an account to negative value?
Or I am wrong?

Alexander.

пятница, 22 декабря 2017 г., 15:31:09 UTC+2 пользователь DanB написал:

DanB

unread,
Dec 27, 2017, 3:59:40 AM12/27/17
to cgr...@googlegroups.com
Hi Alexander,

The AllowNegative flag only works in authorization phase, ie: will not
allow the account to go bellow 0 and return the maximum duration the
call can last. If your calls goes beyond that, CGRateS will respect
your CDR (ie: one second more can mean going on negative).
There are other places which can influence account going on negative
(ie: you debitting from your website, rounding parallel calls, etc).

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/f69a5715-adcc-41d5-bdc0-610a17ba7049%40googlegroups.com

Александр Чудов

unread,
Jan 5, 2018, 7:57:43 AM1/5/18
to CGRateS
Hi DanB,

we still need help for this topic.

Does CGRateS have some API methods for receiving data about who and how many debit/credit monetary balance?

Thanks for help
Aleksandr

среда, 27 декабря 2017 г., 10:59:40 UTC+2 пользователь DanB написал:

Dan B

unread,
Jan 5, 2018, 3:44:58 PM1/5/18
to cgr...@googlegroups.com
Hi Alexander,

This is the purpose of callcost logs in CDRs. You should find every detail of your debits inside there.


DanB

--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+unsubscribe@googlegroups.com.

To post to this group, send email to cgr...@googlegroups.com.

Александр Чудов

unread,
Jan 10, 2018, 3:45:11 AM1/10/18
to CGRateS
Hi, DanB.

There are cdrs with run_id=origination/termination/transit in cdrs table.These cdrs have cost,  and sum of these three cdrs is 'provider cost' for us.
Where CGRateS get costs for these cdrs? Where I found settings for this?

Best regards, Alexandr.

пятница, 5 января 2018 г., 22:44:58 UTC+2 пользователь DanB написал:
Hi Alexander,

This is the purpose of callcost logs in CDRs. You should find every detail of your debits inside there.


DanB
On Fri, Jan 5, 2018 at 1:57 PM, Александр Чудов <cho...@gmail.com> wrote:
Hi DanB,

we still need help for this topic.

Does CGRateS have some API methods for receiving data about who and how many debit/credit monetary balance?

Thanks for help
Aleksandr

среда, 27 декабря 2017 г., 10:59:40 UTC+2 пользователь DanB написал:
Hi Alexander,

The AllowNegative flag only works in authorization phase, ie: will not
allow the account to go bellow 0 and return the maximum duration the
call can last. If your calls goes beyond that, CGRateS will respect
your CDR (ie: one second more can mean going on negative).
There are other places which can influence account going on negative
(ie: you debitting from your website, rounding parallel calls, etc).

DanB

--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+u...@googlegroups.com.

To post to this group, send email to cgr...@googlegroups.com.

DanB

unread,
Jan 10, 2018, 8:50:58 AM1/10/18
to cgr...@googlegroups.com
Hi Alexandr,

The settings for costs are defined in your tariff plans.

I suggest you check the freeswitch tutorial posted here:
https://cgrates.readthedocs.io/en/latest/tut_freeswitch.html


DanB

Александр Чудов

unread,
Jan 11, 2018, 10:01:37 AM1/11/18
to CGRateS
Hi, DanB.

You said "The settings for costs are defined in your tariff plans.".
I cannot find settings in tariffs for origination/termination/transit costs.
As I know when we create new tariff plan, we can only load "rate" to table tp_rates,
 but this rate for "customer cost' not for origination/termination/transit.
Or I am wrong?

In "the freeswitch tutorial" I didn't find any helpful info.

Regards, Aleksandr


среда, 10 января 2018 г., 15:50:58 UTC+2 пользователь DanB написал:

DanB

unread,
Jan 11, 2018, 10:07:10 AM1/11/18
to cgr...@googlegroups.com
Alexandr,

The cost is matched with the CDR data. This can be out of standard
(*raw) or it can be based on your DerivedChargers. It could be you have
there defined rules which are forking your CDRs.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/462d6646-9785-4c29-a22b-379c80143276%40googlegroups.com
> .

Александр Чудов

unread,
Jan 11, 2018, 10:28:59 AM1/11/18
to CGRateS
DanB, 
I attached an example of derived charges for one number from StorDB.tp_derived_chargers.
In the example there are tree "runid" (origination/termination/transit) for each of category (data/call/sms).

I understand that these derived charges define rules to create tree additional cdrs, but I still didn't find any "cost rules".

Sorry, but I still cannot understand, how cdrs with "runid" = origination/termination/transit get their "cost"?

Aleksandr.

четверг, 11 января 2018 г., 17:07:10 UTC+2 пользователь DanB написал:
tp_derived_chargers_example.csv

DanB

unread,
Jan 11, 2018, 12:12:11 PM1/11/18
to cgr...@googlegroups.com
Alexandr,

Each new CDR "derived" will be handled as standalone CDR and will match
normally based on your RatingProfiles.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/ff0dcfda-5059-494e-b7ac-f8b545b07371%40googlegroups.com

Александр Чудов

unread,
Jan 11, 2018, 12:17:51 PM1/11/18
to CGRateS
DanB,
"Each new CDR "derived" will be handled as standalone CDR" - this is OK.
"will match normally based on your RatingProfiles" - ???

Ok. For examplpe, I need change cost for "transit", how and where I can do this?

Aleksandr

четверг, 11 января 2018 г., 19:12:11 UTC+2 пользователь DanB написал:

DanB

unread,
Jan 11, 2018, 12:18:55 PM1/11/18
to cgr...@googlegroups.com
Alexandr,

You need to properly tweak your rating profiles.

DanB
> msgid/cgrates/d500f106-e862-4a3d-9db9-b21264b753a3%40googlegroups.com

Александр Чудов

unread,
Jan 11, 2018, 12:20:31 PM1/11/18
to CGRateS
DanB,

"You need to properly tweak your rating profiles." - where and how????
Is there any instruction about this settings?

Aleksandr.

четверг, 11 января 2018 г., 19:18:55 UTC+2 пользователь DanB написал:

DanB

unread,
Jan 11, 2018, 12:28:07 PM1/11/18
to cgr...@googlegroups.com
Alexandr,

You will need to go through FreeSWITCH tutorial and come back with your
questions regarding that one since unfortunately we cannot support your
own environment here, nor offer the training over this mailing list. We
are willing to clear your doubts if any but first you need to do the
efforts in understanding CGRateS architecture and that is what tutorial
is for.

Once you will go through tutorial you will be able to find all the .csv
files you need to define a complete tariff plan.
Explanations regarding each file you can find here:
https://cgrates.readthedocs.io/en/latest/tariff_plans.html

Hope this helps.

DanB
> msgid/cgrates/4fe1b75f-8ad2-4b79-8eef-6a86c17c50ec%40googlegroups.com

Александр Чудов

unread,
Jan 11, 2018, 3:35:51 PM1/11/18
to CGRateS
Dear DanB,
thanks a lot for your help!!!
I think I found what I need and now I understand about cdr's with "runid" (origination/termination/transit)  in  tp_derived_chargers.
Thank you very much.

Now I have next question:
In table "tp_rating_profiles" I have some rows with the same data in "direction", "category", "subject" (equals = "*any"), and "rating_plan_tag", 
but with different data in column "tenant".
Can I use something like "*any" in column "tenant" to be able to use "one" rating plan for all subjects for ALL tenants?

Best regards, Aleksandr.  

четверг, 11 января 2018 г., 19:28:07 UTC+2 пользователь DanB написал:
Alexandr,

DanB

unread,
Jan 12, 2018, 2:20:57 AM1/12/18
to cgr...@googlegroups.com
Hi Alexandr,

In RatingProfiles you can use *any only in Subject. You should
duplicate the rest of rows for each tenant/category.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/a426ea52-a2a9-4daa-ade4-07aeb0581066%40googlegroups.com

Александр Чудов

unread,
Jan 12, 2018, 2:51:57 AM1/12/18
to CGRateS
Hi, DanB.

Ok. Thanks for help.

Aleksandr

пятница, 12 января 2018 г., 9:20:57 UTC+2 пользователь DanB написал:

Александр Чудов

unread,
Jan 29, 2018, 4:09:03 AM1/29/18
to CGRateS
Hi DanB,
sorry for disturbing again.

We had another problem according to this topic.

For example, one of our client got "negative monetary balance" (-0.32165) because of reasons that we discuss in this topic.
When this client try to recharge his account on 5 euro (for example), to be able to use our service (that cost exactly 5 euro),
the amount of monetary balance will be not 5 but  4.67835 euro, and client cannot use our service.

How can we fix this situation? How another customers of CGRateS fix this?

Will be appreciate for any help.

Best regards, Aleksandr.  

пятница, 12 января 2018 г., 9:51:57 UTC+2 пользователь Александр Чудов написал:

DanB

unread,
Jan 31, 2018, 6:39:58 AM1/31/18
to cgr...@googlegroups.com
Hi Aleksandr,

Today you can use Action filters to reset balance to 0 (ie: "*lt": 0).
If you prefer, please add an issue on github and we could add an action
which resets balance to 0 if original balance is smaller than 0
(*zero_if_negative).

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/88cf1f60-11bf-45b7-a0b2-dc119b45c3a5%40googlegroups.com

Александр Чудов

unread,
Jan 31, 2018, 6:53:05 AM1/31/18
to CGRateS
Thanks, DanB.


Am I right understand, that after you will add action "*zero_if_negative", I will be able to create new action in cgrates.tp_actions table?
Can I set it directly in DB? or I need use API for this?

Best regards, Aleksandr

среда, 31 января 2018 г., 13:39:58 UTC+2 пользователь DanB написал:

DanB

unread,
Jan 31, 2018, 7:10:07 AM1/31/18
to cgr...@googlegroups.com
Alexandr,

Should work by just adding to TPActions.

DanB
> --
> You received this message because you are subscribed to the Google
> Groups "CGRateS" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to cgrates+u...@googlegroups.com.
> To post to this group, send email to cgr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/cgrates/7438217a-ea71-4fff-921d-384fe94d10e7%40googlegroups.com

Александр Чудов

unread,
Jan 31, 2018, 7:13:57 AM1/31/18
to CGRateS
With this data http://cgrates.readthedocs.io/en/latest/tariff_plans.html?#actions right?

среда, 31 января 2018 г., 14:10:07 UTC+2 пользователь DanB написал:

DanB

unread,
Jan 31, 2018, 7:15:16 AM1/31/18
to cgr...@googlegroups.com
Alexandr,

It will be in Actions.csv (or tp_actions).

DanB

On Wed, 2018-01-31 at 04:13 -0800, Александр Чудов wrote:
> With this data http://cgrates.readthedocs.io/en/latest/tariff_plans.h
> msgid/cgrates/ec43ea0d-b09e-4873-95f7-1e0cb0b3ed73%40googlegroups.com

Александр Чудов

unread,
Jan 31, 2018, 7:16:42 AM1/31/18
to CGRateS
Ok. Thanks for help.
I will wait for issue closing, and then will try it.

Best regards, Aleksandr

среда, 31 января 2018 г., 14:15:16 UTC+2 пользователь DanB написал:
Reply all
Reply to author
Forward
0 new messages