Merge anthm's native MOH patch (bug #2639) he promises me he'll rid it of ast_flag_moh...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-12-24 01:40:07 +00:00
parent f72f506f34
commit 713a2eb072
6 changed files with 411 additions and 56 deletions

17
file.c
View File

@@ -431,8 +431,12 @@ static int ast_filehelper(const char *filename, const char *filename2, const cha
res = ret ? ret : -1;
return res;
}
struct ast_filestream *ast_openstream(struct ast_channel *chan, const char *filename, const char *preflang)
{
return ast_openstream_full(chan, filename, preflang, 0);
}
struct ast_filestream *ast_openstream_full(struct ast_channel *chan, const char *filename, const char *preflang, int asis)
{
/* This is a fairly complex routine. Essentially we should do
the following:
@@ -452,10 +456,13 @@ struct ast_filestream *ast_openstream(struct ast_channel *chan, const char *file
char filename3[256]="";
char *endpart;
int res;
ast_stopstream(chan);
/* do this first, otherwise we detect the wrong writeformat */
if (chan->generator)
ast_deactivate_generator(chan);
if (!asis) {
/* do this first, otherwise we detect the wrong writeformat */
ast_stopstream(chan);
if (chan->generator)
ast_deactivate_generator(chan);
}
if (preflang && !ast_strlen_zero(preflang)) {
strncpy(filename3, filename, sizeof(filename3) - 1);
endpart = strrchr(filename3, '/');