<div class="gmail_quote">On Mon, Mar 21, 2011 at 8:05 PM, Harel Cohen <span dir="ltr">&lt;<a href="mailto:harel@easycall.gi">harel@easycall.gi</a>&gt;</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: &quot;Cambria&quot;,&quot;serif&quot;; color: rgb(0, 0, 102);">Hello List,</span></p><p class="MsoNormal"><span style="font-family: &quot;Cambria&quot;,&quot;serif&quot;; 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: &quot;Cambria&quot;,&quot;serif&quot;; 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 &quot;vm-intro&quot;&#39;s and any pre-recorded messages.  <br>
<br>Quick, off the top of my head example:<br><br>[default]<br>exten =&gt; _X.,1,Verbose(Incoming call - battlestations!)<br>exten =&gt; _X.,n,Answer()<br>exten =&gt; _X.,n,Dial(SIP/${EXTEN},30)<br>exten =&gt; _X.,n,Verbose(No one answered - going to voicemail)<br>
exten =&gt; _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 =&gt; s,1,Verbose(Checking time conditions to play proper voicemail)<br>exten =&gt; s,n,Verbose(First check holidays)<br>
exten =&gt; s,n,GotoIfTime(*,*,25,dec?holiday,1) ; Christmas, add your own here<br>exten =&gt; s,n,Verbose(Not a holiday - so checking time of day)<br>exten =&gt; s,n,GotoIfTime(08:00-18:00,mon-fri,*,*?officehours,1)<br>exten =&gt; s,n,Verbose(Time condition check failed - playing after-hours message)<br>
exten =&gt; s,n,Goto(afterhours,1)<br><br>; holiday voicemail greeting<br>exten =&gt; holiday,1,Verbose(Playing holiday greeting)<br>exten =&gt; holiday,n,Playback(holiday-greeting)<br>exten =&gt; holiday,n,Voicemail(defaultmailbox@default,s)<br>
exten =&gt; holiday,n,Hangup()<br><br>; officehours voicemail greeting<br>exten =&gt; officehours,1,Verbose(Playing officehours greeting)<br>exten =&gt; officehours,n,Playback(officehours-greeting)<br>exten =&gt; officehours,n,Voicemail(defaultmailbox@default,s)<br>
exten =&gt; officehours,n,Hangup()<br><br>; afterhours voicemail greeting<br>exten =&gt; afterhours,1,Verbose(Playing afterhours greeting)<br>exten =&gt; afterhours,n,Playback(afterhours-greeting)<br>exten =&gt; afterhours,n,Voicemail(defaultmailbox@default,s)<br>
exten =&gt; 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>