[Home]

Summary:ASTERISK-11565: Sometimes (but often) WAV files recorded by voicemail are corrupted
Reporter:mdu113 (mdu113)Labels:
Date Opened:2008-03-03 12:37:33.000-0600Date Closed:2008-03-28 11:17:02
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 12128-noevenlength.diff
( 1) f.diff
( 2) msg0005.WAV
Description:This seems like reincarnation of issue 254 (filed and fixed long time ago).
I have voicemail set to record messages in wav49 format:
[general]
format=wav49

Intermittently, but often, like every every 3-4 messages the message recorded is corrupted, i.e. it plays fine by voicemail itself, but when it's being emailed to blackberry, the blackberry fails to play it with error message "The document conversion failed". When I try to play that message in Windows Media Player 10 on Windows XP, it plays fine and then at the very end the following error message pops up: "Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file".


****** ADDITIONAL INFORMATION ******

This problems seem to appear in voicemail messages only. I've made like 20 recordings in wav49 format using MixMonitor app and the files produced are all fine.
I've attached example of corrupted file recorded by Voicemail.
Comments:By: Jason Parker (jparker) 2008-03-04 12:39:34.000-0600

I've confirmed that this file is 1 byte too short.  There is code in format_wav_gsm.c to correct this, but it likely isn't being called.  I'm trying to look into why that is.

By: Jason Parker (jparker) 2008-03-04 14:15:02.000-0600

Any additional information you can think of here would be extremely helpful.  Things like, how are you ending the recording?  Is the file on the asterisk system the same size as the one that gets emailed?

By: mdu113 (mdu113) 2008-03-04 14:26:40.000-0600

what i can say is that emailing is out of the picture, because i copied that file directly from the storage using scp and this is what i did all the time during the testing.
during the testing, recordings have always been ended by hang up. i just set up an extension pointed directly to voicemail and left like 10-15 messages. the messages were of a different length, but i was unable to find any pattern. it doesn't seem to depend on message length.
do you want me to do the same, but end recordings by '#'?

By: Grzegorz Garlewicz (garlew) 2008-03-04 14:37:43.000-0600

can you take a look at the patch I uploaded?

By: Jason Parker (jparker) 2008-03-04 15:11:55.000-0600

garlew, I'm not entirely sure what this is supposed to do.  Is it just to close the file before it gets mv'd, or is it a timing thing?

By: Grzegorz Garlewicz (garlew) 2008-03-05 01:50:56.000-0600

wav format's close adds 1 extra byte to the file if necessary, but the file might be mv-d before wav's close is called
I think fclose(f->f) should also be moved before mv

By: mdu113 (mdu113) 2008-03-05 17:06:03.000-0600

i tested the patch and it didn't fix the problem. 2 out of 6 messages are still corrupted in my testing.

By: Jason Parker (jparker) 2008-03-27 13:50:51

Could you give the patch I just uploaded a try?  I think the whole "file must be even length" thing is nonsense with msgsm/wav49.

By: mdu113 (mdu113) 2008-03-28 10:14:30

yeah, this seems to be it.
left about 40 vm messages so far and got no corrupted files. i'll deploy this patch in the production systems somewhere next week and report back if i find any problems.
as of now it looks like the issue is resolved. thanks a lot.

By: Digium Subversion (svnbot) 2008-03-28 11:15:49

Repository: asterisk
Revision: 111658

U   branches/1.4/formats/format_wav_gsm.c

------------------------------------------------------------------------
r111658 | qwell | 2008-03-28 11:15:40 -0500 (Fri, 28 Mar 2008) | 8 lines

The file size of WAV49 does not need to be an even number.

(closes issue ASTERISK-11565)
Reported by: mdu113
Patches:
     12128-noevenlength.diff uploaded by qwell (license 4)
Tested by: qwell, mdu113

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=111658

By: Digium Subversion (svnbot) 2008-03-28 11:16:40

Repository: asterisk
Revision: 111659

_U  trunk/
U   trunk/formats/format_wav_gsm.c

------------------------------------------------------------------------
r111659 | qwell | 2008-03-28 11:16:37 -0500 (Fri, 28 Mar 2008) | 16 lines

Merged revisions 111658 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r111658 | qwell | 2008-03-28 11:19:56 -0500 (Fri, 28 Mar 2008) | 8 lines

The file size of WAV49 does not need to be an even number.

(closes issue ASTERISK-11565)
Reported by: mdu113
Patches:
     12128-noevenlength.diff uploaded by qwell (license 4)
Tested by: qwell, mdu113

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=111659

By: Digium Subversion (svnbot) 2008-03-28 11:17:02

Repository: asterisk
Revision: 111660

_U  branches/1.6.0/
U   branches/1.6.0/formats/format_wav_gsm.c

------------------------------------------------------------------------
r111660 | qwell | 2008-03-28 11:17:01 -0500 (Fri, 28 Mar 2008) | 24 lines

Merged revisions 111659 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r111659 | qwell | 2008-03-28 11:20:59 -0500 (Fri, 28 Mar 2008) | 16 lines

Merged revisions 111658 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r111658 | qwell | 2008-03-28 11:19:56 -0500 (Fri, 28 Mar 2008) | 8 lines

The file size of WAV49 does not need to be an even number.

(closes issue ASTERISK-11565)
Reported by: mdu113
Patches:
     12128-noevenlength.diff uploaded by qwell (license 4)
Tested by: qwell, mdu113

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=111660