[asterisk-users] Voicemail post-processing

Alex Balashov abalashov at evaristesys.com
Thu Feb 5 16:30:08 CST 2009


I would replace the call to Voicemail() with your own recording and 
generate a unique filename with a call to a script.  Use Record(). 
Then, when the message is done, call another script to rename the file 
to something that has a word like "COMPLETE" in the filename.

So, for example, assign recordings a name like VM-132456-timestamp.ulaw. 
  Then, when the recording is done, rename VM-123456-timestamp.ulaw to 
VM-123456-timestamp-COMPLETE.ulaw.  Have your script only catch that.

Be sure to catch a premature hangup event (while Record() is happening) 
with the 'h' extension.

Then call another script to attach and email the file to the right place.

It's sort of a kludgy hack, but it gets you what you want.

Adam Robins wrote:

> I have an application where a caller leaves a voicemail message and then
> I need to gpg encrypt the file before emailing it.
> 
> I wrote a perl script to do this, which is executed after a message is
> left, using the externnotify feature in voicemail.conf.
> 
> My script has no knowledge of the name of the voicemail wav file created
> by Asterisk (msg000x.wav). So, I retrieve a list of all files in the
> directory and then process all the ones I find.  The problem is that if
> another caller is leaving a message at the same time, I am inadvertently
> pulling that file too, and end up emailing it as a corrupt wav file.
> 
> Even if I call the script from the dialplan (at the hangup priority)
> instead of using externnotify, I think I would face the same issue
> because I cannot control the naming of the voicemail wav file.  If I
> could select the name of the file to be written, or query the
> Asterisk-selected name as a system variable after the VoiceMail command
> is executed, I'd be ok.
> 
> Any suggestions are appreciated.  Thanks.
> 
> 
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users


-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775



More information about the asterisk-users mailing list