Version 0.1.3 from FTP

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2000-01-09 19:58:18 +00:00
parent aa6a80f31d
commit 0c3b134da5
13 changed files with 103 additions and 74 deletions

View File

@@ -31,18 +31,22 @@ LOCAL_USER_DECL;
static int playback_exec(struct ast_channel *chan, void *data)
{
int res;
int res = 0;
struct localuser *u;
if (!data) {
ast_log(LOG_WARNING, "Playback requires an argument (filename)\n");
return -1;
}
LOCAL_USER_ADD(u);
ast_stopstream(chan);
res = ast_streamfile(chan, (char *)data);
if (!res)
res = ast_waitstream(chan, "");
ast_stopstream(chan);
if (chan->state != AST_STATE_UP)
res = ast_answer(chan);
if (!res) {
ast_stopstream(chan);
res = ast_streamfile(chan, (char *)data, chan->language);
if (!res)
res = ast_waitstream(chan, "");
ast_stopstream(chan);
}
LOCAL_USER_REMOVE(u);
return res;
}