Index: main/app.c =================================================================== --- main/app.c (revision 177535) +++ main/app.c (working copy) @@ -731,8 +731,16 @@ * off the recording. However, if we ended with '#', we don't want * to trim ANY part of the recording. */ - if (res > 0 && totalsilence) + if (res > 0 && totalsilence) { ast_stream_rewind(others[x], totalsilence - 200); + /* Reduce duration by a corresponding amount */ + if (x == 0 && *duration) { + *duration -= (totalsilence - 200); + if (*duration < 0) { + *duration = 0; + } + } + } ast_truncstream(others[x]); ast_closestream(others[x]); }