[asterisk-users] Changing contexts "on the fly"

Tzafrir Cohen tzafrir.cohen at xorcom.com
Fri Sep 28 11:41:22 CDT 2007


On Fri, Sep 28, 2007 at 05:28:21PM +0100, Ade Vickers wrote:
> Hi folks,
> 
> I've been playing around with an Asterisk server in my office for a few
> weeks now, and I've got it pretty much nailed down the way I want it, which
> is nice.
> 
> One of the features I'm using is the ability to switch different contexts in
> & out of the dialplan on a schedule. So, for example, I've got the
> "official" tel number ringing my desk phone between 9.00-17.30 mon-fri; and
> out of those hours any caller gets a recorded message + sent to voicemail.
> 
> However, I'm quite often working later than 17.30, and would quite like to
> be able to easily "flick a switch" which tells Asterisk that, actually, I'm
> here in the office, and I'd quite like to receive calls. Currently, I have
> to alter dialplans.conf, comment out a couple of lines & uncomment another;
> save & then re-load the dialplan.
> 
> I'm guessing I've got 3 options open to me:
> 
> 1) Convert from using the various .conf files, to using a "realtime" config,
> then write a small front-end to the DB so I can access the settings from a
> simple switch on my Windows desktop
> 2) Write some kind of script which I can execute on the Asterisk box which
> makes the same changes I'm currently making manually
> 3) Some other option I've not thought of...

Read the relevant data from a global varaible or from the database in
the dialplan. You can set db entries and/or global variables in various
ways.

4) Use a condional dialplan. e.g GotoIfTime or other uses of GotoIf .

In fact, GotoIfTime seems to be the exact "switch flipper" you need.

-- 
               Tzafrir Cohen       
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list