[Asterisk-Users] Change include contexts runtime

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Sep 1 20:05:00 MST 2003


On Monday 01 September 2003 03:51, Mickey Binder wrote:
> How do I change the dialplan runtime, if I for example wants all
> calls on the main number to be answered by a voicemail (when it is
> out-of-office hours).
> I want to be able to change the configuration by pressing a DTMF
> combination e.g. *82. Can't figure out whether it is necessary to
> change contexts or how to do it.
>
> I have read a lot of examples and config documentation, but I can't
> figure out how to do it.
>
> I know there are commands from the CLI to include and not include
> contexts but I can't get them to work.
> If i write 'include context in default' I can see by 'show dialplan'
> that 'context' is included in default. But if I want to include a
> context named office by typing 'include office in default' I just get
> 'No such command 'include office' (type 'help for help)

Use the DB routines and GotoIf.  Example:

exten => 999,1,DBPut(mystore/isopen=1)
exten => *82,1,DBPut(mystore/isopen=0)
exten => s,1,DBGet(amiopen=mystore/isopen)
exten => s,2,GotoIf($[${amiopen} = 0]?closed|s|1)

Obviously, you'll want to put the extensions that turn the system on and
off in a context which is not referenced by incoming calls.

-Tilghman




More information about the asterisk-users mailing list