asterisk2billing.org
http://forum.asterisk2billing.org/

Connect charge on buy rate
http://forum.asterisk2billing.org/viewtopic.php?f=18&t=3788
Page 1 of 1

Author:  mercual [ Wed Jun 04, 2008 2:06 pm ]
Post subject:  Connect charge on buy rate

Hello,

I need to add a connect charge in to the buy rate parameters.

This needed is because, my carrier sell the calls with a connect charge, and I buy the calls with this charge.

The problem of this is that if i have one rate with the same price but apply a connect charge, when i go to the cdr report to evaluate the marge of beneficy, the result is false, beacause the billing say that have a gain of the connect charge.

What can i do to solve this problem? perhaps i can put the connect charge in the buy menu of rate, and then add in to the cdr report on buy and then the comparasion belong true.

Can we help me?

Author:  stavros [ Wed Jun 04, 2008 5:12 pm ]
Post subject: 

The only easy way to approximate this would be to arrange the buy rate's minimum duration to bill the connect fee. This is the first time I've heard of a carrier charging a connect fee. What destination is this?

Author:  mercual [ Thu Jun 05, 2008 6:44 am ]
Post subject: 

This is not for a one destination.

I'm from Spain and the telephone provider apply a connect charge with all calls not only for one o two destinations.

This is the problem that i need to include the charge in the buy rate.

Only i can modify de buy rate with billing block and another field.

Thanks.

Author:  stavros [ Thu Jun 05, 2008 2:18 pm ]
Post subject: 

Unless you're happy to do some coding, the only workaround is to try to incorporate the connect charge into the minimum block and billing block for the buy rate.

Author:  kerojodo [ Wed Jun 25, 2008 9:09 am ]
Post subject: 

Hi. I'm not a coder, just been hacking the A2Billing code as necessary to get it to do what I want.
As the client pays for my time, I spend as little time as possible where possible.

Anyway - if you want just a connect charge (not a connect charge and a variable rate) for your buy rate edit:
/var/lib/asterisk/agi-bin/libs_a2billing/Class.RateEngine.php

Search for:
$buyratecost -= ($buyratecallduration/60) * $buyrate;

replace with:
if ($buyrateinitblock == 0 && $buyrateincrement == 0)
{
$buyratecost -= $buyrate;
}
else
{
$buyratecost -= ($buyratecallduration/60) * $buyrate;
}

Really simple hack, where if the increment and the initial block are 0, it will treat the buy rate as a connect charge.

Be sure that all your other ratecards don't have 0 for these values (I did this via some sql queries).

This is currently working in a production environment.

Hope this helps.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/