diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-12 15:53:55 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-12 15:53:55 +0000 |
commit | a91a3f23cf4d7a9430bf7e02b3049acc26b16f8f (patch) | |
tree | 6dc7767dedf85a17d6f05141923ce97cd10088ce /res/res_musiconhold.c | |
parent | 21f76d85f3ac5cbf17077dd21b2bab45be227aee (diff) |
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/branches/1.4@74815 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_musiconhold.c')
-rw-r--r-- | res/res_musiconhold.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 763d9e022..502fe9aa2 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -625,7 +625,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; @@ -634,7 +634,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; @@ -842,7 +842,7 @@ static int moh_register(struct mohclass *moh, int reload) int x; #endif AST_LIST_LOCK(&mohclasses); - 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 { @@ -934,13 +934,13 @@ static int local_ast_moh_start(struct ast_channel *chan, const char *mclass, con */ AST_LIST_LOCK(&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_LIST_UNLOCK(&mohclasses); if (!mohclass) @@ -1060,7 +1060,7 @@ static int load_moh_classes(int reload) args = strchr(data, ','); if (args) *args++ = '\0'; - if (!(get_mohbyname(var->name))) { + if (!(get_mohbyname(var->name, 0))) { if (!(class = moh_class_malloc())) { return numclasses; } @@ -1083,7 +1083,7 @@ static int load_moh_classes(int reload) 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'; |