You can see the script call that I wrote in PHP that opens the fax file, but it will be suitable for your needs. Take a look at the full script here: http://www.csrdu.org/nauman/2010/10/18/web-fax-for-asterisk/
$faxHeader = $_POST["faxHeader"]; $localID = $_POST["localID"]; $email = $_POST["email"]; $dest = $_POST["dest"]; $outbound_route = "@outbound-allroutes"; $outboundfax_context = "outboundfax"; $callfile = "Channel: Local/$dest$outbound_route\n" . "MaxRetries: 1\n" . "RetryTime: 60\n" . "WaitTime: 60\n" . "Archive: yes\n" . "Context: $outboundfax_context \n" . "Extension: s\n" . "Priority: 1\n" . "Set: FAXFILE=$input_file_tif\n" . "Set: FAXHEADER=$faxHeader\n" . "Set: TIMESTAMP=" . date("d/m/y : H:i:s",time()) . "\n" . "Set: DESTINATION=$dest\n". "Set: LOCALID=$localID\n" . "Set: EMAIL=$email\n"; // create the call file in /tmp $callfilename = unique_name("/tmp", ".call"); $f = fopen($callfilename, "w"); fwrite($f, $callfile); fclose($f); // $asterisk_spool_folder is usually /var/spool/asterisk/outgoing rename($callfilename, $asterisk_spool_folder . "/" . substr($callfilename,4));
Read on the call list page why we need to move the file, and not open and write it directly to the spool of the asterisk.
recluze
source share