[Spce-user] carrier accounting

Skyler skchopperguy at gmail.com
Wed Jun 27 04:31:18 EDT 2012


Hi,

 In addition, I also noticed that a long digit/decimal number was not
displaying correctly in 'edit billing fees' within www-admin. Example, a
number enterd like 0.00349999998 would be shown as 5.5555555555-e8. I
looked into the DB and all looked fine, though I had to reapply the DOUBLE
type to fix this. Don't know why.

ALTER TABLE billing.billing_fees MODIFY onpeak_init_rate double;
ALTER TABLE billing.billing_fees MODIFY onpeak_follow_rate  double;
ALTER TABLE billing.billing_fees MODIFY offpeak_init_rate double;
ALTER TABLE billing.billing_fees MODIFY offpeak_follow_rate double;


 This is important because when a XML/SOAP query is made
using search_billing_profile_fees ... the  onpeak_init_rate returns with
the  5.5555555555-e8 number instead of the expected 0.00349999998 number.


Skyler

On Tue, Jun 26, 2012 at 4:27 PM, Skyler <skchopperguy at gmail.com> wrote:

> 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/20120627/6b1a4a8f/attachment-0001.html>


More information about the Spce-user mailing list