Hi am using this PHP script below and AMI to send voice message.
Is it possible for me to capture one of the variable/values (like Disposition:) under CDR Asterisk Manager event in this php script?
I want to capture the value and store it in the database.
$socket = fsockopen($pbx,“5038”, $errno, $errstr, $timeout); //Connection to AMI
fputs($socket, “Action: Login\r\n”);
fputs($socket, “UserName: username\r\n”);
fputs($socket, “Secret: password\r\n\r\n”);
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: SIP/$dest\r\n" );
fputs($socket, "Application: Playback\r\n" );
fputs($socket, "Data: $message\r\n" );
fputs($socket, "CallerID: $callerid\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n);
sleep (1);
$wrets=fgets($socket,128);