<div dir="ltr"><div class="gmail_quote">On Sun, Jan 17, 2010 at 15:09, Tzafrir Cohen <span dir="ltr">&lt;<a href="mailto:tzafrir@cohens.org.il">tzafrir@cohens.org.il</a>&gt;</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>
&gt; On Sun, Jan 17, 2010 at 12:44, Tzafrir Cohen &lt;<a href="mailto:tzafrir@cohens.org.il">tzafrir@cohens.org.il</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; On Sun, Jan 17, 2010 at 07:01:57AM +0200, geoffrey mendelson wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Jan 17, 2010, at 2:29 AM, Tzafrir Cohen wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&gt; On Sat, Jan 16, 2010 at 08:05:51PM +0200, ik wrote:<br>
&gt; &gt; &gt;&gt;&gt; You can use libhdate with some AGI and set variable to calculate<br>
&gt; &gt; &gt;&gt;&gt; shabat per<br>
&gt; &gt; &gt;&gt;&gt; place and day.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; This is relatively quite expensive. Maybe a qeekly cron to update a<br>
&gt; &gt; &gt;&gt; relevant GotoIfTime line in the dialplan?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Actually I&#39;m quite happy with picking up the phone and entering an<br>
&gt; &gt; &gt; extension number that puts the system into shabbat mode, and doing the<br>
&gt; &gt; &gt; opposite motzi shabbat. What I am looking for is a way of setting a<br>
&gt; &gt; &gt; presistent variable, so that it knows it is in shabbat mode, and I can<br>
&gt; &gt; &gt; easily check it in a dial plan.<br>
&gt; &gt;<br>
&gt; &gt; Normally the astdb is used for such persistant variables.<br>
&gt; &gt;<br>
&gt; &gt; To set:<br>
&gt; &gt;<br>
&gt; &gt;  Set(${DB(flags/shabat)=1)<br>
&gt; &gt;<br>
&gt; &gt; To reset:<br>
&gt; &gt;<br>
&gt; &gt;  DbDel(flags/shabat)<br>
&gt; &gt;<br>
&gt; &gt; To test in the dialplan: the function DB_EXISTS:<br>
&gt; &gt;<br>
&gt; &gt;  GotoIf($[${DB_EXISTS(flags/shabat)}]:context-for-shabat)<br>
&gt; &gt;<br>
&gt;<br>
&gt;<br>
&gt; But that&#39;s have to be updated every week, or every X amount of time.<br>
&gt; You can&#39;t automate Berkly insert/update without any AGI/AMI running at least<br>
&gt; once, unless you know something I do not know.<br>
<br>
</div></div>Sure you can:<br>
<br>
  asterisk -rx &#39;database put flags shabat 1&#39;<br>
  asterisk -rx &#39;database del flags shabat&#39;<br>
<br>
Run from cron at a time of your choosing.<br>
<br>
Likewise for global variables:<br>
<br>
  asterisk -rx &#39;dialplan global set IS_SHABAT 1&#39;<br>
<br>
(In asterisk 1.4 it was &#39;core global ...&#39;)<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&#39;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&#39;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>