title: How to save Remote Party ID to CDR in Asterisk?
body: <p>I'm new to Asterisk so any help will be greatly appreciated.</p>
  
  <p>I'm trying to save remote party ID (CONNECTEDLINE) in CDR logs table in transferred calls. In blind transfers there's no problem because I'm getting Remote Party ID as Caller ID in <code>src</code> field.</p>
  
  <p>In attended transfers I'm loosing the original caller ID.</p>
  
  <p>This is how transfer goes:</p>
  
  <ol>
  <li>A calls B (A talking with B) </li>
  <li>B holds A, and calls C (B talking with C)</li>
  <li>B transfers A to C (A talking with C)</li>
  </ol>
  
  <p>Now, in CDRs table I'm getting two records. One for the first call (A&lt;->B), and another for the two second calls (B&lt;->C and A&lt;->C). The point is in second CDR I have lost any reference to A.</p>
  
  <p>I want to save Remote Party ID (A) in second CDR.
  I've already added a custom field to CDR table (<code>connectedID</code>).</p>
  
  <p>I'm reading about editing some configuration files, adding this kind of sentences:</p>
  
  <pre><code>"exten =&gt; s,1,set(CDR(connectedID)=${CONNECTEDLINE})"
  </code></pre>
  
  <p>However, I'm quite lost. I don't know which file I need to edit, even in what part of file I should put these lines of code.</p>
  
  <p>Could somebody point me in the right direction?</p>