diff --git a/app/switch/resources/scripts/app/fax/resources/scripts/hangup_tx.lua b/app/switch/resources/scripts/app/fax/resources/scripts/hangup_tx.lua index 169d783977..7979dae198 100644 --- a/app/switch/resources/scripts/app/fax/resources/scripts/hangup_tx.lua +++ b/app/switch/resources/scripts/app/fax/resources/scripts/hangup_tx.lua @@ -409,6 +409,9 @@ table.insert(sql, ":domain_uuid"); table.insert(sql, ")"); sql = table.concat(sql, "\n"); + if (sip_to_user == nil) then + sip_to_user = fax_destination_number; + end local params = { uuid = uuid; domain_uuid = domain_uuid; @@ -417,7 +420,7 @@ caller_id_name = fax_caller_id_name; caller_id_number = fax_caller_id_number; fax_recipient = fax_recipient; - fax_destination = fax_destination_number; + fax_destination = sip_to_user; fax_base64 = fax_base64; fax_date = os.date("%Y-%m-%d %X"); fax_time = os.time(); @@ -453,7 +456,7 @@ freeswitch.consoleLog("INFO","caller_id_number: " .. fax_caller_id_number .. "\n"); end freeswitch.consoleLog("INFO","fax_recipient: " .. fax_recipient .. "\n"); - freeswitch.consoleLog("INFO","fax_destination: " .. fax_destination_number .. "\n"); + freeswitch.consoleLog("INFO","fax_destination: " .. sip_to_user .. "\n"); freeswitch.consoleLog("INFO","fax_result_code: ".. fax_result_code .."\n"); --freeswitch.consoleLog("INFO","mailfrom_address: ".. from_address .."\n"); --freeswitch.consoleLog("INFO","mailto_address: ".. email_address .."\n");