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