Hello,
I can’t figure out why Asterisk can’t find the sounds files it recorded to playback. I’ve run the script on another server (Asterisk 1.8-r332699) and it ran just fine. I’ve created the files on the new server, changed the permissions and the directory paths. I can’t see what I’m missing.
I appreciate any insights!
Dialplan —>
[main_menu]
exten => start, 1, Set(step1count=0)
same => n(greeting),Answer()
same => n, Background(/usr/share/asterisk/sounds/en/dp_greeting)
same => n(beginning), Background(/usr/share/asterisk/sounds/en/dp_mainMenu)
same => n, WaitExten(8)
exten => 1, 1, Set(step2count=0) ; —> Leave to msgs
same => n(toLeave), Playback(/usr/share/asterisk/sounds/en/dp_leaveMsg)
same => n(record), Record(/var/spool//asterisk/tmp/newFile.gsm) ; to autosave on hangup = ,k
same => n, Read(response,/usr/share/asterisk/sounds/en/dp_postLeaveMsg1, 1)
same => n, GotoIf($["${response}" = "1"]?99,listen:) ; --> go to listen, if like, save; if not, re-record
same => n, GotoIf($["${response}" = "2"]?98,saveit:) ; ---> just go save it; leave another or listen to others
same => n, GotoIf($["${response}" = "3"]?1,record:) ; ---> go to record
same => n, GotoIf($["${response}" = "4"]?2,1:) ; ----> go to listen to vms
exten => 99, 1(listen), Wait(1)
same => n, Playback(/var/spool/asterisk/tmp/newFile)
same => n, Verbose(did it play ${PLAYBACKSTATUS})
same => n, Read(responsePostListen,/usr/share/asterisk/sounds/en/dp_postLeaveMsg2, 1)
same => n, GotoIf($["${responsePostListen}" = “1”]?98,saveit:)
same => n, GotoIf($["${responsePostListen}" = “2”]?1,record:)
same => n, GotoIf($["${responsePostListen}" = “3”]?2,1:)
exten => 98, 1(saveit), Set(date=${STRFTIME(${EPOCH},%Y%m%d-%H%M-%S):-12})
same => n, System(mv /var/spool/asterisk/tmp/newFile.gsm /var/lib/asterisk/sounds/depo/${date}.gsm) ;
same => n, Set(__file=${date})
same => n, Verbose(file title is ${date}.gsm)
same => n, Playback(dp_thankyou)
same => n, Wait(1)
same => n, Goto(start,beginning)
exten => 2, 1, Set(step2count=0) ; ----> listen to msgs
;same => n(toListen), Read(direction,/usr/share/asterisk/sounds/en/dp_listenMsg,1)
same => n(toListen), Playback(/usr/share/asterisk/sounds/en/dp_listenMsg)
same => n, Goto(random,1,random)
same => n, GotoIf($["${direction}" = “1”]?random,1,random:) ; context,extension,label true:false
same => n, GotoIf($["${direction}" = “2”]?51,upBack:)
exten => i,1,Playback(db_invalid)
same => n, Goto(start,beginning)
exten => t,1,Playback(vm-goodbye)
same => n,Hangup()
[random]
exten => 1, 1(random), Verbose(we are going to play files randomly)
same => n(randie), Set(file=${SHELL(source /etc/asterisk/random.sh)})
same => n, Set(file=${file:0:12})
same => n, Verbose(“random file is ${file}”)
same => n(playback), Read(choice,/var/lib/asterisk/sounds/depo/${file},1)
;same => n, WaitExten(3)
same => n, GotoIf($["${choice}" = "*"]?1,random:main_menu,start,beginning)
same => n, Playback(vm-goodbye)
same => n, Hangup()
exten => i,1,Playback(db_invalid)
same => n, Goto(main_menu,start,beginning)
exten => t,1,Playback(vm-goodbye)
same => n,Hangup()
CLI —>
Connected to Asterisk 1.8.4.4~dfsg-2ubuntu1 currently running on SonicProjects (pid = 1148)
we are going to play files randomly
random file is
[Mar 5 22:42:48] WARNING[1933]: file.c:644 ast_openstream_full: File /var/lib/asterisk/sounds/depo/ does not exist in any format
[Mar 5 22:42:48] WARNING[1933]: file.c:950 ast_streamfile: Unable to open /var/lib/asterisk/sounds/depo/ (format 0x4 (ulaw)): No such file or directory
SonicProjects*CLI>
Permissions -->
root@SonicProjects:/var/lib/asterisk/sounds# ls -la
total 16
drwxr-xr-x 4 asterisk asterisk 4096 2012-03-05 16:45 .
drwxr-xr-x 4 asterisk asterisk 4096 2012-03-05 22:42 …
drwxr-xr-x 2 asterisk asterisk 4096 2011-09-23 05:58 custom
drwxrwxrwx 2 asterisk asterisk 4096 2012-03-05 21:35 depo
- Asterisk 1.8.4.4 on Ubunto 11.10 - LAMP