[Spce-user] Value Added Service Rate for Inbound Calls

Rene Krenn rkrenn at sipwise.com
Sat Dec 16 14:57:43 EST 2017


Situation is a bit tricky here - you seem to try negative fees for postpaid; while it seems we considered it for prepaid only so far.

The point is that "cash_balance" is supposed to show non-zero values in prepaid scenarios only.
The rating engine is trying to charge (subtract from) the cash balance first, and only if out of balance, cdr cost fields are incremented.
There is however the fallback, to also support a cash_balance for postpaid, if it was set to some balance (ie. to consider the possibility to give a postpaid contract a one-time 10euro for free).
As long as there is balance bigger than the rate tick available will use it up and therefore not increment the costs field.
Now the problem ist hat the above is always true for negative fees.
So for negative fees, it always substracts (->adds) the (negative) tick from the balance, also for postpaid, and the cdr costs will not ever show a negative value.

(I agree the cdr costs shoudl show a negative value, and those will also appear as such in call lists views)

To fix this behaviour, the line below in rato-o-mat

if ($rate <= $bal->{cash_balance}) {

can be cahnged to

if (($rate > 0 || $prepaid) and $rate <= $bal->{cash_balance}) {

(prepaid needs tob e passed throughout though). Maybe you can try if this fits the needs.
Can prepare a permanent change and run testsuites then.

Regards

-----Ursprüngliche Nachricht-----
Von: Spce-user [mailto:spce-user-bounces at lists.sipwise.com] Im Auftrag von Matthias Hohl
Gesendet: Samstag, 16. Dezember 2017 14:04
An: spce-user at lists.sipwise.com
Betreff: Re: [Spce-user] Value Added Service Rate for Inbound Calls

For my opinion the easiest fix would be, if the negative rated fee would be saved in the "destination_customer_cost" of the CDR file not as "negative value" instead of "0.0000".
AFAIK this "negative fee" would then also be visible in the "call history" of the subscriber and on the CDR file for billing.
On the invoice generation then there it needs to be showing inbound calls also.

Is this right?
Thanks.

-----Ursprüngliche Nachricht-----
Von: Spce-user [mailto:spce-user-bounces at lists.sipwise.com] Im Auftrag von Matthias Hohl
Gesendet: Samstag, 16. Dezember 2017 13:16
An: spce-user at lists.sipwise.com
Betreff: [Spce-user] Value Added Service Rate for Inbound Calls

Hello,

i tried negative-fees billing for value added services like 0900 or whatever with version 4.5.5 and have some troubles with it:

I created a negative fee (for testing purpose with -5 cent each second) in the customer billing profile and tried to call the subsriber number.

Now I was going to check the billing:
I  go to  "customer > balance intervals" and I saw that there was a value added under "cash". It ist he result of my negative fee and the seconds i called them. So that works.


But I found out this three things:

First:
If i go into the subscriber details >  call history  the call is there visible, but with "0" cost. It would be good for the customer, if there is also the negative cost/balance visible. Ist hat possible to make this generated "cash" there visible too?


Second:
On a generated invoice the inbound call does not show up at all under call details. So there is no information about the inbound call and also no rating for that on the invoice.
Also the "cash balance" is not visible on the invoice. So the "cash balance" 
will be ignored by generating an invoice. How can i fix that? Is that just an invoice template setting or something more?


Third:
I also checked the CDR file for reseller and system and there i can't find the negative fee for this call somewhere. "export_Incoming" is enabled in the config.yml file.

'3645150'	'2017-12-16 11:49:49'	'0'	'3'	''	''	''	'0'	'43676xxxxxx''92.xx.xx.xx'	'43676xxxxxx'	'0'	'92.63.xx.xx'	'c7fe25cb-cbb9-4a24-b9a7-xxxxxxxc'	'4'	'TestTrunk Telematica Internal'	'425'	'1001 - Testaccount'	'110'	'43720xxxxx' 
'sip.telematica.at'	'43720xxxxxx'	'176.xxx.xxx.xxx'	'43720xxxxx'	''	''	'call''ok'	'200'	'2017-12-1611:49:09.955'	'2017-12-16 11:49:13.996'	'21.579' 
'96769d2c-5cf1-1236-f0b6-0xxxxxx'	'ok'	'2017-12-16 11:49:49'	'0.000000''0.000000'	'onnet'	''	'platforminternal'	''	'0'	'0'	'0.000000'	'0.000000'	''	'Inbound Call 0810'	''	'Shared 
Cost Inbound'	'0'	'0'	'0.000000'	''	''	'0'	'0.000000'	''	''	'0'

The call duration is 21.579 seconds and should be 1.07895 EUR but yah, it is not there anywhere in the export.


MY results:
The negative billing for value added services works for the "cash balance" in the customer details, but is not visible somewhere else, either in the subscriber call details, nor on the invoice, nor in the cdr file... :(


Has anybody an idea how to fix that and to use negative fees in the right why?
Would be nice if you could help me out with that.

Thanks.





More information about the Spce-user mailing list