Cannot access custom audio file with default "path"

Dear community

I am currently running an Asterisk version 13.1.0 on a Ubuntu 16.04 server.

I’m facing the issue that I cannot playback my custom audio files using the default “path”.

Basically just name the custom sound file without writing the whole path to the file.

When I use “Playback” or “Background” to play a custom audio file in a dial plan, I received the following error messages:

[May 24 10:12:12] WARNING[6047][C-000006ac] file.c:774 ast_openstream_full: File audio_custom_file does not exist in any format
[May 24 10:12:12] WARNING[6047][C-000006ac] file.c:1100 ast_streamfile: Unable to open audio_custom_file (format (ulaw)): No such file or directory
[May 24 10:12:12] WARNING[6047][C-000006ac] app_playback.c:493 playback_exec: Playback failed on SIP/trunk-00001030 for audio_custom_file

This is the dialplan that fails:

exten => extension,n,Playback( audio_custom_file)

When I link the file in the effective location, the file can be played by the PBX:

exten => extension,n,Playback(/var/lib/asterisk/sounds/custom/audio_custom_file)

According to the “asterisk.conf” config file the default paths are:

astdatadir => /usr/share/asterisk
astvarlibdir => /var/lib/asterisk

When I checked the data directory for the sound files I found out that the directory “/usr/share/asterisk/sounds/custom” is a symlink to “/var/lib/asterisk”:

/usr/share/asterisk/sounds/custom -> /var/lib/asterisk/sounds/custom

I wasn’t able to look up what permissions I have to set in the documentary of asterisk.

Can someone provide me information about which permissions has to be set for which folders?

Thank you and regards
Michel Rios

When you have audio files without full path then they are expected to be in /var/lib/asterisk/sounds/
Try this and see
exten => extension,n,Playback(custom/audio_custom_file)

–Satish Barot

1 Like

Another thing you must check is never put white spaces while passing arguments to Dialplan Applications. The space between the opening bracket and audio_custom_file will create problems. It should rather be as follows:
exten => extension,n,Playback(audio_custom_file)

1 Like

Hi Satish

Sorry for responding this late, but your proposed solution did the trick :slight_smile:
Thank you for the help, I really appreciate the help from the community in this forum.

I will change the topic as solved.

I wish you a nice day(or evening? ;))

Thank you and kind regards
Michel Rios