On Fri 03 Sep, Jonathan Allen wrote:
> All,
>
> I would like to set a minimum connect time, depending on the time of
> day. Over here in England, we are charged by the second, but with a
> minimum call cost. This means that at night or over the weekend, we
> can be on for up to five minutes and still pay no extra, and
> correspondingly for a shorter time during peak hours. To dial out
> twice in two minutes takes another minimum call cost.
>
> So, the question is: how can I get diald to hold the line up for a minimum
> period of time (preferably variable by day of week and time of day)
> even if there is no traffic flowing and the timer for the trigger event
> has expired ?
As I'm in the UK, and our phone bill is too big I have done some stuff on
this:
You can use the 'impulse' filter rule to specify the initial time as well
as the 'charge period' time.
By using a combination of restrict and impluse rules you can set
different behaviour for different times of day. You then include your
normal filter in each 'rstrict' section. The only disadvantage of this
technique is that a particular packet filter rule has several numbers
depending on the current 'phone rate' in operation. (This is only a
problem if you are debugging, and one of the scripts for listing rules
with numbers is then very handy).
If anyone knows a nicer way of achieving the same thing, I'd be
interested.
To clarify the above here's my 'time.filter'. 'Alephisdn.filter' is the
standard packet ruleset. Note that the specified times are about 10
seconds less than the actual charging times. This has been determined by
experiment to reliably close the link before being charged more money (if
no data is passing, of course). I think the extra comes in the time it
takes to connect.
# no calls at all midnight to 8am
restrict 00:00:00 07:59:59 * * *
down
# mon-fri we use the filter all the time
# and change impulse according to the time of day
# 8am to 6pm is 'standard rate' - 3p for 1st 39 secs
restrict 08:00:00 17:59:59 1-5 * *
impulse 30,0,0
include /etc/diald/alephisdn.filter
# 6pm to 8am is 'economy rate' - 3p gets you at least 1m30s
restrict 18:00:00 23:59:59 1-5 * *
impulse 80,0,0
include /etc/diald/alephisdn.filter
#at the weekend it's 'economy' all day
restrict 08:00:00 23:59:59 6,0 * *
impulse 80,0,0
include /etc/diald/alephisdn.filter
Wookey
--
Aleph One Ltd, Bottisham, CAMBRIDGE, CB5 9BA, UK Tel (00 44) 1223 811679
work: http://www.aleph1.co.uk/ play: http://www.chaos.org.uk/~wookey/
-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]