Moh Reload Not Reloading/reading New Musiconhold Files
Hello
using Asterisk 1.8.32.3
Current music on hold :
myserver*CLI> moh show files Class: default
File: /var/lib/asterisk/moh/macroform-robot_dity
File: /var/lib/asterisk/moh/macroform-cold_day
File: /var/lib/asterisk/moh/reno_project-system
File: /var/lib/asterisk/moh/manolo_camp-morning_coffee
File: /var/lib/asterisk/moh/macroform-the_simplicity
New musiconhold file :
[root@myserver ]# file
/var/lib/asterisk/moh/myfolder/1/macroform-the_simplicity.wav
/var/lib/asterisk/moh/myfolder/1/macroform-the_simplicity.wav: RIFF
(little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 8000 Hz
I issue a reload of the moh :
myserver*CLI> moh reload myserver*CLI> module reload res_musiconhold.so
[Mar 3 15:04:53] — Reloading module ‘res_musiconhold.so’ (Music On Hold Resource)
Situation after reload :
myserver*CLI> moh show files Class: default
File: /var/lib/asterisk/moh/macroform-robot_dity
File: /var/lib/asterisk/moh/macroform-cold_day
File: /var/lib/asterisk/moh/reno_project-system
File: /var/lib/asterisk/moh/manolo_camp-morning_coffee
File: /var/lib/asterisk/moh/macroform-the_simplicity
Even a complete ‘module reload’ on Asterisk CLI does nothing :
myserver*CLI> module reload
[Mar 3 15:13:54] == Parsing ‘/etc/asterisk/extconfig.conf’: [Mar 3
15:13:54] == Found
[Mar 3 15:13:54] == Parsing ‘/etc/asterisk/logger.conf’: [Mar 3
15:13:54] == Found
…
[Mar 3 15:13:54] — Reloading module ‘res_musiconhold.so’ (Music On Hold Resource)
…
Situation after reload :
myserver*CLI> moh show files Class: default
File: /var/lib/asterisk/moh/macroform-robot_dity
File: /var/lib/asterisk/moh/macroform-cold_day
File: /var/lib/asterisk/moh/reno_project-system
File: /var/lib/asterisk/moh/manolo_camp-morning_coffee
File: /var/lib/asterisk/moh/macroform-the_simplicity
So, reloading musiconhold does not reload/read musiconhold files.
How to read/load new musiconhold files into asterisk ??
Kind regards.
9 thoughts on - Moh Reload Not Reloading/reading New Musiconhold Files
Your new file is in the ‘myfolder/1” subdirectory of the MOH directory.
Either move the file into the MOH directory or define a new class in musiconhold.conf that is for your directory.
Hello
I did not mention it but of course the MOH directory is listed in
/etc/asterisk/musiconhold.conf :
[default]
mode=files directory=/var/lib/asterisk/moh
[myfolder_1]
mode=files directory=/var/lib/asterisk/moh/myfolder/1
sort=alpha
[myfolder_2]
mode=files directory=/var/lib/asterisk/moh/myfolder/2
sort=alpha
[myfolder_3]
mode=files directory=/var/lib/asterisk/moh/myfolder/3
sort=alpha
No mather where I put the new file, it is never listed.
Untill a full restart of Asterisk ! Then it is listed. But is there no other way to load/read a new MOH file than to completely restart Asterisk ??
After Asterisk restart :
myserver*CLI> moh show files Class: default
File: /var/lib/asterisk/moh/reno_project-system
File: /var/lib/asterisk/moh/macroform-the_simplicity
File: /var/lib/asterisk/moh/manolo_camp-morning_coffee
File: /var/lib/asterisk/moh/macroform-robot_dity
File: /var/lib/asterisk/moh/macroform-cold_day Class: myfolder_1
File: /var/lib/asterisk/moh/myfolder/1/macroform-the_simplicity
Kind regards.
Hello
is there any more information on how to reload/read musiconhold files ?
Kind regards.
Le 23/03/2017
Hello
as you can read in my original post “moh reload” and “module reload res_musiconhold.so” does nothing.
I think there is currently a bug with MOH. For now, if you add a file to a moh folder, ‘touch musiconhold.conf’ and then reload moh. Please let me know how it goes.
Kind regards
Dan Journo
Just spotted that you are using Asterisk 1.8.32.3. The bug I’m thinking of is in the latest version. I don’t know if your version is affected.
Hello
I can confirm that touch-ing /etc/asterisk/musiconhold.conf (just open with vi and close again) and then issuing a ‘module reload res_musiconhold.so’ on the Asterisk CLI makes the new files load into Asterisk.
Very strange !!
I would not know how to automate this through script…
Kind regards.
–Apple-Mail=_3755A8F0-E19E-4C6E-AB87-E41A78F1875F
Content-Transfer-Encoding: quoted-printable Content-Type: text/plain;
charset=windows-1252
Hi Jonas
Wouldn’t this do the job?
touch /etc/asterisk/musiconhold.conf ; asterisk -rx ‘module reload res_musiconhold.so’
Pete
–Apple-Mail=_3755A8F0-E19E-4C6E-AB87-E41A78F1875F
Content-Transfer-Encoding: quoted-printable Content-Type: text/html;
charset=windows-1252
–Apple-Mail=_3755A8F0-E19E-4C6E-AB87-E41A78F1875F