[asterisk-users] Need Advice/Suggestion

Lacy Moore - Aspendora aspendora at gmail.com
Tue Jul 3 07:38:57 CDT 2007


On 7/3/07, Farooq Ahmed <fahmed at tpg.com.au> wrote:
> Hi all,
> As we know we can configure in astersik like before 5:00pm calls go to
reception and after 5:00
> pm calls go to some mobile no. One of my client requested that he wants to
manually shift the dial
> plan  like above as he has flexiable timing sometime he finishes at 3:00pm
some time 8pm. I can
> not give him freepbx  access.
> Any idea or solution.
> Regards
> Farooq
> --

Set up a speeddial button on the phone.  This extension will simply write a
value to the asterisk db.

I have some other modifications done, but here is me actual extension:

; Night Mode Activations
exten => 799,hint,DS/mmgc
exten =>
799,1,Macro(open-close,mmgc,custom/moore-moore-now-open,custom/moore-moore-now-closed)
exten => 799,n,Playback(beep)
exten => 799,n,Hangup

[macro-open-close]
exten => s,1,DBGet(nightmode=nightmode/${ARG1})
exten => s,n,NoOp(ARG1 ${ARG1} ARG2 ${ARG2} ARG3 ${ARG3})
exten => s,n,Set(OpenFile=${ARG2})
exten => s,n,Set(CloseFile=${ARG3})
exten => s,n,NoOp(Close file ${CloseFile}. Open file ${OpenFile}.)
exten => s,n,GotoIf(${nightmode}=1?s,Open:s,Close)
exten => s,n(Open),DBPut(nightmode/${ARG1}=0)
exten => s,n,Devstate(${ARG1},0)
exten => s,n,Playback(${OpenFile})
exten => s,n,Goto(Return)
exten => s,n(Close),DBPut(nightmode/${ARG1}=1)
exten => s,n,Devstate(${ARG1},2)
exten => s,n,Playback(${CloseFile})
exten => s,n(Return),NoOp

It's a little ugly, but it works.  Basically, the basics of it is that it
inserts a 1 into the nightmode database when it is closed.  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.

The DS refers to DeviceState.  I have this patch on my system.  Using this,
it will turn the light on when on night mode and turn it off when open.  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).
This should at least get you started.

One other thought, you could even set this up to open and close remotely.
You would dial in to the system, then enter the extension number.  In that
case, you might want to make use of some type of authentication.  Off the
top of my head, I can't remember the app that does this, but it is simple to
setup.  It would require you to dial your system, enter the extension, then
enter a code.  By doing this, you can make sure that only you can open and
close the system.






-- 
Lacy Moore
Somewhere I wish I wasn't
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070703/6b2a11d3/attachment.htm 


More information about the asterisk-users mailing list