aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-10 22:12:57 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-10 22:12:57 +0000
commit83fe7d612e01fc3eaba39b0d316b2ed50e88959e (patch)
tree893837694de19925c358e3584d78fd131d1a1471 /res
parentae8cb20c1dd0319ccdcb79b1d8206494e0ac7692 (diff)
Merged revisions 162891 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r162891 | jpeeler | 2008-12-10 16:11:46 -0600 (Wed, 10 Dec 2008) | 13 lines Merged revisions 162874 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r162874 | jpeeler | 2008-12-10 16:04:18 -0600 (Wed, 10 Dec 2008) | 5 lines (closes issue #13229) Reported by: clegall_proformatique Ensure that moh_generate does not return prematurely before local_ast_moh_stop is called. Also, the sleep in mp3_spawn now only occurs for http locations since it seems to have been added originally only for failing media streams. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@162896 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/res_musiconhold.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 0683ab9a2..7ab66b66a 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -413,7 +413,7 @@ static int spawn_mp3(struct mohclass *class)
files = 1;
} else {
dir = opendir(class->dir);
- if (!dir && !strstr(class->dir,"http://") && !strstr(class->dir,"HTTP://")) {
+ if (!dir && !strncasecmp(class->dir, "http://", 7)) {
ast_log(LOG_WARNING, "%s is not a valid directory\n", class->dir);
return -1;
}
@@ -456,8 +456,7 @@ static int spawn_mp3(struct mohclass *class)
}
}
-
- if (strstr(class->dir,"http://") || strstr(class->dir,"HTTP://")) {
+ if (!strncasecmp(class->dir, "http://", 7)) {
ast_copy_string(fns[files], class->dir, sizeof(fns[files]));
argv[argc++] = fns[files];
files++;
@@ -488,7 +487,7 @@ static int spawn_mp3(struct mohclass *class)
close(fds[1]);
return -1;
}
- if (time(NULL) - class->start < respawn_time) {
+ if (!strncasecmp(class->dir, "http://", 7) && time(NULL) - class->start < respawn_time) {
sleep(respawn_time - (time(NULL) - class->start));
}
@@ -839,8 +838,9 @@ static int moh_generate(struct ast_channel *chan, void *data, int len, int sampl
short buf[1280 + AST_FRIENDLY_OFFSET / 2];
int res;
- if (!moh->parent->pid)
+ if (!moh->parent->pid && moh->parent->inuse == 0) {
return -1;
+ }
len = ast_codec_get_len(moh->parent->format, samples);