[asterisk-users] dialplan announcements
Doug Lytle
support at drdos.info
Fri Feb 11 11:47:57 CST 2011
ERIC HERRON wrote:
> The conditions are that I want the recorder to dial a feature code
> that prompts him to record the message. He then presses 1 to accept.
> This gets saved as announcement.wav.
You'll need to supply some of your own audio prompts, I recorded my own,
here is the code I have:
[recordings]
;****************************
;* Voice Prompt recording menu
;****************************
exten => 50*,1,Set(COUNT=0)
exten => 50*,n,Playback(local/extension-recording-menu)
exten => 50*,n,Playback(local/please-record-msg)
exten => 50*,n,Record(mymessage:gsm|5|60)
exten => 50*,n,Playback(local/you-said)
exten => 50*,n,Playback(mymessage)
;**************************
;* Press 1 to continue or
;* 2 to change your message
;**************************
exten => 50*,n,Background(local/press1-or-2)
exten => 50*,n,Set(TIMEOUT(digit)=2)
exten => 50*,n,WaitExten(5)
exten => 1,1,System(/bin/mv /var/lib/asterisk/sounds/mymessage.gsm
/var/lib/asterisk/sounds/local/`date +%s`.gsm)
exten => 1,2,Playback(local/recording-saved)
exten => 1,3,Background(local/press3-torecord-4tohang)
exten => 2,1,Goto(recordings,50*,4)
exten => 3,1,Goto(recordings,50*,4)
exten => 4,1,Playback(vm-goodbye)
exten => 4,2,Hangup()
exten => t,1,GotoIf($[ ${COUNT} > 2 ]?4,1)
exten => t,n,Playback(local/sorry-didnot-getthat)
exten => t,n,Set(COUNT=$[${COUNT} + 1])
exten => t,n,Goto(recordings,50*,8)
exten => i,1,Playback(local/sorry-invalid-choice)
exten => i,2,Goto(recordings,50*,4)
Doug
--
Ben Franklin quote:
"Those who would give up Essential Liberty to purchase a little Temporary Safety, deserve neither Liberty nor Safety."
More information about the asterisk-users
mailing list