Asterisk Recorder

Comment on Asterisk tips phrase recording menu
jbrings
Joined: Mon 21 of Nov, 2005

Asterisk Recorder

Posted:Mon 21 of Nov, 2005 (10:29 UTC)
Based on the above phrase manager example I created a more complete recorder..

First steps:

1. Create following directories:

/var/lib/asterisk/sounds/recorder/
/var/lib/asterisk/sounds/recorder/recordings/

2. Record following prompts, name accordingly and copy into :/var/lib/asterisk/sounds/recorder/


recorder-welcome:Welcome to Asterisk Recorder.
recorder-enter-recording-number:Please enter the the recording number you wish to administer followed by #
recorder-record-after-beep:Please start recordings after the beep to finish press#
recorder-current-recording:The current recording is...
recorder-menu:Press 1 to Accept, Press 2 to review, Press 3 to re-record
recorder-autoreview:Your recording result is ...
recorder-invalid-option:I'm sorry but that is not a valid entry

3. Add following code to your extensions,conf or extensions_custom.conf replacing the example extension "604" with your own if desired.

4. This example records files in wav format. if you wish to record in gsm then just change:

exten => 3,3,Record(/var/lib/asterisk/sounds/recorder/recordings/${PHRASEID}:wav)

to

exten => 3,3,Record(/var/lib/asterisk/sounds/recorder/recordings/${PHRASEID}:gsm)

5. Hope this post is sueful to someone out there.


;###################################
;###   Asterisk Recorder   ###
;###################################

exten => 604,1,Goto(recorder-menu,s,1) 

[recorder-menu] 
exten => s,1,Answer; Answer the line
exten => s,2,DigitTimeout,5; Set Digit Timeout to 5 seconds
exten => s,3,ResponseTimeout,10; Set Response Timeout to 10 seconds
exten => s,4,Playback(/var/lib/asterisk/sounds/recorder/recorder-welcome); Play Asterisk Recorder Welcome.
exten => s,5,Read(PHRASEID|/var/lib/asterisk/sounds/recorder/recorder-enter-recording-number); Please enter the the prompt number you wish to admimister followed by #
exten => s,6,Wait(1)
exten => s,7,Playback(/var/lib/asterisk/sounds/recorder/recorder-current-recording)
exten => s,8,Wait(1)
exten => s,9,Playback(/var/lib/asterisk/sounds/recorder/recordings/${PHRASEID})
exten => s,10,Wait(1)
exten => s,11,BackGround(/var/lib/asterisk/sounds/recorder/recorder-menu); Press 1 to Accept, Press 2 to review, Press 3 to re-record

;### Recording Accept ###

exten => 1,1,Goto(s,5)

;### Recording review ### 
exten => 2,1,Wait(1)
exten => 2,2,Playback(/var/lib/asterisk/sounds/recorder/recorder-current-recording)
exten => 2,3,Playback(/var/lib/asterisk/sounds/recorder/recordings/${PHRASEID})
exten => 2,4,Wait(1)
exten => 2,5,Goto(s,11)

;### To re-record recording press 3 ###

exten => 3,1,Playback(/var/lib/asterisk/sounds/recorder/recorder-record-after-beep); Please start recordings after the beep to finish press#
exten => 3,2,Wait(1); give yourself a moment to take a breath and wait for beep 
exten => 3,3,Record(/var/lib/asterisk/sounds/recorder/recordings/${PHRASEID}:wav)
exten => 3,4,Wait(1)
exten => 3,5,Playback(/var/lib/asterisk/sounds/recorder/recorder-autoreview)
exten => 3,6,Wait(1)
exten => 3,7,Playback(/var/lib/asterisk/sounds/recorder/recordings/${PHRASEID})
exten => 3,8,Wait(1)
exten => 3,9,Goto(s,11)

exten => t,1,Hangup
exten => i,1,Playback(/var/lib/asterisk/sounds/recorder/recorder-invalid-option)
exten => i,2,Goto(s,2)