|
|
|
@ -900,6 +900,10 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
|
|
|
|
|
int seekattempt;
|
|
|
|
|
|
|
|
|
|
fs = ast_openstream(chan, filename, preflang);
|
|
|
|
|
if (!fs) {
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to open %s (format %s): %s\n", filename, ast_getformatname_multiple(fmt, sizeof(fmt), chan->nativeformats), strerror(errno));
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* check to see if there is any data present (not a zero length file),
|
|
|
|
|
* done this way because there is no where for ast_openstream_full to
|
|
|
|
@ -910,12 +914,11 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (fs)
|
|
|
|
|
vfs = ast_openvstream(chan, filename, preflang);
|
|
|
|
|
if (vfs) {
|
|
|
|
|
ast_debug(1, "Ooh, found a video stream, too, format %s\n", ast_getformatname(vfs->fmt->format));
|
|
|
|
|
}
|
|
|
|
|
if (fs){
|
|
|
|
|
|
|
|
|
|
int res;
|
|
|
|
|
if (ast_test_flag(chan, AST_FLAG_MASQ_NOSTREAM))
|
|
|
|
|
fs->orig_chan_name = ast_strdup(chan->name);
|
|
|
|
@ -929,9 +932,6 @@ int ast_streamfile(struct ast_channel *chan, const char *filename, const char *p
|
|
|
|
|
ast_verb(3, "<%s> Playing '%s.%s' (language '%s')\n", chan->name, filename, ast_getformatname(chan->writeformat), preflang ? preflang : "default");
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
ast_log(LOG_WARNING, "Unable to open %s (format %s): %s\n", filename, ast_getformatname_multiple(fmt, sizeof(fmt), chan->nativeformats), strerror(errno));
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ast_filestream *ast_readfile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode)
|
|
|
|
|