[Asterisk-Users] ASTCC gives me only the time, but no cost

Darren Wiebe darren at aleph-com.net
Sat Jul 23 15:08:55 MST 2005


Thank you very, very much Rusty.  I reopened the bug report. 
http://bugs.digium.com/view.php?id=4479  I made a very slight change to 
the method it uses to calculate costs but it should implement the 
connect charge properly.  Initially I rewrote the cost calculation code 
but that was not necessary, it can be implemented by changing the 
following lines
my $adjtime = int(($answeredtime + $increment - 1) / $increment) * 
$increment

becomes

$adjtime = int((($answeredtime - $numdata->{includedseconds}) + 
$increment - 1) / $increment) * $increment

Anybody that is interested, please feel free to comment on the bug 
report. Once that one goes in, another bug will probably get commited 
that allows you to calculate what ASTCC will charge for a call from the 
web interface.  That makes testing and confirming that you are setting 
it up right much easier.

Darren Wiebe
darren at aleph-com.net


Rusty Shackleford wrote:

>>-----Original Message-----
>>From: asterisk-users-bounces at lists.digium.com 
>>[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of 
>>Darren Wiebe
>>Sent: Saturday, July 23, 2005 8:08 AM
>>To: Asterisk Users Mailing List - Non-Commercial Discussion
>>Subject: Re: [Asterisk-Users] ASTCC gives me only the time, 
>>but no cost
>>
>>
>>The included seconds field is not taken into account when billing the 
>>connect charge.  IMHO this is a bug but I've not gotten 
>>enough feedback 
>>to put the patch through.  Therefore the patch has been closed. :-)
>>    
>>
>
>I spent an afternoon going through that code again, Darren. You were
>right. If we assume that the intent was to use the "includedseconds"
>column value as a way to allow for x/y billing intervals, and set
>"connectcost" to the value that we want to charge for the call minimum
>charge - "x", the stock code charges that amount, but also starts the
>meter running on the "y" value from the start of the call, resulting in
>an over charge. The "y" value, by the way, is set in the "brands" table
>and flows to the "cards" table when cards are created (breaking
>normalization). For example, we have a route to McMurdo Station for
>which we charge $.50 per minute, in six second increments with a 30
>second minimum (30/6). If we set the connect charge column to $.25, the
>included seconds to 30, and the cost to $.50, a 30 second call should
>cost $.25. Instead, it's costing $.50, because ASTCC charged the connect
>fee, plus the cost of 5 six second increments - $.25. It shouldn't start
>charging those six second increments until AFTER the "includedseconds"
>interval has passed. 
>
>I've patched by scripts to correct this. It would be nice if the
>correction were made to the distributed source, perhaps with some
>documentation of how things are supposed to work.
>
>  
>




More information about the asterisk-users mailing list