ast_openstream_full & ast_streamfile warnings

Hello,

I updated my server and my Asterisk system to 11.12.1. I’m having some trouble deciphering my error, despite the error log. I’m wondering if someone could be kind enough to give me a bit more direction.

I have a shell script that picks a random file from the “depo” folder and echo’s back the result.

    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)

Despite the file being there, I get these error messages:

WARNING[11173][C-00000004]: file.c:701 ast_openstream_full: File /var/lib/asterisk/sounds/en/depo/0323-1410-29.wav
does not exist in any format
[Sep 29 12:19:35] WARNING[11173][C-00000004]: file.c:1017 ast_streamfile: Unable to open /var/lib/asterisk/sounds/en/depo/0323-1410-29.wav
(format (ulaw)): No such file or directory

If someone could shed a bit more light on this and give me some direction, it’d be appreciated!

remove the .wav from the filename

@navaismo - I tried that but that doesn’t work.

He means from the name of the file in the script. It is necessary in the actual file name.

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.

newlines

@david55

What do you mean by “newlines” ? Can you be more specific, please? I’m not following.

There are newlines in your filenames, as used in the script, but not in the actual filenames.