Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nemerald-voip committed Dec 13, 2024
1 parent 56c109a commit 9393fb0
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions app/Models/Faxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public function EmailToFax ($payload){
$this->dial_string = $this->getDialstring();

//add fax to the fax queue or send it directly
if ($this->fax_queue_enabled) {
// if ($this->fax_queue_enabled) {
$fax_queue = new FaxQueues();
$fax_queue->fax_queue_uuid = $this->fax_queue_uuid;
$fax_queue->domain_uuid = $this->domain->domain_uuid;
Expand All @@ -303,7 +303,7 @@ public function EmailToFax ($payload){
$fax_queue->fax_accountcode = $this->fax_accountcode;
$fax_queue->fax_command = 'originate '.$this->dial_string;
$fax_queue->save();
}
// }


// Log::alert("----------Webhook Job ends-----------");
Expand Down Expand Up @@ -356,16 +356,16 @@ public function getDialstring() {
}

// Check if Fax Queue is enabled
$fax_queue_enabled = DefaultSettings::where('default_setting_category','fax_queue')
->where('default_setting_subcategory','enabled')
->where('default_setting_enabled','true')
->pluck('default_setting_value')
->toArray();
if (sizeof($fax_queue_enabled) > 0 && $fax_queue_enabled[0] == 'true') {
$this->fax_queue_enabled = true;
} else {
$this->fax_queue_enabled = false;
}
// $fax_queue_enabled = DefaultSettings::where('default_setting_category','fax_queue')
// ->where('default_setting_subcategory','enabled')
// ->where('default_setting_enabled','true')
// ->pluck('default_setting_value')
// ->toArray();
// if (sizeof($fax_queue_enabled) > 0 && $fax_queue_enabled[0] == 'true') {
// $this->fax_queue_enabled = true;
// } else {
// $this->fax_queue_enabled = false;
// }

//build the fax dial string
$dial_string .= $fax_variables;
Expand All @@ -377,12 +377,12 @@ public function getDialstring() {
$dial_string .= "fax_retry_sleep=180" . ",";
//$dial_string .= "fax_verbose=true" . ",";
$dial_string .= "fax_use_ecm=off" . ",";
if ($this->fax_queue_enabled) {
// if ($this->fax_queue_enabled) {
$dial_string .= "api_hangup_hook='lua app/fax/resources/scripts/hangup_tx.lua'";
}
else {
$dial_string .= "api_hangup_hook='lua fax_retry.lua'";
}
// }
// else {
// $dial_string .= "api_hangup_hook='lua fax_retry.lua'";
// }
$dial_string = "{" . $dial_string . "}" . $fax_uri." &txfax('".$fax_file."')";

return $dial_string;
Expand Down

0 comments on commit 9393fb0

Please sign in to comment.