From 4d03f5f356f262fb0e8fd890a845a3e89250a9c6 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 2 Dec 2016 21:28:33 -0700 Subject: [PATCH] Update fax_send.php Use fax variables from default settings fax category. --- app/fax/fax_send.php | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index 44025fe8f7..8554028b94 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -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 . ",";