From df90b758bb21847ee08a2161af459bd9ff5e5ee9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 15 Jan 2025 19:44:56 -0700 Subject: [PATCH] Fix issue with sending local faxes When sip_to_user or sip_req_user are used then we need to add these variables so that it can find the correct inbound route. --- app/fax_queue/resources/job/fax_send.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/fax_queue/resources/job/fax_send.php b/app/fax_queue/resources/job/fax_send.php index b48a9e0674..61c7dff3d7 100644 --- a/app/fax_queue/resources/job/fax_send.php +++ b/app/fax_queue/resources/job/fax_send.php @@ -291,7 +291,9 @@ $sql .= ")"; $parameters['destination_number'] = $fax_number; $destination_count = $database->select($sql, $parameters, 'column'); + $local_destination = false; if ($destination_count > 0) { + $local_destination = true; $route_array[] = 'loopback/'.$fax_number.'/public'; } @@ -307,6 +309,12 @@ $common_variables .= "fax_header='" . escape_quote($fax_caller_id_name) . "',"; $common_variables .= "fax_file='" . escape_quote($fax_file) . "',"; + //add the fax destination number variables + if ($local_destination) { + $common_variables .= "sip_to_user=".$fax_number.","; + $common_variables .= "sip_req_user=".$fax_number.","; + } + //prepare the fax command if (empty($route_array)) { $route_array = outbound_route_to_bridge($domain_uuid, $fax_prefix . $fax_number, $channel_variables);