[Spce-user] carrier accounting

Daniel Tiefnig dtiefnig at sipwise.com
Tue Jun 26 14:36:13 EDT 2012


On 06/26/2012 03:12 PM, Skyler wrote:
> Funny, the answer was right in front of me this whole time. The
> table decimal places are 2 in cdr, so of course it is always showing
> 0.00 because the rated value is less than 1 cent.  I changed this now
> to 4 decimal and now I can see the correct rated numbers in the cdr.

Hmm, a rate of 0.004 cent per minute *is* very low, isn't it? :)
Actually I was thinking about exactly a case like this, and decided it
shouldn't matter, as one would never [famous last words] have such low
rates... Having four decimals in the call_fee seems to support common
usage. Is this something other people here on the list would consider
reasonable to be adjusted to 10,4 or 10,6 even?

> I've tried the same for customer_cost and while this also shows
> correct rated values, the www-admin/www-csc cdr view is still showing
> 0.0000 there. Will poke around a bit and revert when I figure it
> out.

Hmm, is the value in the DB >= 0.005? If not, look at the function
prepare_call_list() in /usr/share/ngcp-www-csc/lib/csc/Utils.pm and
search for "call_fee". You can find the rounding function as follows:

$callentry{call_fee} = sprintf "%.04f", $$call{call_fee}/100;

Replace the "%.04f" by "%.06f", or how many decimals you want to have.
Do not just remove the sprintf, as you will see floating-point weirdness
without it.

Not sure how well the layout in the interface copes with the additional
didigts, though.

Same applies for www-admin btw.

br,
daniel




More information about the Spce-user mailing list