Voicemail: get correct duration when copying file to vm

Changes made during format improvements resulted in the
recording to voicemail option 'm' of the MixMonitor app
writing a zero length duration in the msgXXXX.txt file.

This change introduces a new function ast_ratestream(),
which provides the sample rate of the format associated
with the stream, and updates the app_voicemail function
for ast_app_copy_recording_to_vm to calculate the right
duration.

Review: https://reviewboard.asterisk.org/r/3996/
ASTERISK-24328 #close



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@423192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Scott Griepentrog
2014-09-16 16:32:49 +00:00
parent 48d58da883
commit 79b702f308
3 changed files with 17 additions and 9 deletions

View File

@@ -1026,6 +1026,11 @@ off_t ast_tellstream(struct ast_filestream *fs)
return fs->fmt->tell(fs);
}
int ast_ratestream(struct ast_filestream *fs)
{
return ast_format_get_sample_rate(fs->fmt->format);
}
int ast_stream_fastforward(struct ast_filestream *fs, off_t ms)
{
return ast_seekstream(fs, ms * DEFAULT_SAMPLES_PER_MS, SEEK_CUR);