[Spce-user] carrier accounting

Skyler skchopperguy at gmail.com
Tue Jun 26 19:27:06 EDT 2012


Hi Daniel,

On Tue, Jun 26, 2012 at 11:36 AM, Daniel Tiefnig <dtiefnig at sipwise.com>wrote:

> 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
>
>
 Yes, it is low. It is special on-net peering arrangement. But now I see
that this will only work for us 1-way as spce does not do accounting on
inbound from peer, only outbound from us to them :( its ok though as our
on-net is probably not large enough to care ATM. I think there might be a
need for 10,6 in future for possible on-net agreements, but not for right
now.

 As suggested I changed the $callentry line
in /usr/share/ngcp-www-csc/lib/csc/Utils.pm now to this removed /100:

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

 All is displaying properly now in www-csc/www-admin.

Skyler
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20120626/ba43da38/attachment-0001.html>


More information about the Spce-user mailing list