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

Danny Nicholas danny at debsinc.com
Mon Feb 8 11:51:06 CST 2010


Thomas, you are the OP - Original Poster - that is "technical lingo"; as for
the script you submitted, here are a few of the problems;
exten => 621,1,Answer()
exten => 621,n,Read(NUMBER,enteryournumberstartingwithaone,12,,5)
** the above name is very wordy and could be replaced with the standard
"enter-phone-number10" (in quotes because of outlook)
; create a variable from a DTMF entry / 12 characters long
exten => 621,n,System{(/tmp touch($NUMBER)}
** you don't need to create the file, Record will do that **
; 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)}
** See error #2 **
; create a file
exten => 621,n,Record(${audioscript})
** this would have to be
exten => 621,n,Record(${audioscript}.gsm)
**
; record a file based on the NUMBER + 1
exten => 621,n,Playback(audioscript)
** audioscript would be a "fixed name" like
/var/lib/asterisk/sounds/audioscript.gsm - correct would be
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)
** same error as above - "correct" is 
exten => 621,n,System(mv ${audioscript}.gsm /var/lib/asterisk/sounds/en)
**
; move the recording to the sounds directory
exten => 621,n,Goto(${audioscript},1)
** the below should be googled for a correct solution - perhaps
voip-info.org ?? **
; 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
--
Danny Nicholas
--

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Thomas Perron
Sent: Monday, February 08, 2010 11:04 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] IVR Demo / Create file / Move file / Demo all

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

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list