<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 07/16/2010 07:43 PM, Carlos Chavez wrote:<br>
<blockquote cite="mid:1279302231.2800.64.camel@cursor.telecomabmex.com"
type="cite">
<pre wrap="">        Here is what I use:
CREATE TABLE `musiconhold` (
`name` varchar(80) collate utf8_unicode_ci NOT NULL,
`directory` varchar(255) collate utf8_unicode_ci NOT NULL default '',
`application` varchar(255) collate utf8_unicode_ci NOT NULL default
'',
`mode` varchar(80) collate utf8_unicode_ci NOT NULL default '',
`digit` char(1) collate utf8_unicode_ci NOT NULL default '',
`sort` varchar(16) collate utf8_unicode_ci NOT NULL default '',
`format` varchar(16) collate utf8_unicode_ci NOT NULL default '',
PRIMARY KEY (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client;
INSERT INTO `musiconhold` VALUES
('default','/var/lib/asterisk/moh','','files','','random',''),('anuncios','/var/lib/asterisk/moh/anuncios','','files','','alpha','');
        It works but it will not show anything with "moh show classes" or "moh
show files". This is the case with most realtime modules unless there
is a solution like rtcachefriends=yes in sip.conf. There is also a
comment somewhere that you need to have at least one definition in
musiconhold.conf for realtime to work. I usually leave the file as is
and realtime works.
</pre>
</blockquote>
<br>
I found the following :<br>
<br>
<i>musiconhold.conf has a general section now. It has one option:
cachertclasses. If set to yes,<br>
then moh classes found in realtime will be added to the in-memory
list. This has the advantage<br>
of not requiring database lookups each time moh is started, but it
has the disadvantage of not<br>
truly being realtime.</i><br>
<br>
But when setting the following in musiconhold.conf :<br>
<br>
[general]<br>
cachertclasses=yes<br>
<br>
[default]<br>
mode=files<br>
directory=/var/lib/asterisk/moh<br>
random=yes<br>
<br>
<br>
This is what the Asterisk CLI shows :<br>
<br>
asterisk*CLI> moh reload<br>
[Jul 16 20:01:13] == Parsing '/etc/asterisk/musiconhold.conf': [Jul
16 20:01:13] Found<br>
[Jul 16 20:01:13] WARNING[30819]: res_musiconhold.c:1205
load_moh_classes: A directory must be specified for class 'general'!<br>
<br>
<br>
Using asterisk 1.4.30 by the way...<br>
<br>
<br>
<br>
Kind regards,<br>
<br>
Jonas.<br>
</body>
</html>