Harel Cohen
2011-Mar-22 01:05 UTC
[asterisk-users] Play different voice-mail messages based on certain conditions
Hello List, I have few installations out there based on 1.6.1 or above. 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. I've tried to configure context for each case and set the directoryintro in each such context however the Asterisk was always looking for vm-intro and it was always looking for it in /var/lib/asterisk/sounds/en/. Is it possible to select different vm message based on certain conditions? I know I can play file with Playback() and then play empty vm-intro and I can also mess around with renaming files using System() however I was hoping there is a straight forward way rather than work-around. Thank you... Harel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110322/966d70d9/attachment.htm>
Warren Selby
2011-Mar-22 01:37 UTC
[asterisk-users] Play different voice-mail messages based on certain conditions
On Mon, Mar 21, 2011 at 8:05 PM, Harel Cohen <harel at easycall.gi> wrote:> Hello List, > > I have few installations out there based on 1.6.1 or above. > > 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. > >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. Quick, off the top of my head example: [default] exten => _X.,1,Verbose(Incoming call - battlestations!) exten => _X.,n,Answer() exten => _X.,n,Dial(SIP/${EXTEN},30) exten => _X.,n,Verbose(No one answered - going to voicemail) exten => _X.,n,Goto(no-answer,s,1) [no-answer] ; no one answered, play voicemail based on time of day / day of year exten => s,1,Verbose(Checking time conditions to play proper voicemail) exten => s,n,Verbose(First check holidays) exten => s,n,GotoIfTime(*,*,25,dec?holiday,1) ; Christmas, add your own here exten => s,n,Verbose(Not a holiday - so checking time of day) exten => s,n,GotoIfTime(08:00-18:00,mon-fri,*,*?officehours,1) exten => s,n,Verbose(Time condition check failed - playing after-hours message) exten => s,n,Goto(afterhours,1) ; holiday voicemail greeting exten => holiday,1,Verbose(Playing holiday greeting) exten => holiday,n,Playback(holiday-greeting) exten => holiday,n,Voicemail(defaultmailbox at default,s) exten => holiday,n,Hangup() ; officehours voicemail greeting exten => officehours,1,Verbose(Playing officehours greeting) exten => officehours,n,Playback(officehours-greeting) exten => officehours,n,Voicemail(defaultmailbox at default,s) exten => officehours,n,Hangup() ; afterhours voicemail greeting exten => afterhours,1,Verbose(Playing afterhours greeting) exten => afterhours,n,Playback(afterhours-greeting) exten => afterhours,n,Voicemail(defaultmailbox at default,s) exten => afterhours,n,Hangup() [1]: http://www.voip-info.org/wiki/view/Asterisk+cmd+GotoIfTime -- Thanks, --Warren Selby, dCAP http://www.selbytech.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110321/108873b5/attachment.htm>
Danny Nicholas
2011-Mar-22 14:36 UTC
[asterisk-users] Play different voice-mail messages based oncertain conditions
_____ From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Harel Cohen Sent: Monday, March 21, 2011 8:06 PM To: asterisk-users at lists.digium.com Subject: [asterisk-users] Play different voice-mail messages based oncertain conditions Hello List, I have few installations out there based on 1.6.1 or above. 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. I've tried to configure context for each case and set the directoryintro in each such context however the Asterisk was always looking for vm-intro and it was always looking for it in /var/lib/asterisk/sounds/en/. Is it possible to select different vm message based on certain conditions? I know I can play file with Playback() and then play empty vm-intro and I can also mess around with renaming files using System() however I was hoping there is a straight forward way rather than work-around. Thank you. Harel As you are aware, the default behaviour of the Voicemail application is that you are either (s) silent with/without playback for custom message (b) play busy message or (u) unavailable. My "clean workaround" for you would be to set up 3 mailboxes. Box 1 would be your "normal business hours" mailbox. Box 2 would be "after hours" and box 3 "holidays". Then you just use normal time functions to set which mailbox you hit and voila, you have 6 sets of messages. You could set up forwarding on boxes 2 and 3 to dump back to box 1 so you get your 6 message and 1 box. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110322/c36b2fa5/attachment.htm>