I’ve done that, yet the error remains the same.
For reference, my script ------>
#!/bin/bash
cd /var/lib/asterisk/sounds/en/depo/
files=(ls
) # files in this directory, sorted alphabetically
n=${#files[@]} # number of elements in $files
let “i = $RANDOM % n” # modulus n; picks one element
echo ${files[$i]} | sed ‘s/.[a-z]*$//’ # output minus the extension
My extensions.conf ------->
exten => 1,1(random),Verbose(we are going to play files randomly)
same => n(randie),Set(file=${SHELL(sh /etc/asterisk/random.sh)}) ;/etc/asterisk/random.sh)})
same => n,Verbose(“random file is ${file}”)
same => n,Read(choice,/var/lib/asterisk/sounds/en/depo/${file},1)
same => n,GotoIf($["${choice}" = “*”]?1,random:main_menu,start,beginning)
same => n,Playback(/var/lib/asterisk/sounds/en/dp_GoodBye_)
CLI Output --------->
– Executing [2@main_menu:3] Goto(“SIP/ladyk-00000006”, “random,1,random”) in new stack
– Goto (random,1,1)
– Executing [1@random:1] Verbose(“SIP/ladyk-00000006”, “we are going to play files randomly”) in new stack
we are going to play files randomly
– Executing [1@random:2] Set(“SIP/ladyk-00000006”, "file=0320-0232-26
– ") in new stack
– Executing [1@random:3] Verbose(“SIP/ladyk-00000006”, ""random file is 0320-0232-26
– “”) in new stack
random file is 0320-0232-26
-- Executing [1@random:4] Read("SIP/ladyk-00000006", "choice,/var/lib/asterisk/sounds/en/depo/0320-0232-26
-- ,1") in new stack
-- Accepting a maximum of 1 digits.
[Oct 2 17:50:21] WARNING[18996][C-00000045]: file.c:701 ast_openstream_full: File /var/lib/asterisk/sounds/en/depo/0320-0232-26
does not exist in any format
[Oct 2 17:50:21] WARNING[18996][C-00000045]: file.c:1017 ast_streamfile: Unable to open /var/lib/asterisk/sounds/en/depo/0320-0232-26
(format (ulaw)): No such file or directory
– User disconnected
– Executing [1@random:5] GotoIf(“SIP/ladyk-00000006”, “0?1,random:main_menu,start,beginning”) in new stack
– Goto (main_menu,start,4)
File permissions ----->
-rwxrwxrwx 1 root ladyk 2118444 Oct 2 10:33 0320-0232-26.wav
Folder permissions ---->
drwxrwxrwx 2 root ladyk 4096 Oct 2 14:57 depo
What am I missing? Please advise…Thanks in advance for your time.