[asterisk-users] Creating a Voicemail ...

Russell Bryant russell at digium.com
Sun Jul 1 15:53:02 CDT 2007


Gordon Henderson wrote:
> So what I want is something like:
> 
>    exten => action,n,VoiceMailStore (mailbox at context,filename)

There is no easy way to do this.  As you already mentioned, one hack would be to 
manually create the files in the mailbox.  However, I think you may be able to 
pull this off another way.  I wonder if something like this would work.  This is 
completely untested.  I am just throwing out an idea.  :)


1) Put this in your dialplan.

[messages]

; Wait for 2 seconds of silence to ensure the voicemail
; greeting is done playing, so we can play the message.
exten => lighton,1,WaitForSilence(2000)
exten => lighton,n,Playback(light-is-on)
exten => lighton,n,Hangup


2) When you want to automatically leave a voicemail for someone, create this 
call file from the dialplan and drop it in /var/spool/asterisk/outgoing with the 
appropriate mailbox and voicemail context set.

Channel: Local/lighton at messages
Application: Voicemail
Data: <mailbox>[@context]|us


-- 
Russell Bryant
Software Engineer
Digium, Inc.



More information about the asterisk-users mailing list