Click-To-Dial
";
/* open fifo now */
$fifo_handle=fopen( $fifo, "w" );
if (!$fifo_handle) {
exit ("Sorry -- cannot open fifo: ".$fifo);
}
/* construct FIFO command */
$fifo_cmd=":t_uac:".$myfilename."\n".
"REFER\n".$caller."\n".
"p-version: ".$signature."\n".
"Contact: ".$web_contact."\n".
"Referred-By: ".$web_contact."\n".
"Refer-To: ".$callee."\n".
"\n". /* EoHeader */
".\n\n"; /* EoFifoRequest */
/* create fifo for replies */
system("mkfifo -m 666 ".$mypath );
/* write fifo command */
if (fwrite( $fifo_handle, $fifo_cmd)==-1) {
unlink($mypath);
fclose($fifo_handle);
exit("Sorry -- fifo writing error");
}
fclose($fifo_handle);
/* read output now */
if (readfile( $mypath )==-1) {
unlink($mypath);
exit("Sorry -- fifo reading error");
}
unlink($mypath);
echo "Thank you for using click-to-dial
";
?>