I'm using the Asterisk Management Interface (AMI) in PHP to originate outbound calls. Below is a snippet of the code I'm using:
// 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."\" <".$num.">\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
How do I set the caller name ($name
) or other details written to the asteriskcdrdb
for outbound calls within the originate script? Ideally I want to set the dst
fields in the same way the inbound call fields are set.