I would like to manipulate phone call direction to voicemail for lunch, after hours etc, but am unsure how to do this. Could someone point me to a howto or quickly explain the concept? Thanks Neri -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20051102/87dfc911/attachment.htm
I just went through the same thing. I settled on the GoToIfTime application. One strange thing about GoToIfTime is that it doesn't allow an "else" argument, so you'll need a sequence of if's to get things done. try something along these lines: [yourcontext] ;lunchtime exten => s,1,GoToIfTime(12:00-13:00?yourcontext|LUNCH|1) ;after work exten => s,2,GoToIfTime(17:00-23:59?yourcontext|CLOSED|1) ;before work exten => s,3,GoToIfTime(00:00-07:59?yourcontext|CLOSED|1) ;if we got this far, must be we're open exten => s,4,GoTo(yourcontext|OPEN|1) ;;Handle lunchtime calls exten => LUNCH,1,[do something] exten => CLOSED,1,[do soemthing else] exten => OPEN,1,[do yet another thing] Rene Nelson wrote:> I would like to manipulate phone call direction to voicemail for > lunch, after hours etc, but am unsure how to do this. Could someone > point me to a howto or quickly explain the concept? > > Thanks > > Neri > >------------------------------------------------------------------------ > >_______________________________________________ >--Bandwidth and Colocation sponsored by Easynews.com -- > >Asterisk-Users mailing list >Asterisk-Users@lists.digium.com >http://lists.digium.com/mailman/listinfo/asterisk-users >To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
> I would like to manipulate phone call direction to voicemail for lunch, > after hours etc, but am unsure how to do this. Could someone point me to a > howto or quickly explain the concept?I would recommend checking a database value over the time based GoToIfTime unless you are always go to and return from lunch at EXACTLY the same time: put a value like OutToLunch=1 in the asterisk database (see dbput) write an extension to make this either 1 or 0 (using dbput) add two lines to incoming calls to forward them to Vmail IF the flag is set (using dbget and gotoif) the only problem then becomes remembering to set the falg BACK to 0 so the phone rings again :)
Rene Nelson wrote:> I would like to manipulate phone call direction to voicemail for > lunch, after hours etc, but am unsure how to do this. Could someone > point me to a howto or quickly explain the concept?include => atlunchcontext|11:00-11:59|mon-fri|* include => notatlunchcontext|09:00-10:59|mon-fri|* include => notatlunchcontext|12:00-18:00|mon-fri|* include => afterhourscontext|18:01--8:59|mon-fri|* Use something like that. Kyle
Rene Nelson wrote:> I would like to manipulate phone call direction to voicemail for lunch, > after hours etc, but am unsure how to do this. Could someone point me > to a howto or quickly explain the concept? > > Thanks > > Neri >Hi Neri, The command GotoIfTime() if your answer here. See http://www.voip-info.org/wiki-Asterisk+cmd+GotoIfTime for more info. Now, assuming we are talking about a situation with say one main voicemail extension to collect messages from callers calling the main company number.... ....The call comes in....then do a gotoiftime to branch to two places: first place is normal, second place is "lunchtime". Now, for each of these, first play an appropriate message with the Playback command, then record the message left using the voicemail command with the "s" option. The s option means "play nothing", so basically you aren't using the built-in outgoing messages that the voicemail system has and instead will have first used some custom message via the playback function e.g. exten => 4321,111,Playback(lunchtime) exten => 4321,112,voicemail,s12345 where 12345 is your "main" voicemail box. 4321 and 111/112 are also just numbers picked at random for use in this example. See http://www.voip-info.org/wiki-Asterisk+cmd+Voicemail for more info on using voicemail in this way. Faris.