Hi all, I want to ask that if there is some kind of flexibility in freeradius to have time based billing. I want a customer to be charged at different rate at different time. Like I want to introduce a package which has different rate at morning eg. $1/hr from 0800 to 1200 then 0.5/hr from 1200 to 1800 then 0.25/hr from 1800 to 0800hrs. Now what should I do. I know that there are sqlcounters but these are for flat rates. Now is there any flexibility to do so. And if not then is there any plugable module available by which i could achieve this. I'll be thankful for your help Regards, Saeed Akhtar
Yes I know that freeradius doesn't know whether we are charging $ 1 or 2. But the purpose of asking question was that If a user has 3 hrs left @ $1/hr and after an hour the rate changes to 0.5/hr then technically freeradius should reply Session-Timeout = 5hrs as (1hr @ $1/hr + 4hrs @ $0.5/hr). So may be we can create some condition to do so. Ivan Kalik suggested that I should go for perl. But frankly speaking I never used perl so may be its too difficult for me to use perl code. I want to know is there any other choice or I have to go for perl? Regards, Saeed Akhtar On Tue, Dec 2, 2008 at 6:57 AM, mulianto <mulianto@cni.co.id> wrote:
i Think freeradius doesn't know if you charge for 1$ or 2$, it just counting the time usage.
it should be with your application task to do so..
On Tue, 2008-12-02 at 21:47 +0500, Saeed Akhtar wrote:
0.5/hr from 1200 t
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Saeed Akhtar wrote:
Yes I know that freeradius doesn't know whether we are charging $ 1 or 2. But the purpose of asking question was that If a user has 3 hrs left @ $1/hr and after an hour the rate changes to 0.5/hr then technically freeradius should reply Session-Timeout = 5hrs as (1hr @ $1/hr + 4hrs @ $0.5/hr). So may be we can create some condition to do so.
See the "expr" module. It has limited support for some math expressions. Alan DeKok.
These situations are often in the VoIP billing world. If the rate changes during a call there is little you can do in a prepaid billing system (in a postpaid situation this is not a problem). You have to choose either to bill your customer with the rate that is valid at the beginning of the call or at the end of it. Most of the implemantations choose to bill the customer with the rate that is valid at the end of the call. I know this is somewhat inconsistent because if you calculate the remaining time with a low rate and the rate changes during the call then you might end up with a negative credit on your prepaid customer's balance. There is little you can do to about that. You just have to choose one of the options above and notify your customers about your decision. The thing is that all this - although scary at first sight - is somewhat balanced in the end (fair-wise) because the probabilities that your customer can make a call during a low-to-high rate change are equal with the probabilities that the call follows a high-to-low rate change. So in the end nobody really loses or wins. You don't have to be a perl expert to use the rlm_perl module. But I can tell you from my experience that it gives you control of all different scenarios that may arise. Your back-end could (usually a DB in these situations) be as complex as you like (pricelists per customer, per time-slice, per type, per u-name-it), and your code could be as complex as you like (and as dynamic as you like) using a 3rd generation language that gives the flexibility to do whatever you want. Alan DeKok wrote:
Saeed Akhtar wrote:
Yes I know that freeradius doesn't know whether we are charging $ 1 or 2. But the purpose of asking question was that If a user has 3 hrs left @ $1/hr and after an hour the rate changes to 0.5/hr then technically freeradius should reply Session-Timeout = 5hrs as (1hr @ $1/hr + 4hrs @ $0.5/hr). So may be we can create some condition to do so.
See the "expr" module. It has limited support for some math expressions.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
I want to ask that if there is some kind of flexibility in freeradius to have time based billing. I want a customer to be charged at different rate at different time. Like I want to introduce a package which has different rate at morning eg. $1/hr from 0800 to 1200 then 0.5/hr from 1200 to 1800 then 0.25/hr from 1800 to 0800hrs. Now what should I do. I know that there are sqlcounters but these are for flat rates.
Yes, you can't use counters for that. But it shouldn't be too difficult to write a perl script that calculates correct Session-Timeout for authorization and deducts correct ammount on accounting Stop packet. http://wiki.freeradius.org/Rlm_perl Ivan Kalik Kalik Informatika ISP
Hey Saeed, daloRADIUS will introduce in the next version (0.9-8) a better billing system with rates supported, though currently the rates are flat (i.e: all session is taken into account and not devided per the time of day) but if you have suggestions for improvements we can take this into account. I don't think there's a place for any special time counter except for the basic ones because the time remains the same. Meaning, the user buys a 10 hours package, the fact that you devide this time line into different costs is not dependant upon the time itself, it will remain a 10 hours time, but you will charge the user differently based on the time he logged-on. So like I said, maybe we can discuss this more (probably on the dalo m-l) and see if we can fit in your idea for the next release. Regards, Liran. On Tue, Dec 2, 2008 at 6:47 PM, Saeed Akhtar <saeedakhtar.484@gmail.com>wrote:
Hi all,
I want to ask that if there is some kind of flexibility in freeradius to have time based billing. I want a customer to be charged at different rate at different time. Like I want to introduce a package which has different rate at morning eg. $1/hr from 0800 to 1200 then 0.5/hr from 1200 to 1800 then 0.25/hr from 1800 to 0800hrs. Now what should I do. I know that there are sqlcounters but these are for flat rates.
Now is there any flexibility to do so. And if not then is there any plugable module available by which i could achieve this. I'll be thankful for your help Regards,
Saeed Akhtar
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (6)
-
Alan DeKok -
liran tal -
mulianto -
regs@kinetix.gr -
Saeed Akhtar -
tnt@kalik.net