title: Asterisk Attended Transfer: How to Retain Caller ID
body: <p>(I'm new to Asterisk.) Why is Asterisk showing <code>asterisk</code> on the phone when you do an attended transfer?</p>
  
  <p>This is the Scenation:</p>
  
  <ul>
  <li>I've registered 2 SNOM 300 phones and a software Switchboard application to my asterisk server</li>
  <li>When I dial extension 1499 on phone 1, it rings on the switchboard</li>
  <li>I Answer the call, and transfer it to Phone 2. The switchboard is executing an attended transfer at this point (*2)</li>
  <li>On Asterisk the call is put into the queue but when phone 2 rings it only shows <code>asterisk</code> instead of the extension number of phone 1</li>
  </ul>
  
  <p>This is what I've done to see what is happening:</p>
  
  <p>When the call comes in it goes into the context and execute this</p>
  
  <pre><code>exten =&gt; _1499,1,Set(CALLERID(name)=${CALLERID(num)})
  exten =&gt; _1499,n,NoOp(#################### ${CALLERID(num)} ${CALLERID(name)})
  exten =&gt; _1499,n,Queue(swb_q,tTkK)
  </code></pre>
  
  <p>On asterisk it shows the CallerID as 1904 which is correct.</p>
  
  <p>When the call is transferred it goes to the TRANSFER context and this code is executed</p>
  
  <pre><code>exten =&gt; _19XX,1,Gosub(ENDRECORD,s,1)
  exten =&gt; _19XX,n,NoOp(#################### ${CALLERID(num)} ${CALLERID(name)})
  exten =&gt; _19XX,n,Set(_TransToExt=${EXTEN})
  exten =&gt; _19XX,n,NoOp(IN TRANSFER ${TransToExt})
  exten =&gt; _19XX,n,Gosub(RECORDING,s,1)
  exten =&gt; _19XX,n,Dial(Sip/${EXTEN},40,tT,kK)
  </code></pre>
  
  <p>but not the <code>CALLERID(num)</code> and <code>(name)</code> variables are blank. Now I'm sure it is because I'm on a different extension or channel or something.</p>
  
  <p>How can I retain the Caller ID of the incoming call, and when the Switchboard transfer the call, pass that CID to Phone 2?</p>
  
  <p>Any help will be appreciated. Google have a lot on transfers, but I'm struggling to find something close to this.</p>
  
  <p>I've looked at this 
  <a href="https://stackoverflow.com/questions/15167492/retain-original-caller-id-on-call-transfer-on-asterisk">retain original caller id on Call transfer on asterisk</a> 
  but I'm not sure if it is helpful, because there is not a lot of detail in the Answer.</p>