I cannot play any of the sound files I placed in /var/lib/asterisk/sounds/custom
How can I fix it?
This is the error message:
[2022-04-20 19:30:56] WARNING[54484][C-00000002]: file.c:774 ast_openstream_full: File custom/Hang_001 does not exist in any format
[2022-04-20 19:30:56] WARNING[54484][C-00000002]: file.c:1247 ast_streamfile: Unable to open custom/Hang_001 (format (slin)): No such file or directory
[2022-04-20 19:30:56] WARNING[54484][C-00000002]: app_playback.c:494 playback_exec: Playback failed on Dongle/Dongle1-0100000002 for custom/Hang_001,noanswer
ls -l /var/lib/asterisk/sounds/custom/*
Unfortunately, that’s not works
Actually, it does. The file must exist and be readable by the asterisk user, what I posted would show both the existence and play ability of Hang_001*
or for that matter ANY file you put in that directory in that directory.
How to read for asterisk? (I’m still a very beginner in this)
I think Everything is fine in the asterisk.conf file: [directories]
astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /var/lib/asterisk
astdbdir => /var/lib/asterisk
astkeydir => /var/lib/asterisk
astdatadir => /var/lib/asterisk
astagidir => /usr/share/asterisk/agi-bin
astspooldir => /var/spool/asterisk
astrundir => /var/run/asterisk
astlogdir => /var/log/asterisk
astsbindir => /usr/sbin
And I using Ubuntu 18+ In the custom library the file format is .wav
Just post it
ls -ls /var/lib/asterisk/sounds/custom
total 3692
2680 -rw-rw-r-- 1 asterisk asterisk 2744290 Apr 2 2021 93065.sln
.
.
.
sectors, permissions, links, user, group , size, date, name
Nothing to do with what I suggested but it does confirm astdatadir is /var/lib/asterisk/
The format is what you construct it as, asterisk will check any file by basename until it finds a readable one in a supported format. if you do in fact have `/var/lib/asterisk/sounds/custom/Hang_001.wav’ it would best be owned by the asterisk user, at least it must have read permission by either ‘group’ (----r----) or ‘others’ (-------r–)
You are trying to play Hang_001 but the file is named 93065?
no just my example , the 93065 is a zip code (of dicko’s usage) and a red-herring here
I stabbed everything with this command at the beginning of the installation and don’t know how to revert to asterisk: “sudo chown varjasi -vR /var/lib/asterisk/sound/custom”
As root
chown -R asterisk:asterisk /var/lib/asterisk/
would work, note that the directory is ‘sounds’ not 'sound`
(and possibly cover any other self-assassination attempts ;-))
Thanks for useful command
if you DID typo sound for sounds at some point , then
rsync -av /var/lib/asterisk/sound/custom/ var/lib/asterisk/sounds/custom/ --remove source-files
should mostly fix things
I successfully returned the permissions to asterisk, sorry to write so late, but that didn’t solve the problem either
Please ACTUALLY post the output of
ls -l /var/lib/asterisk/sounds/custom/*
and not just say ‘it doesn’t work’, it will save a lot of time
preemptively also post
file /var/lib/asterisk/sounds/custom/*
as the fiile also needs to in thne correct format, 1 channel 16 bit 8000 Hz
output of
ls -l /var/lib/asterisk/sounds/custom/:
"-rw-r–r-- 1 asterisk asterisk 67660 ápr 20 19:10 '/var/lib/asterisk/sounds/custom/Hang_001’
-rw-r–r-- 1 asterisk asterisk 67660 ápr 20 19:10 ‘/var/lib/asterisk/sounds/custom/Hang_001.wav*’
"
Unfortunately, I don’t speak English well, so it is possible that there is sometimes a misunderstanding