Your solution does not work for me. I've just also added the 'default' class to my realtime DB.

[Jul 16 20:27:02]     -- Called test6
[Jul 16 20:27:02]     -- SIP/test6-00000014 is ringing
[Jul 16 20:27:04]     -- SIP/test6-00000014 answered SIP/test2-00000013
[Jul 16 20:27:06] -- Started music on hold, class 'default', on SIP/test6-00000014

No moh class 'mohtest'...

Reloading, restarting Asterisk does not help...

Would it only work for asterisk 1.6 ?



Kind regards,

Jonas.


On 07/16/2010 08:16 PM, Carlos Chavez wrote:
On Fri, 2010-07-16 at 20:06 +0200, Jonas Kellens wrote:
On 07/16/2010 07:43 PM, Carlos Chavez wrote:
        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.

I found the following :

musiconhold.conf has a general section now. It has one option:
cachertclasses. If set to yes,
    then moh classes found in realtime will be added to the in-memory
list. This has the advantage
    of not requiring database lookups each time moh is started, but it
has the disadvantage of not
    truly being realtime.

But when setting the following in musiconhold.conf :

[general]
cachertclasses=yes

[default]
mode=files
directory=/var/lib/asterisk/moh
random=yes


This is what the Asterisk CLI shows :

asterisk*CLI>  moh reload
[Jul 16 20:01:13]   == Parsing '/etc/asterisk/musiconhold.conf': [Jul
16 20:01:13] Found
[Jul 16 20:01:13] WARNING[30819]: res_musiconhold.c:1205
load_moh_classes: A directory must be specified for class 'general'!


Using asterisk 1.4.30 by the way...

        It works as advertised in 1.6.2.X, except for the cachertclasses=yes
which still does not show information in the CLI.


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to