if (!$pdf_file) { $fax_file_warning = ' Fax image not available on server.'; } else { $fax_file_warning = ''; } //used for debug echo "pdf file is {$pdf_file}\n"; //forward the fax if (file_exists($fax_file)) { if (strpos($fax_file_name, '#') !== false) { $tmp = explode("#", $fax_file_name); $fax_forward_number = $tmp[0]; } echo "fax_forward_number is {$fax_forward_number}\n"; if (strlen($fax_forward_number) > 0) { fax_split_dtmf($fax_forward_number, $fax_dtmf); $fax_send_mode = $_SESSION['fax']['send_mode']['text']; if (strlen($fax_send_mode) == 0) { $fax_send_mode = 'direct'; } $route_array = outbound_route_to_bridge($_SESSION['domain_uuid'], $fax_forward_number); if (count($route_array) == 0) { //send the internal call to the registered extension $fax_uri = "user/" . $fax_forward_number . "@" . $domain_name; $t38 = ""; } else { //send the external call $fax_uri = $route_array[0]; $t38 = "fax_enable_t38=true,fax_enable_t38_request=true"; } $common_dial_string = "absolute_codec_string='PCMU,PCMA',";
} //send the fax $fax_file = $dir_fax_temp . "/" . $fax_instance_uuid . ".tif"; $common_dial_string = "for_fax=1,"; $common_dial_string .= "accountcode='" . $fax_accountcode . "',"; $common_dial_string .= "sip_h_X-accountcode='" . $fax_accountcode . "',"; $common_dial_string .= "domain_uuid=" . $_SESSION["domain_uuid"] . ","; $common_dial_string .= "domain_name=" . $_SESSION["domain_name"] . ","; $common_dial_string .= "origination_caller_id_name='" . $fax_caller_id_name . "',"; $common_dial_string .= "origination_caller_id_number='" . $fax_caller_id_number . "',"; $common_dial_string .= "fax_ident='" . $fax_caller_id_number . "',"; $common_dial_string .= "fax_header='" . $fax_caller_id_name . "',"; $common_dial_string .= "fax_file='" . $fax_file . "',"; foreach ($fax_numbers as $fax_number) { $dial_string = $common_dial_string; fax_split_dtmf($fax_number, $fax_dtmf); //prepare the fax command $route_array = outbound_route_to_bridge($_SESSION['domain_uuid'], $fax_prefix . $fax_number); if (count($route_array) == 0) { //send the internal call to the registered extension $fax_uri = "user/" . $fax_number . "@" . $_SESSION['domain_name']; $t38 = ""; } else { //send the external call $fax_uri = $route_array[0]; $t38 = "fax_enable_t38=true,fax_enable_t38_request=true,"; } if ($fax_send_mode != 'queue') { $dial_string .= $t38; $dial_string .= "mailto_address='" . $mailto_address . "',"; $dial_string .= "mailfrom_address='" . $mailfrom_address . "',";