diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-18 07:12:18 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-18 07:12:18 +0000 |
commit | 0eb6c90d71ac5c679ad11c483a92e8cdd4d02b1c (patch) | |
tree | eef4efe74fb6698d439e1257bf94acc4b2ae0576 | |
parent | 892cec08215d16b2da5cf6b59487776573a3858e (diff) |
On reload, re-read the files in the specified moh directory (closes issue #10536)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86277 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | res/res_musiconhold.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index 4c4f21724..49c0d31ac 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -887,6 +887,23 @@ static int moh_scan_files(struct mohclass *class) { return class->total_files; } +static int moh_diff(struct mohclass *old, struct mohclass *new) +{ + if (!old || !new) + return -1; + + if (strcmp(old->dir, new->dir)) + return -1; + else if (strcmp(old->mode, new->mode)) + return -1; + else if (strcmp(old->args, new->args)) + return -1; + else if (old->flags != new->flags) + return -1; + + return 0; +} + static int moh_register(struct mohclass *moh, int reload) { #ifdef HAVE_ZAPTEL @@ -895,7 +912,7 @@ static int moh_register(struct mohclass *moh, int reload) struct mohclass *mohclass = NULL; AST_RWLIST_WRLOCK(&mohclasses); - if ((mohclass = get_mohbyname(moh->name, 0))) { + if ((mohclass = get_mohbyname(moh->name, 0)) && !moh_diff(mohclass, moh)) { mohclass->delete = 0; if (reload) { ast_debug(1, "Music on Hold class '%s' left alone from initial load.\n", moh->name); |