Any example of using read application in Asterisk 15.5 with PHP AMI?

hi dear all , is there any example of using read application in Asterisk 15.5 with PHP AMI? please shared the link or example if anybody have b’coz i have serch a lot of link but didn’t get any link.

Describe exactly what do you want to do ?

sir i want originate call from php ami and store dtmf enter by any user, with php ami i want to play the voice and store dtmf via dialplan. If you have better way then guide me .

and sir after searching a lot i found that with AMi we cant store the dtmf alone . we can do this with AMI and dialplan both, Is it true ? if you have any solution then plz guide us about this and how can we use read application in ami with variable

i am using below mention ami and dialplan. when i use playback application in AMi and enter dtmf number the enter number don,t store in variable but when i originate call from AMI and use playback application and read application in dialplan every thing is ok.SO , is it possible to play file via AMi with playback application & read and store user enter dtmf in cdr field “userfield” by dialplan?.

exten => 123,1,Verbose
;exten => 123,n,Playback(/usr/EnterNo)
exten => 123,n,Read(num,1,10)
exten => 123,n,verbose(${num})
exten => 123,n,Set(CDR(userfield)=${num})
exten => 123,n,hangup

and php Ami

<?php $socket = fsockopen("localhost",5038, $errno, $errstr, 30); fputs($socket, "Action: Login\r\n"); fputs($socket, "UserName: asterisk\r\n"); fputs($socket, "Secret: 123\r\n\r\n"); echo"
    echo $wrets; 
    fputs($socket, "Action: Originate\r\n" ); 
    fputs($socket, "Channel: SIP/dahdi/9175299369\r\n" ); 
    fputs($socket, "Exten: 123\r\n" ); 
    fputs($socket, "Context: testdtmf\r\n" ); 
	fputs($socket, "Application: Playback\r\n" ); 
	fputs($socket, "Data: /usr/EnterNo\r\n" );
	fputs($socket, "Account:456\r\n" );
    fputs($socket, "Async: yes\r\n\r\n" ); 
    sleep (1);
    fputs($socket, "Action: Logoff\r\n\r\n");
    while (!feof($socket)) {
    $wrets .= fread($socket, 8192).'';
   echo $wrets."
"; fclose($socket);

i am getting proper user enter dtmf number when i use playback application in dialplan and originate call from AMi but when i use AMi with play back application the user enter number don’t store in cdr table.So, I want originate call from AMI and store dtmf in cdr .Above mention work will be done dialplan and Ami both as i search but how please give me some hint

Sir, is it possible to use read application in PHP AMI and if yes how? please guide me

Use extension parameter instead of application and the DTMF value will be available in a channel variable