[asterisk-dev] [Code Review] monitor: Prevent attempts to delete files that weren't recorded with the o/i options.

jrose reviewboard at asterisk.org
Fri Nov 9 16:34:06 CST 2012


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

Review request for Asterisk Developers.


Summary
-------

If Monitor is used to record without providing a base file name, then the files will be stored in temporary files during the actual recording. When the monitor stops, the actual path where these files will be saved is checked and if there is something there it is deleted and the file that was actually recorded gets placed there.

Unfortunately, this behavior can take place for both the write file and the read file even if either of these is omitted using the o and i options if there is already a file in the directory which shares the name of what our write_filename or read_filename would have been if it existed. In addition, Asterisk will log a warning about the file being recorded not being found if there isn't one there.

Fixing this is simple. We just need to check if we have a write stream before performing this stuff on the write side and a read stream before performing this stuff on the read side.


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


Diffs
-----

  /branches/1.8/res/res_monitor.c 376120 

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


Testing
-------

Just the obvious.  I checked the following extensions:

exten => 1,1,Montior(wav,,i)
exten => 1,n,Dial(SIP/peer1)

exten => 2,1,Monitor(wav,,o)
exten => 2,n,Dial(SIP/peer1)

and verified the behavior before and after the patch.


Thanks,

jrose

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


More information about the asterisk-dev mailing list