[asterisk-dev] [Code Review] MixMonitor Leaves Empty Audio Files Behind

elguero reviewboard at asterisk.org
Tue Aug 14 16:49:31 CDT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2068/
-----------------------------------------------------------

(Updated Aug. 14, 2012, 4:49 p.m.)


Review request for Asterisk Developers.


Changes
-------

Updating patch based on feedback.

This patch keeps track of the file size before attempting to write audio to the file.  Then we compare the file size during cleanup to determine if audio was written to the file or not.  If there was no audio captured, the audio file is removed.

This patch also takes into consideration if the append flag has been set.  If the file did not exist before recording and no audio is written to the file, the file is deleted.  If the file existed before recording but no audio is written, the file will not be removed in order to not remove an audio file that should not be deleted because it may contain audio on it.

I debated on whether to worry about deleting files created by setting the option to record the transmit stream to a file and the option to record the receive stream to a file.  I am thinking that it may be desired, if someone is using those options, to keep those files around.  Especially if, say, one file has audio and the other one doesn't... it may be useful for troubleshooting purpose... not sure how people are going to use the separate streams.  Any thoughts on this is welcome.


Summary
-------

When the MixMonitor application is started, it creates an empty audio file (just the header is present) for writing an audio stream.

In the event that MixMonitor is started before dialing (in the case on the issue, record only a bridged channel) but the bridge never is setup due to the other side not answering or for whatever reason the bridge did not succeed in being created, MixMonitor does not clean up the empty audio file.  This has the effect of leaving empty audio files behind.

This proposed patch is a simple one.  I took a look at app_record to see how it handles files that do not contain any audio and proceeded to create this patch to match that behavior.


This addresses bug ASTERISK-20156.
    https://issues.asterisk.org/jira/browse/ASTERISK-20156


Diffs (updated)
-----

  /branches/10/UPGRADE.txt 371249 
  /branches/10/apps/app_mixmonitor.c 371249 

Diff: https://reviewboard.asterisk.org/r/2068/diff


Testing
-------

Reproducing this issue is pretty straight forward.  I tested this patch on one of my local dev machines.  I have yet to get a response on the issue as to whether it is working for the original reporter.


Thanks,

elguero

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120814/efdae33d/attachment.htm>


More information about the asterisk-dev mailing list