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.
This commit is contained in:
FusionPBX 2025-01-15 19:44:56 -07:00 committed by GitHub
parent d49e8e4d2c
commit df90b758bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -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);