aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-27 19:45:24 +0000
committerqwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-09-27 19:45:24 +0000
commitdf5a8ce91b388839ca69c27166d6ccb49fbed862 (patch)
tree18abea3a6950769876f23f45cb56663c3d039dd6
parent4b9c516fa01e2e8a430ca45c93e591d1bdf1cdc7 (diff)
Merged revisions 43803 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r43803 | qwell | 2006-09-27 12:44:02 -0700 (Wed, 27 Sep 2006) | 4 lines 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/trunk@43804 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_playback.c7
-rw-r--r--main/pbx.c4
2 files changed, 7 insertions, 4 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;
}
diff --git a/main/pbx.c b/main/pbx.c
index 538b5fb9c..a800ae873 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -5292,8 +5292,10 @@ static int pbx_builtin_background(struct ast_channel *chan, void *data)
AST_APP_ARG(context);
);
- if (ast_strlen_zero(data))
+ if (ast_strlen_zero(data)) {
ast_log(LOG_WARNING, "Background requires an argument (filename)\n");
+ return -1;
+ }
parse = ast_strdupa(data);