<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/1721/">https://reviewboard.asterisk.org/r/1721/</a>
     </td>
    </tr>
   </table>
   <br />


<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 Terry Wilson.</div>





<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;">This completely violates my normal rule of &quot;Don&#39;t touch CDR code, ever. No, really, I mean it. Never.&quot; So, with that said, I will be more than happy if someone tells me that this is a horrible idea and we shouldn&#39;t implement it.

Now, with *that* said, this is something that really should work. The problem is that before entering the bridge loop, we duplicate the channel cdr as the bridge cdr. When the CDR() application modifies the CDR during the bridge, it writes to the old channel cdr. This patch just copies the writable &quot;read only&quot; CDR variables (don&#39;t get me started) amaflags, accountcode, and userfield  and other CDR variables from the channel cdr to the bridge cdr before posting the bridge cdr.

I await someone who is smarter than I am to tell me why this is a bad idea, because I know that modifying CDR code is always a bad idea.</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;">I made a dynamic feature that calls Set(CDR(userfield)=stuff) and verified that &quot;stuff&quot; is actually written to the CDR userfield when it is used.</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-16990">ASTERISK-16990</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/main/features.c <span style="color: grey">(354347)</span></li>

</ul>

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




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




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