asterisk at phreaknet.org
2023-May-27 15:40 UTC
[asterisk-users] A stupid problem with Playback
On 5/27/2023 11:37 AM, Steve Matzura wrote:> Acording to the book, I'm supposed to put things into what Asterisk > thinks is its default audio file location, /var/lib/asterisk/sounds, > and I'm supposed to be able to create a custom directory off of that > path and use it in a relative-syntax way in the Playback directive, > like so: > ... > > same => n,Playback(mysounds/mygreeting) > > I'm here to tell ya, it doesn't work on my system. However, if I write: > > same => n,Playback(/var/lib/asterisk/sounds/mydir/mygreeting) > > it works fine. Where is the default directory defined? I search every > configuration file and found no such definition./var/lib/asterisk/sounds/en Relative paths are relative to your language-specific directory.> And then there was this: When I finally got my system working after > all the connectivity and extension-not-found and endpoint-not-found > nonsense straightened out, I of course tried the hello-world standard > startup test. It didn't work. Why? Because when you install Asterisk > version 16 from the Debian distro site, you don't get the core sounds, > and when you do install the core sounds package, they don't get put > into /var/lib/asterisk/sounds. Oh no--they get put into > /usr/share/asterisk/sounds. In there, I found several directories such > as 'en' and 'en_us'. I copied the files from the en_us directory into > /var/lib/asterisk/sounds and hello-world worked fine. So then I > created a custom directory and put my own things in it, changing the > Playback statement to the first one above, and it failed. I have to > specify the full path instead of using the relative syntax version > thereof. This is technically not a problem, more just a curiosity as > to why it didn't work the way I thought it's supposed to.A great reason to avoid Asterisk packages and compile from source instead. You'll save yourself a lot of headaches.
On 5/27/2023 11:40 AM, asterisk at phreaknet.org wrote:> Relative paths are relative to your language-specific directory. >Ya know, that's the one thing I didn't do was test Playback before copying the sound files out of /usr/share/asterisk/sounds/en_us into /var/lib/asterisk/sounds--I don't even know for sure that hello-world was playing from the /var path and not the /usr path. Good idea to test that and see what's really going on. I think I set too much store by these books sometimes. But when that's all I have, I tend to go with what I know, and if the book is all I know ... well ...> A great reason to avoid Asterisk packages and compile from source > instead. You'll save yourself a lot of headaches.That's how I started, by trying to build version 18 from source. It failed. Colossally. The compile of sources would run for a while, then the machine would crash spectacularly--I mean, not just hang or reboot. It actually turned itself off. I tried it several times, and each time it failed in the same way, but at a different spot in the compile process. If ever I could figure out a way to trace that one down, I would. It was the strangest thing. So I gave up trying to build from source and went to the distro. Truth to tell, I'd rather have been able to build it from source because then I could follow my book more closely, and I enjoy and am familiar with working with SQL. I understood perfectly what the book was telling me to do and how it would all integrate with configuring Asterisk. Very strange indeed. Maybe I'll try a later version and see what happens.