I think it could be done by some special DB function. <br><div class="gmail_quote">You can write one in plpgsql, then you can exec it using the sql radius module.<br><br><div class="gmail_quote">2008/12/3 <a href="mailto:regs@kinetix.gr" target="_blank">regs@kinetix.gr</a> <span dir="ltr"><<a href="mailto:regs@kinetix.gr" target="_blank">regs@kinetix.gr</a>></span><div>
<div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
These situations are often in the VoIP billing world. If the rate
changes during a call there is little<br>
you can do in a prepaid billing system (in a postpaid situation this is
not a problem). You have to choose<br>
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 <br>
implemantations choose to bill the customer with the rate that is valid
at the end of the call. I know<br>
this is somewhat inconsistent because if you calculate the remaining
time with a low rate and the rate changes <br>
during the call then you might end up with a negative credit on your
prepaid customer's balance. There is little <br>
you can do to about that. You just have to choose one of the options
above and notify your customers <br>
about your decision. The thing is that all this - although scary at
first sight - is somewhat balanced in the end<br>
(fair-wise) because the probabilities that your customer can make a
call during a low-to-high rate change are<br>
equal with the probabilities that the call follows a high-to-low rate
change. So in the end nobody really loses or wins.<br>
<br>
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<br>
gives you control of all different scenarios that may arise. Your
back-end could (usually a DB in these situations)<br>
be as complex as you like (pricelists per customer, per time-slice, per
type, per u-name-it), and your code could<br>
be as complex as you like (and as dynamic as you like) using a 3rd
generation language that gives the flexibility to<br>
do whatever you want.<div><div></div><div><br>
<br>
<br>
Alan DeKok wrote:
<blockquote type="cite">
<pre>Saeed Akhtar wrote:
</pre>
<blockquote type="cite">
<pre>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.
</pre>
</blockquote>
<pre> See the "expr" module. It has limited support for some math expressions.
Alan DeKok.
-
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a>
</pre>
</blockquote>
<br>
</div></div></div>
<br>-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br></blockquote></div></div></div><br>
</div><br>