On Sun, Jan 17, 2010 at 15:09, Tzafrir Cohen <tzaf...@cohens.org.il> wrote:
> On Sun, Jan 17, 2010 at 01:17:53PM +0200, ik wrote: > > On Sun, Jan 17, 2010 at 12:44, Tzafrir Cohen <tzaf...@cohens.org.il> > wrote: > > > > > On Sun, Jan 17, 2010 at 07:01:57AM +0200, geoffrey mendelson wrote: > > > > > > > > On Jan 17, 2010, at 2:29 AM, Tzafrir Cohen wrote: > > > > > > > >> On Sat, Jan 16, 2010 at 08:05:51PM +0200, ik wrote: > > > >>> You can use libhdate with some AGI and set variable to calculate > > > >>> shabat per > > > >>> place and day. > > > >> > > > >> This is relatively quite expensive. Maybe a qeekly cron to update a > > > >> relevant GotoIfTime line in the dialplan? > > > > > > > > > > > > > > > > Actually I'm quite happy with picking up the phone and entering an > > > > extension number that puts the system into shabbat mode, and doing > the > > > > opposite motzi shabbat. What I am looking for is a way of setting a > > > > presistent variable, so that it knows it is in shabbat mode, and I > can > > > > easily check it in a dial plan. > > > > > > Normally the astdb is used for such persistant variables. > > > > > > To set: > > > > > > Set(${DB(flags/shabat)=1) > > > > > > To reset: > > > > > > DbDel(flags/shabat) > > > > > > To test in the dialplan: the function DB_EXISTS: > > > > > > GotoIf($[${DB_EXISTS(flags/shabat)}]:context-for-shabat) > > > > > > > > > But that's have to be updated every week, or every X amount of time. > > You can't automate Berkly insert/update without any AGI/AMI running at > least > > once, unless you know something I do not know. > > Sure you can: > > asterisk -rx 'database put flags shabat 1' > asterisk -rx 'database del flags shabat' > > Run from cron at a time of your choosing. > > Likewise for global variables: > > asterisk -rx 'dialplan global set IS_SHABAT 1' > > (In asterisk 1.4 it was 'core global ...') > > But for that you need to know when is the shabat enter a specific location, so you need extra program for it (even if it's pure bash), to calculate the exact time it started. I think that the berkley should have the exact time and date for each week for that. I agree that you can execute it like so, but it requires a bit more work then what you are pointing out imho. > > -- > Tzafrir Cohen | tzaf...@jabber.org | VIM is > http://tzafrir.org.il | | a Mutt's > tzaf...@cohens.org.il | | best > ICQ# 16849754 | | friend > > _______________________________________________ > Linux-il mailing list > Linux-il@cs.huji.ac.il > http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il > Ido http://ik.homelinux.org/
_______________________________________________ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il