Hi Daniel,<br><br><div class="gmail_quote">On Tue, Jun 26, 2012 at 11:36 AM, Daniel Tiefnig <span dir="ltr"><<a href="mailto:dtiefnig@sipwise.com" target="_blank">dtiefnig@sipwise.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 06/26/2012 03:12 PM, Skyler wrote:<br>
> Funny, the answer was right in front of me this whole time. The<br>
> table decimal places are 2 in cdr, so of course it is always showing<br>
> 0.00 because the rated value is less than 1 cent. I changed this now<br>
> to 4 decimal and now I can see the correct rated numbers in the cdr.<br>
<br>
</div>Hmm, a rate of 0.004 cent per minute *is* very low, isn't it? :)<br>
Actually I was thinking about exactly a case like this, and decided it<br>
shouldn't matter, as one would never [famous last words] have such low<br>
rates... Having four decimals in the call_fee seems to support common<br>
usage. Is this something other people here on the list would consider<br>
reasonable to be adjusted to 10,4 or 10,6 even?<br>
<div class="im"><br>
> I've tried the same for customer_cost and while this also shows<br>
> correct rated values, the www-admin/www-csc cdr view is still showing<br>
> 0.0000 there. Will poke around a bit and revert when I figure it<br>
> out.<br>
<br>
</div>Hmm, is the value in the DB >= 0.005? If not, look at the function<br>
prepare_call_list() in /usr/share/ngcp-www-csc/lib/csc/Utils.pm and<br>
search for "call_fee". You can find the rounding function as follows:<br>
<br>
$callentry{call_fee} = sprintf "%.04f", $$call{call_fee}/100;<br>
<br>
Replace the "%.04f" by "%.06f", or how many decimals you want to have.<br>
Do not just remove the sprintf, as you will see floating-point weirdness<br>
without it.<br>
<br>
Not sure how well the layout in the interface copes with the additional<br>
didigts, though.<br>
<br>
Same applies for www-admin btw.<br>
<br>
br,<br>
daniel<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div> 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. </div>
<div><br></div><div> As suggested I changed the $callentry line in /usr/share/ngcp-www-csc/lib/csc/Utils.pm now to this removed /100:</div><div><br></div><div>$callentry{call_fee} = sprintf "%.04f", $$call{call_fee};</div>
<div><br></div><div> All is displaying properly now in www-csc/www-admin.</div><div><br></div><div>Skyler </div></div>