mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user