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;
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
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;
}
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);