Hello I am new in freepbx and asterisk. a little know
$timeout=10;
$host=“127.0.0.1”;
$port=5038;
$call_trunk = ‘IDT’;
$src = preg_replace(’/\s+/’, ‘’, $fromcall);
$dst = preg_replace(’/\s+/’, ‘’, $tocall);
$trunk = preg_replace(’/\s+/’, ‘’, $call_trunk);
$cid = preg_replace(’/\s+/’, ‘’, $callerid);
$id = preg_replace(’/\s+/’, ‘’, $_POST[id]);
$pitch = preg_replace(’/\s+/’, ‘’, $call_pitch);
$num=$dst;
$ext=$src ;
$context=“out2”;
$audio_path = ‘/var/www/html/b007a9c12395c9c842bad59d900d88f2.mp3’
$socket = fsockopen("$host",$port,$errno, $errstr, $timeout);
fputs($socket, “Action: Login\r\n”);
fputs($socket, “UserName: *********\r\n”); //
fputs($socket, “Secret: ***********\r\n\r\n”); // //
$wrets=fgets($socket,128);
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: Local/$src@out1/n\r\n" );
fputs($socket, "Exten: $dst\r\n" );
fputs($socket, "Context: $context\r\n" );
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "CallerID: $cid\r\n" );
fputs($socket, "Variable: __trunk=$trunk\r\n" );
fputs($socket, "Variable: __dst=$dst\r\n" );
fputs($socket, "Variable: __src=$src\r\n" );
fputs($socket, "Variable: __cid=$cid\r\n" );
fputs($socket, "Variable: __id=$id\r\n" );
fputs($socket, "Variable: __pitch=$pitch\r\n" );
fputs($socket, "Variable: __audio_path=$audio_path\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n");
sleep (1);
$wrets=fgets($socket,128);
echo $wrets;
?>
this is php code in freepbx server.
after this, I dont know how to play audio files when calling.
where is ?
please help me