Update fax_send.php

Use fax variables from default settings fax category.
This commit is contained in:
FusionPBX
2016-12-02 21:28:33 -07:00
committed by GitHub
parent d5c7f53be3
commit 4d03f5f356

View File

@@ -723,19 +723,18 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
//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 . "',";
$dial_string = "for_fax=1,";
$dial_string .= "accountcode='" . $fax_accountcode . "',";
$dial_string .= "sip_h_X-accountcode='" . $fax_accountcode . "',";
$dial_string .= "domain_uuid=" . $_SESSION["domain_uuid"] . ",";
$dial_string .= "domain_name=" . $_SESSION["domain_name"] . ",";
$dial_string .= "origination_caller_id_name='" . $fax_caller_id_name . "',";
$dial_string .= "origination_caller_id_number='" . $fax_caller_id_number . "',";
$dial_string .= "fax_ident='" . $fax_caller_id_number . "',";
$dial_string .= "fax_header='" . $fax_caller_id_name . "',";
$dial_string .= "fax_file='" . $fax_file . "',";
foreach ($fax_numbers as $fax_number) {
$dial_string = $common_dial_string;
fax_split_dtmf($fax_number, $fax_dtmf);
@@ -745,16 +744,19 @@ function fax_split_dtmf(&$fax_number, &$fax_dtmf){
if (count($route_array) == 0) {
//send the internal call to the registered extension
$fax_uri = "user/".$fax_number."@".$_SESSION['domain_name'];
$t38 = "";
$fax_variables = "";
}
else {
//send the external call
$fax_uri = $route_array[0];
$t38 = "fax_enable_t38=true,fax_enable_t38_request=true,";
$fax_variables = "";
foreach($_SESSION['fax']['variable'] as $variable) {
$fax_variables .= $variable.",";
}
}
if ($fax_send_mode != 'queue') {
$dial_string .= $t38;
$dial_string .= $fax_variables;
$dial_string .= "mailto_address='" . $mailto_address . "',";
$dial_string .= "mailfrom_address='" . $mailfrom_address . "',";
$dial_string .= "fax_uri=" . $fax_uri . ",";