[Asterisk-Users] Checking for a sound file

Adam Goryachev mailinglists at websitemanagers.com.au
Tue Apr 26 19:02:08 MST 2005


On Tue, 2005-04-26 at 17:51 -0500, Andy Hamilton wrote:
> Marc:
> 
> You may be able to do this with voicemail; you'd get the
> authentication, realtime outbound message alteration, etc.
> You would just have the DID support number go straight to voicemail.
> The only think left would be to see if there's a way to not permit a
> message to be left.

Good suggestion, other option is with something like this:

exten => 5551234,1,Background(local/outage)
exten => 5551234,2,Hangup
exten => 1234,1,Authenticate(4321)  ;Check usage of authenticate,
something like that...
exten => 1234,2,Record(local/outage)
exten => 1234,3,Background(local/outage) ; Allow to listen to what you
just recorded, and dial 1234 to re-record it
exten => 1234,4,Hangup
exten => 1234,102,Playback(vm-failed) ; or something
exten => 1234,103,Hangup

When you dial 5551234, you start to hear the message, then you press
1234, and enter you code 4321, and record your new message.

Also see this snippet I use to record all my prompts:
[recordings]
exten => s,1,Festival,Please record your message
exten => s,2,Playback(beep)
exten => s,3,Record,mymessage:gsm
exten => s,4,Festival,You said
exten => s,5,Background(mymessage)
exten => s,6,Playback(beep)
exten => s,7,Festival,Press 1 to continue or 2 to change your message
exten => s,8,DigitTimeout,3

exten => t,1,Festival,Sorry, I did not get that
exten => t,2,Goto,s|5

exten => i,1,Festival,Sorry, that is an invalid choice
exten => i,2,Goto,s|7

exten =>
1,1,System,/bin/mv /var/lib/asterisk/sounds/mymessage.gsm /var/lib/asterisk/sounds/local/`date +%s`.gsm
exten => 1,2,Festival,Thank you, your recording has been saved.
exten => 1,3,Festival,Press 3 to record another file or 4 to hang up

exten => 2,1,Goto,s|2
exten => 3,1,Goto,s|1
exten => 4,1,Hangup


Just adjust the mv command to name it local/outage.gsm instead ...

Regards,
Adam
-- 
 -- 
Adam Goryachev
Website Managers
Ph:  +61 2 8304 0000                        adam at websitemanagers.com.au
Fax: +61 2 9345 4396                        www.websitemanagers.com.au




More information about the asterisk-users mailing list