<div class="gmail_quote">On Mon, Mar 21, 2011 at 8:05 PM, Harel Cohen <span dir="ltr"><<a href="mailto:harel@easycall.gi">harel@easycall.gi</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-GB"><div><p class="MsoNormal"><span style="font-family: "Cambria","serif"; color: rgb(0, 0, 102);">Hello List,</span></p><p class="MsoNormal"><span style="font-family: "Cambria","serif"; color: rgb(0, 0, 102);">I have few installations out there based on 1.6.1 or above.</span></p>
<p class="MsoNormal"><span style="font-family: "Cambria","serif"; color: rgb(0, 0, 102);">I’m trying to play different voice mail messages based on certain criteria’s. For example, I want during office hours to play (in short): “we are not available to take your call, please leave a message”, during off-hours and weekends I would play: “we are closed, our opening hours xx:xx-yy:yy, please leave a message or send a fax or send an email” and during holidays I would play: “we are closed due to holiday, please leave a message, fax, blab la” etc.</span></p>
<br clear="all"></div></div></blockquote></div><br>What I have done for various clients in your situation is to create conditional contexts based on either time of day and day of year criteria (see GotoIfTime()[1]) and then use Playback() to play the correct voicemail greeting, then call the Voicemail() app with just the s option, which skips all "vm-intro"'s and any pre-recorded messages. <br>
<br>Quick, off the top of my head example:<br><br>[default]<br>exten => _X.,1,Verbose(Incoming call - battlestations!)<br>exten => _X.,n,Answer()<br>exten => _X.,n,Dial(SIP/${EXTEN},30)<br>exten => _X.,n,Verbose(No one answered - going to voicemail)<br>
exten => _X.,n,Goto(no-answer,s,1)<br><br>[no-answer]<br>; no one answered, play voicemail based on time of day / day of year<br>exten => s,1,Verbose(Checking time conditions to play proper voicemail)<br>exten => s,n,Verbose(First check holidays)<br>
exten => s,n,GotoIfTime(*,*,25,dec?holiday,1) ; Christmas, add your own here<br>exten => s,n,Verbose(Not a holiday - so checking time of day)<br>exten => s,n,GotoIfTime(08:00-18:00,mon-fri,*,*?officehours,1)<br>exten => s,n,Verbose(Time condition check failed - playing after-hours message)<br>
exten => s,n,Goto(afterhours,1)<br><br>; holiday voicemail greeting<br>exten => holiday,1,Verbose(Playing holiday greeting)<br>exten => holiday,n,Playback(holiday-greeting)<br>exten => holiday,n,Voicemail(defaultmailbox@default,s)<br>
exten => holiday,n,Hangup()<br><br>; officehours voicemail greeting<br>exten => officehours,1,Verbose(Playing officehours greeting)<br>exten => officehours,n,Playback(officehours-greeting)<br>exten => officehours,n,Voicemail(defaultmailbox@default,s)<br>
exten => officehours,n,Hangup()<br><br>; afterhours voicemail greeting<br>exten => afterhours,1,Verbose(Playing afterhours greeting)<br>exten => afterhours,n,Playback(afterhours-greeting)<br>exten => afterhours,n,Voicemail(defaultmailbox@default,s)<br>
exten => afterhours,n,Hangup()<br><br><br>[1]: <a href="http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIfTime">http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIfTime</a><br><br>-- <br>Thanks,<br>--Warren Selby, dCAP<br>
<a href="http://www.selbytech.com" target="_blank">http://www.selbytech.com</a><br>