aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_musiconhold.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-12 15:55:49 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-12 15:55:49 +0000
commitdcd4d5e686c65e2d1b12e570f42c0ed91c76759b (patch)
tree95ab41c97a484e532491c08a7af712a2ed2d4f3d /res/res_musiconhold.c
parentd5ca17569f5e85601553c172087a239e3252e694 (diff)
Merged revisions 74815 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r74815 | file | 2007-07-12 12:53:55 -0300 (Thu, 12 Jul 2007) | 10 lines Merged revisions 74814 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r74814 | file | 2007-07-12 12:51:24 -0300 (Thu, 12 Jul 2007) | 2 lines Only print out a warning for situations where it is actually helpful. (issue #10187 reported by denke) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@74816 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r--res/res_musiconhold.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index a67f3eb51..13509fcbd 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -655,7 +655,7 @@ static int moh4_exec(struct ast_channel *chan, void *data)
}
/*! \note This function should be called with the mohclasses list locked */
-static struct mohclass *get_mohbyname(const char *name)
+static struct mohclass *get_mohbyname(const char *name, int warn)
{
struct mohclass *moh = NULL;
@@ -664,7 +664,7 @@ static struct mohclass *get_mohbyname(const char *name)
break;
}
- if (!moh)
+ if (!moh && warn)
ast_log(LOG_WARNING, "Music on Hold class '%s' not found\n", name);
return moh;
@@ -873,7 +873,7 @@ static int moh_register(struct mohclass *moh, int reload)
int x;
#endif
AST_RWLIST_WRLOCK(&mohclasses);
- if (get_mohbyname(moh->name)) {
+ if (get_mohbyname(moh->name, 0)) {
if (reload) {
ast_debug(1, "Music on Hold class '%s' left alone from initial load.\n", moh->name);
} else {
@@ -965,13 +965,13 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con
*/
AST_RWLIST_RDLOCK(&mohclasses);
if (!ast_strlen_zero(chan->musicclass))
- mohclass = get_mohbyname(chan->musicclass);
+ mohclass = get_mohbyname(chan->musicclass, 1);
if (!mohclass && !ast_strlen_zero(mclass))
- mohclass = get_mohbyname(mclass);
+ mohclass = get_mohbyname(mclass, 1);
if (!mohclass && !ast_strlen_zero(interpclass))
- mohclass = get_mohbyname(interpclass);
+ mohclass = get_mohbyname(interpclass, 1);
if (!mohclass)
- mohclass = get_mohbyname("default");
+ mohclass = get_mohbyname("default", 1);
AST_RWLIST_UNLOCK(&mohclasses);
if (!mohclass)
@@ -1076,7 +1076,7 @@ static int load_moh_classes(int reload)
numclasses++;
}
}
-
+
ast_config_destroy(cfg);
return numclasses;