[asterisk-users] IVR Demo / Create file / Move file / Demo all

Thomas Perron thomas.perron at gmail.com
Mon Feb 8 11:04:26 CST 2010


Do you see any syntax errors?
Positive comments welcomed.

The short version of the logic is as follows:

create a file based on the NUMBER
create a an audio file
move to a new extension (label) and play the results

exten => 621,1,Answer()
exten => 621,n,Read(NUMBER,enteryournumberstartingwithaone,12,,5)
 ; create a variable from a DTMF entry / 12 characters long
exten => 621,n,System{(/tmp touch($NUMBER)}
            ; create the file based on the variable entered
exten => 621,n,Set(audioscript=$[${NUMBER} + 1])
             ; set a channel variable in advance of recording to it
exten => 621,n,SayDigits(${NUMBER})
                  ; say the NUMBER that was entered
exten => 621,n,System{/tmp touch($(audioscript)}
                ; create a file
exten => 621,n,Record(${audioscript})
                       ; record a file based on the NUMBER + 1
exten => 621,n,Playback(audioscript)
                      ; listen to the recording - it changes for each
Demo
exten => 621,n,System(mv audioscript /var/lib/asterisk/sounds/en)
          ; move the recording to the sounds directory
exten => 621,n,Goto(${audioscript},1)
                        ; goto the label/alias to hear it all together
exten => audioscript,1,Answer()
                           ; Nothing
exten => audioscript,n,Playback(audioscript)
                   ; plays audioscript
exten => audioscript,n,Playback(staticIVR_sample)
            ; adds some boring IVR lingo
exten => audioscript,n,Hangup()
                       ; drops the call



More information about the asterisk-users mailing list