aboutsummaryrefslogtreecommitdiffstats
path: root/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'app.c')
-rwxr-xr-xapp.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/app.c b/app.c
index f653aa909..61cb63cd4 100755
--- a/app.c
+++ b/app.c
@@ -706,10 +706,12 @@ int ast_play_and_record(struct ast_channel *chan, char *playfile, char *recordfi
for (x=0;x<fmtcnt;x++) {
if (!others[x])
break;
- if (totalsilence)
- ast_stream_rewind(others[x], totalsilence-200);
- else
- ast_stream_rewind(others[x], 200);
+ if (res > 0) {
+ if (totalsilence)
+ ast_stream_rewind(others[x], totalsilence-200);
+ else
+ ast_stream_rewind(others[x], 200);
+ }
ast_truncstream(others[x]);
ast_closestream(others[x]);
}
@@ -718,14 +720,11 @@ int ast_play_and_record(struct ast_channel *chan, char *playfile, char *recordfi
ast_log(LOG_WARNING, "Unable to restore format %s to channel '%s'\n", ast_getformatname(rfmt), chan->name);
}
}
- if (outmsg) {
- if (outmsg > 1) {
+ if (outmsg > 1) {
/* Let them know recording is stopped */
- ast_streamfile(chan, "auth-thankyou", chan->language);
+ if(!ast_streamfile(chan, "auth-thankyou", chan->language))
ast_waitstream(chan, "");
- }
}
-
return res;
}