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”);
thanks @david551
Am sorry, am still struggling:
I believe if i forward the call to dialplan i can use exten => s,1,Set(foo=${CDR(disposition)}) to get the value from foo.
I want to avoid forwarding the call to dialplan, so it possible to get the value from this PHP script or i must forward the call to the dialplan?
@david551 were you able to give it a try, seem not to be working for me.
After your this suggested code, i tried $thevalue = fgets($sockets) to get the value of the variable but no luck. Or may be i should not use fgets()