[Home]

Summary:ASTERISK-16563: Defining different moh-classes, but always using "default"
Reporter:Jonas Kellens (jonaskellens)Labels:
Date Opened:2010-08-13 07:29:49Date Closed:2011-06-07 14:04:50
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_musiconhold
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Hello,

my musiconhold.conf file :

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

Using realtime sip peers, all peers have the field 'musiconhold' with the value '106002'


Restarted asterisk.


asterisk*CLI> moh show classes
Class: default
   Mode: files
   Directory: /var/lib/asterisk/moh
Class: 106002
   Mode: files
   Directory: /var/lib/asterisk/moh/106002


But always :

[Aug 13 09:47:57]     -- Started music on hold, class 'default', on SIP/test2-00000014
[Aug 13 09:48:05]     -- Stopped music on hold on SIP/test2-00000014


Question 1 : why can't I use AND class "default" AND class "whatever" ?
Question 2 : why is my peer definition musiconhold=106002 never followed ?

****** ADDITIONAL INFORMATION ******

Only when I comment out the default class :

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

then you see :

[Aug 13 14:28:10] WARNING[21492]: res_musiconhold.c:666 get_mohbyname: Music on Hold class 'default' not found
[Aug 13 14:28:10]     -- Started music on hold, class '106002', on SIP/test2-00000003

Comments:By: Jason Parker (jparker) 2010-08-13 11:38:49

This is a configuration issue.

Take a look at the sample sip.conf, and note the various moh options.