But I’m using realtime for everything, and I can’t figure what is the MySQL table structure for realtime MOH and how to use http URIs in realtime mode.
I created a MoH class for testing purposes in the previous tables:
INSERT INTO musiconhold SET name = 'test', mode = 'playlist';
INSERT INTO musiconhold_entry SET name = 'test', position = 1, entry = 'http://domain.com/audio-file-1.gsm';
INSERT INTO musiconhold_entry SET name = 'test', position = 2, entry = 'http://domain.com/audio-file-2.gsm';
INSERT INTO musiconhold_entry SET name = 'test', position = 3, entry = 'http://domain.com/audio-file-3.gsm';
If you place a call that play de MoH test class, the audio files will be fetched from the URL.
That’s exactly what I was looking for, thank you very much
One last thing, I’m wondering if the musiconHold URIs have any caching mechanism, I read in the documentation that playback uses Cache-Control header inside HTTP reply, but I haven’t found anything regarding MOH.
I test in Google Chrome one HTTP request to check the header:
The cache-control header exists with the correct value.
Then I place a call that start music on hold using this URL.
Here is the logs from http-server, as you can see we only have requests with 30 seconds of interval (this music on hold is only the word “hello”, must have 1 ou 2 seconds long):
I was really referring to shared caches. I’d assumed that Asterisk didn’t fetch to a file, but streamed the the media directly, but it looks as though it uses libcurl for more sophisticated handling.
The HEAD’s aren’t really what I would expect though. I’d expect a conditional GET. Did the server respond as HTTP/1.0?
Thanks for your tests, I can confirm that caching works as you described in your previous post (I checked on asterisk side using the console with some debug info)
Hope those informations will help anyone looking for this topic.