<div>On 7/3/07, Farooq Ahmed &lt;<a href="mailto:fahmed@tpg.com.au">fahmed@tpg.com.au</a>&gt; wrote:<br>&gt; Hi all,<br>&gt; As we know we can configure in astersik like before 5:00pm calls go to reception and after 5:00<br>
&gt; pm calls go to some mobile no. One of my client requested that he wants to manually shift the dial<br>&gt; plan&nbsp;&nbsp;like above as he has flexiable timing sometime he finishes at 3:00pm some time 8pm. I can<br>&gt; not give him freepbx&nbsp;&nbsp;access.
<br>&gt; Any idea or solution.<br>&gt; Regards<br>&gt; Farooq<br>&gt; --<br><br>Set up a speeddial button on the phone.&nbsp;&nbsp;This extension will simply write a value to the asterisk db.<br><br>I have some other modifications done, but here is me actual extension:
<br><br>; Night Mode Activations<br>exten =&gt; 799,hint,DS/mmgc<br>exten =&gt; 799,1,Macro(open-close,mmgc,custom/moore-moore-now-open,custom/moore-moore-now-closed)<br>exten =&gt; 799,n,Playback(beep)<br>exten =&gt; 799,n,Hangup
<br><br>[macro-open-close]<br>exten =&gt; s,1,DBGet(nightmode=nightmode/${ARG1})<br>exten =&gt; s,n,NoOp(ARG1 ${ARG1} ARG2 ${ARG2} ARG3 ${ARG3})<br>exten =&gt; s,n,Set(OpenFile=${ARG2})<br>exten =&gt; s,n,Set(CloseFile=${ARG3})
<br>exten =&gt; s,n,NoOp(Close file ${CloseFile}. Open file ${OpenFile}.)<br>exten =&gt; s,n,GotoIf(${nightmode}=1?s,Open:s,Close)<br>exten =&gt; s,n(Open),DBPut(nightmode/${ARG1}=0)<br>exten =&gt; s,n,Devstate(${ARG1},0)
<br>exten =&gt; s,n,Playback(${OpenFile})<br>exten =&gt; s,n,Goto(Return)<br>exten =&gt; s,n(Close),DBPut(nightmode/${ARG1}=1)<br>exten =&gt; s,n,Devstate(${ARG1},2)<br>exten =&gt; s,n,Playback(${CloseFile})<br>exten =&gt; s,n(Return),NoOp
<br>&nbsp;</div>
<div>It&#39;s a little ugly, but it works.&nbsp; Basically, the basics of it is that it inserts a 1 into the nightmode database when it is closed.&nbsp; Your IVR script needs to check this database entry, if it is 1, it goes to the closed script, if it is 0 it goes to open.
</div>
<div>&nbsp;</div>
<div>The DS refers to DeviceState.&nbsp; I have this patch on my system.&nbsp; Using this, it will turn the light on when on night mode and turn it off when open.&nbsp; I may end up switching entirely to this instead of time based, or rather having our system set up so that our receptionist has to tell the system when she gets to work (if she happens to come in that day, be careful hiring family members).
</div>
<div>This should at least get you started.&nbsp; </div>
<div>&nbsp;</div>
<div>One other thought, you could even set this up to open and close remotely.&nbsp; You would dial in to the system, then enter the extension number.&nbsp; In that case, you might want to make use of some type of authentication.&nbsp; Off the top of my head, I can&#39;t remember the app that does this, but it is simple to setup.&nbsp; It would require you to dial your system, enter the extension, then enter a code.&nbsp; By doing this, you can make sure that only you can open and close the system.
</div>
<div>&nbsp;</div>
<div><br><br><br><br><br>-- <br>Lacy Moore<br>Somewhere I wish I wasn&#39;t<br>&nbsp;</div>