summaryrefslogtreecommitdiff
path: root/apps/app_record.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-12-01 13:41:43 +0000
committerJoshua Colp <jcolp@digium.com>2014-12-01 13:41:43 +0000
commitef9ca8bc32c7cce781c35bca81d9ae544fd22dae (patch)
tree1681b3570da440e107fbb47e4c79f18d53ce02e5 /apps/app_record.c
parent7db3d1642b6c43aa69ae8d1676793f19c2aca8a3 (diff)
app_record: Fix bug where using the 'k' option and hanging up would trim 1/4 of a second of the recording.
The Record dialplan function trims 1/4 of a second from the end of recordings in case they are terminated because of DTMF. When hanging up, however, you don't want this to happen. This change makes it so on hangup this does not occur. ASTERISK-24530 #close Reported by: Ben Smithurst patches: app_record_v2.diff submitted by Ben Smithurst (license 6529) Review: https://reviewboard.asterisk.org/r/4201/ ........ Merged revisions 428653 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 428654 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 428655 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_record.c')
-rw-r--r--apps/app_record.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/app_record.c b/apps/app_record.c
index 4008fc012..43a1e490f 100644
--- a/apps/app_record.c
+++ b/apps/app_record.c
@@ -447,8 +447,13 @@ static int record_exec(struct ast_channel *chan, const char *data)
if (gotsilence) {
ast_stream_rewind(s, silence - 1000);
ast_truncstream(s);
- } else if (!gottimeout) {
- /* Strip off the last 1/4 second of it */
+ } else if (!gottimeout && f) {
+ /*
+ * Strip off the last 1/4 second of it, if we didn't end because of a timeout,
+ * or a hangup. This must mean we ended because of a DTMF tone and while this
+ * 1/4 second stripping is very old code the most likely explanation is that it
+ * relates to stripping a partial DTMF tone.
+ */
ast_stream_rewind(s, 250);
ast_truncstream(s);
}