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]);
}
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;
}
cmd = ast_play_and_record(chan, playfile, recordfile, maxtime, fmt, duration, silencethreshold, maxsilence);
if (cmd == -1)
/* User has hung up, no options to give */
- return res;
+ return cmd;
if (cmd == '0') {
break;
} else if (cmd == '*') {
}
}
if (outsidecaller)
- ast_play_and_wait(chan, "vm-goodbye");
+ ast_play_and_wait(chan, "vm-goodbye");
if (cmd == 't')
cmd = 0;
return cmd;