From b2595d4713dce3162df4adfe94465ebe74b40c05 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 30 Jul 2015 19:07:16 -0600 Subject: [PATCH] Add accountcode, domain_name and domain_uuid for fax forward. --- secure/fax_to_email.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/secure/fax_to_email.php b/secure/fax_to_email.php index 5f8c2fc1cc..a9d4269836 100644 --- a/secure/fax_to_email.php +++ b/secure/fax_to_email.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2015 the Initial Developer. All Rights Reserved. Contributor(s): @@ -124,7 +124,7 @@ if (defined('STDIN')) { echo "fax_extension $fax_extension\n"; echo "fax_name $fax_file_only\n"; -//get the fax details from the database +//get the domain_uuid from the database $sql = "select * from v_domains "; $sql .= "where domain_name = '".$domain_name."' "; $prep_statement = $db->prepare($sql); @@ -145,11 +145,11 @@ if (defined('STDIN')) { foreach ($result as &$row) { //set database fields as variables //$fax_email = $row["fax_email"]; + $fax_accountcode = $row["fax_accountcode"]; $fax_pin_number = $row["fax_pin_number"]; $fax_caller_id_name = $row["fax_caller_id_name"]; $fax_caller_id_number = $row["fax_caller_id_number"]; $fax_forward_number = $row["fax_forward_number"]; - //$fax_user_list = $row["fax_user_list"]; $fax_description = $row["fax_description"]; $fax_email_inbound_subject_tag = $row['fax_email_inbound_subject_tag']; } @@ -260,7 +260,7 @@ if (defined('STDIN')) { $fax_uri = $route_array[0]; $t38 = "fax_enable_t38=true,fax_enable_t38_request=true"; } - $cmd = "api originate {mailto_address='".$mailto_address."',mailfrom_address='".$mailfrom_address."',origination_caller_id_name='".$fax_caller_id_name."',origination_caller_id_number=".$fax_caller_id_number.",fax_uri=".$fax_uri.",fax_file='".$fax_file."',fax_retry_attempts=1,fax_retry_limit=20,fax_retry_sleep=180,fax_verbose=true,fax_use_ecm=off,".$t38.",api_hangup_hook='lua fax_retry.lua'}".$fax_uri." &txfax('".$fax_file."')"; + $cmd = "api originate {absolute_codec_string='PCMU,PCMA',accountcode='".$fax_accountcode."',sip_h_X-accountcode='".$fax_accountcode."',domain_uuid=".$_SESSION["domain_uuid"].",domain_name=".$_SESSION["domain_name"].",mailto_address='".$mailto_address."',mailfrom_address='".$mailfrom_address."',origination_caller_id_name='".$fax_caller_id_name."',origination_caller_id_number=".$fax_caller_id_number.",fax_uri=".$fax_uri.",fax_file='".$fax_file."',fax_retry_attempts=1,fax_retry_limit=20,fax_retry_sleep=180,fax_verbose=true,fax_use_ecm=off,".$t38.",api_hangup_hook='lua fax_retry.lua'}".$fax_uri." &txfax('".$fax_file."')"; //send info to the log echo "fax forward\n"; echo $cmd."\n";