[asterisk-users] Read Voicmail Boxes
Anselm Martin Hoffmeister
anselm at hoffmeister-online.de
Mon Jan 15 14:51:50 MST 2007
Am Montag, den 15.01.2007, 13:38 -0700 schrieb Andrew Niemantsverdriet:
> If you would bother to read my post you will see that what I am
> wanting to do is not the asterisk directory cmd. I don't want them to
> be able to search or anything fancy like that. I want an app that will
> go through and say the recorded name for everyone that has a mailbox
> one by one. I did search but was not able to find anything that can do
> what I want.
>
> As far as the English class goes; please be more careful about reading
> posts and trying to understand exactly what is being asked before you
> flame me for not searching.
I have to admit I just scanned over your first post and did
misunderstand it exactly the same way. Hey, there are lots of non-native
speakers around here. No reason for flames though.
I prefer having a productive-to-rant ratio somewhere above 1. So here
comes what I would do:
Write an AGI that walks
through /var/spool/asterisk/voicemail/${YOURCONTEXT}, reads all
directories, and for those directories that contain a file "greet.wav",
say the directory name (which most probably is a number, and if you did
reasonably choose voicemail numbers, the phone number is at least
similar to the voicemail number) and playback the greet file.
Here comes what works for me (yeah, I hacked that together just a minute
ago):
/etc/asterisk/extensions.conf:
exten => 411,1,Answer
exten => 411,2,Wait(1)
exten => 411,3,Playback(my-sounds/announcement-for-directory)
exten => 411,4,AGI(vmaildirectory)
exten => 411,5,Playback(my-sounds/now-you-know-the-full-story)
exten => 411,6,Hangup
/usr/share/asterisk/agi-bin/vmaildirectory:
#!/bin/bash
sleep 1
for A in /var/spool/asterisk/voicemail/default/[0-9][0-9][0-9]/greet.wav
do
echo "EXEC Playback my-sounds/user"
echo "EXEC Playback "${A:0:47}
echo "EXEC Playback my-sounds/is-at-extension"
echo "EXEC SayNumber "${A:38:3}
sleep 1
done
(and set the execute flag yadayada).
HTH
Anselm
More information about the asterisk-users
mailing list