Play a sound file from a local folder with ARI and Asterisk 14

Hello,

Is there a way to play a sound file to a channel that is saved locally and not from the default sound folder “/var/lib/asterisk/sounds/en” ? I don’t all playbacks to address to the local folder, I want that in some cases to get the sound file from the default folder and other times to use the local folder.

Thanks for any help!

Use the full path name.

I tried that and it did not work… Maybe I should use a different uri scheme and not “sound:” ?

Do you see permission of path issues in verbose or log?

 same => n,Playback(hello) ; /var/lib/asterisk/sounds/en/hello.EXT
 same => n,Playback(/full/path/to/hello) ; /full/path/to/hello.EXT
 same => n,Playback(custom/hello) ; /var/lib/asterisk/sounds/custom/hello.EXT

Are you omitting the file extension?

No, I saved the file with .ulaw extension, so that’s not the problem. The problem was I saved the file in a file system that does not communicate with asterisk so that’s why the asterisk could not play that file.

Thank you for trying to help :slight_smile:

I did notice you mentioned the URI was sound:.
It’s doubtful that Asterisk will know how to use that path.

Guessing you are trying to use the following:

 same => n,Playback(sound:/path/to/hello)

As an alternative solution, maybe you should try a symlink:

shell$ ln -s sound:/path/to /var/lib/asterisk/sounds/custom
 same => n,Playback(custom/hello) ; sound:/path/to/hello.EXT
1 Like