<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/2190/">https://reviewboard.asterisk.org/r/2190/</a>
     </td>
    </tr>
   </table>
   <br />



 <p>Ship it!</p>









<p>- Joshua</p>


<br />
<p>On November 9th, 2012, 4:34 p.m., jrose wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By jrose.</div>


<p style="color: grey;"><i>Updated Nov. 9, 2012, 4:34 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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&#39;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.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Just the obvious.  I checked the following extensions:

exten =&gt; 1,1,Montior(wav,,i)
exten =&gt; 1,n,Dial(SIP/peer1)

exten =&gt; 2,1,Monitor(wav,,o)
exten =&gt; 2,n,Dial(SIP/peer1)

and verified the behavior before and after the patch.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-20641">ASTERISK-20641</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/branches/1.8/res/res_monitor.c <span style="color: grey">(376120)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/2190/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>