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;
}
}
}
-
- 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++;
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));
}
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);