Hello Asterisk Community,
I’m encountering an issue while trying to play a sound file in my Asterisk-based IVR setup. Specifically, when I attempt to play a sound file (welcome-message.wav
), I get the following error in the Asterisk logs:
[Jan 17 15:33:32] WARNING[13543][C-00000002] file.c: Unable to open playback.wav (format (ulaw)): No such file or directory
[Jan 17 15:33:32] WARNING[13543][C-00000002] pbx_builtins.c: ast_streamfile failed on SIP/1000-00000001 for playback.wav
Here’s what I’ve done so far to resolve the issue:
- I’ve confirmed that the sound files are in the correct directory (
/var/lib/asterisk/sounds/
) and have the correct permissions. - I tried both
.wav
and.ulaw
file formats. - I verified that Asterisk has access to the
/var/lib/asterisk/sounds/
directory. - I attempted to change the file name and paths as per the logs, but the issue persists.
- I also tested with
.ulaw
files but got similar errors related to not being able to locate the file.
Here is my current directory structure:
/var/lib/asterisk/sounds$ ls
custom playback.wav welcome-message.ulaw
[Jan 17 15:33:32] WARNING[13543][C-00000002] file.c: Unable to open playback.wav (format (ulaw)): No such file or directory
[Jan 17 15:33:32] WARNING[13543][C-00000002] pbx_builtins.c: ast_streamfile failed on SIP/1000-00000001 for playback.wav
Here’s my relevant configuration for the IVR (extensions.conf
):
[ivr-context]
exten => 1000,1,Answer()
exten => 1000,n,Background(/var/lib/asterisk/sounds/playback.wav) ; Play welcome message once
exten => 1000,n,WaitExten(5)
exten => 1,1,Background(option1)
exten => 1,n,Hangup()
exten => 2,1,Background(option2)
exten => 2,n,Hangup()
exten => i,1,Background(invalid-option)
exten => i,n,Goto(ivr-context,s,1)
exten => t,1,Background(timeout-message)
exten => t,n,Goto(ivr-context,s,1)
Questions:
- Why am I getting the “No such file or directory” error for sound files even though they exist in the correct directory and have the right permissions?
- Is there something specific I need to do to make
.wav
or.ulaw
files compatible with Asterisk’s playback system? - Are there any other file formats or configurations that I should try to resolve this issue?
I would appreciate any guidance or suggestions you may have to resolve this issue.
Thank you in advance!