title: How to set Asterisk call log CDR database fields from AMI ORIGINATE
body: <p>I'm using the Asterisk Management Interface (AMI) in PHP to originate outbound calls. Below is a snippet of the code I'm using:</p>
  
  <pre><code>// snippet
  // $num is the number to dial e.g. 0207 121 3456
  // $ext is the extension use to make the call e.g. 101
  // $name is the name of the caller e.g. Fred Flintstone
  //
  fputs($socket, "Action: Originate\r\n" );
  fputs($socket, "Channel: SIP/$ext\r\n" );
  fputs($socket, "Exten: $num\r\n" );
  fputs($socket, "Context: from-internal\r\n");
  fputs($socket, "Priority: 1\r\n" );
  fputs($socket, "CallerID: \"".$name."\" &lt;".$num."&gt;\r\n" );
  fputs($socket, "Async: yes\r\n\r\n" );
  </code></pre>
  
  <p>How do I set the caller name (<code>$name</code>) or other details written to the <code>asteriskcdrdb</code> for outbound calls within the originate script? Ideally I want to set the <code>dst</code> fields in the same way the inbound call fields are set.</p>