aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_playback.c
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-27 19:44:02 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-27 19:44:02 +0000
commit4a2391d76d802d68e6f121b232ae4f49ed715141 (patch)
tree29126d12b62ba18bef37481418434843b0d8058b /apps/app_playback.c
parentf34d9fee8eef2565bd3aa8447779ae73faecaba2 (diff)
Fix an issue with PLAYBACKSTATUS not being set under certain circumstances.
Fix a minor issue, to make it use the filenames that were parsed, instead of the entire argument string. Fix Background() to return -1 like Playback(), if no args are specified. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@43803 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_playback.c')
-rw-r--r--apps/app_playback.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/app_playback.c b/apps/app_playback.c
index 87b06b02e..396ed71e6 100644
--- a/apps/app_playback.c
+++ b/apps/app_playback.c
@@ -380,6 +380,7 @@ static struct ast_cli_entry cli_playback[] = {
static int playback_exec(struct ast_channel *chan, void *data)
{
int res = 0;
+ int mres = 0;
struct ast_module_user *u;
char *tmp;
int option_skip=0;
@@ -422,11 +423,11 @@ static int playback_exec(struct ast_channel *chan, void *data)
res = ast_answer(chan);
}
if (!res) {
- int mres = 0;
+ char *back = args.filenames;
char *front;
ast_stopstream(chan);
- while (!res && (front = strsep(&tmp, "&"))) {
+ while (!res && (front = strsep(&back, "&"))) {
if (option_say)
res = say_full(chan, front, "", chan->language, NULL, -1, -1);
else
@@ -442,9 +443,9 @@ static int playback_exec(struct ast_channel *chan, void *data)
mres = 1;
}
}
- pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS");
}
done:
+ pbx_builtin_setvar_helper(chan, "PLAYBACKSTATUS", mres ? "FAILED" : "SUCCESS");
ast_module_user_remove(u);
return res;
}