return 0;
}
-static struct mohclass *get_mohbyname(char *name)
+static struct mohclass *get_mohbyname(char *name, int warn)
{
struct mohclass *moh;
moh = mohclasses;
return moh;
moh = moh->next;
}
- ast_log(LOG_WARNING, "Music on Hold class '%s' not found\n", name);
+ if (warn)
+ ast_log(LOG_WARNING, "Music on Hold class '%s' not found\n", name);
return NULL;
}
int x;
#endif
ast_mutex_lock(&moh_lock);
- if (get_mohbyname(moh->name)) {
+ if (get_mohbyname(moh->name, 0)) {
if (reload) {
ast_log(LOG_DEBUG, "Music on Hold class '%s' left alone from initial load.\n", moh->name);
} else {
ast_mutex_lock(&moh_lock);
if (!ast_strlen_zero(class))
- mohclass = get_mohbyname(class);
+ mohclass = get_mohbyname(class, 1);
if (!mohclass && !ast_strlen_zero(chan->musicclass))
- mohclass = get_mohbyname(chan->musicclass);
+ mohclass = get_mohbyname(chan->musicclass, 1);
if (!mohclass)
- mohclass = get_mohbyname("default");
+ mohclass = get_mohbyname("default", 1);
ast_mutex_unlock(&moh_lock);
if (!mohclass)
args = strchr(data, ',');
if (args)
*args++ = '\0';
- if (!(get_mohbyname(var->name))) {
+ if (!(get_mohbyname(var->name, 0))) {
class = moh_class_malloc();
if (!class) {
ast_log(LOG_WARNING, "Out of memory!\n");
ast_log(LOG_WARNING, "The old musiconhold.conf syntax has been deprecated! Please refer to the sample configuration for information on the new syntax.\n");
dep_warning = 1;
}
- if (!(get_mohbyname(var->name))) {
+ if (!(get_mohbyname(var->name, 0))) {
args = strchr(var->value, ',');
if (args)
*args++ = '\0';