[Asterisk-Users] "night" mode ideas
Steven Critchfield
critch at basesys.com
Sun Nov 7 13:49:22 MST 2004
On Sun, 2004-11-07 at 12:30 -0800, Tom Lahti wrote:
> Hi all. I have a system I'm going to build that I have a pretty good idea
> how I'm going to accomplish this feature, but I was wondering if anyone had
> a better idea/method since mine seems somewhat "hackish" for some reason I
> can't explain :)
>
> The system wants to have different incoming call handling more-or-less
> based on time of day, but we don't want it to be at some precise UNIX time,
> but rather under human control, so if people stay late they can keep it in
> a more appropriate mode.
>
> What we're looking for is a way for someone on the system to pick up an
> extension and dial some code that changes the incoming call context, i.e.
> manually switching incoming call handling. We want incoming calls to ring
> extension X->Y->Z in one mode, ring only Z in a second mode, and only take
> voicemail in a 3rd mode. Th idea I came up with to solve this was to code
> a special extension for each mode that used Authenticate() and then
> System() to copy a different extensions.conf into place and restart
> Asterisk for each mode. Restarting seems a bit harsh since it will drop
> any calls in progress.
>
> There would also be a cron job that would swap modes if they hadn't been
> swapped by some time of day.
>
> Does this sound like a reasonable solution, or do any of the experts (ahem,
> not me) have a more elegant solution idea?
You can use a include based on time to get your failsafe instead of a
cron. Then you just need to use a global var that your extension logic
could manipulate and a gotoif based on that variable to either short
circuit the dialplan to the desired plan or just do a gotoif to get into
a new context that contains the proper logic.
--
Steven Critchfield <critch at basesys.com>
More information about the asterisk-users
mailing list