diff --git a/app/fax/app_config.php b/app/fax/app_config.php index 8567a0023d..dc9b788ffa 100644 --- a/app/fax/app_config.php +++ b/app/fax/app_config.php @@ -277,6 +277,14 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_send_greeting"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "fax_send_channels"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; //$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "fax_keep_local"; //$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "fax_local"; //$apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; @@ -499,4 +507,75 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $y = 4; //table array index + $z = 0; //field array index + $apps[$x]['db'][$y]['table'] = 'v_fax_tasks'; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'fax_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_fax'; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'fax_uuid'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = 'FAX server primary key'; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_next_time'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'timestamp'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_lock_time'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'timestamp'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_fax_file'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_wav_file'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_uri'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_dial_string'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_dtmf'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_interrupted'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_status'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_no_answer_counter'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_no_answer_retry_counter'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_retry_counter'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = 'task_description'; + $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; + $z++; ?> \ No newline at end of file diff --git a/app/fax/app_defaults.php b/app/fax/app_defaults.php index b3ab8cd98c..d688de4388 100644 --- a/app/fax/app_defaults.php +++ b/app/fax/app_defaults.php @@ -60,6 +60,55 @@ if ($domains_processed == 1) { $array[$x]['default_setting_enabled'] = 'true'; $array[$x]['default_setting_description'] = 'Keep the file after sending or receiving the fax.'; $x++; + $array[$x]['default_setting_category'] = 'fax'; + $array[$x]['default_setting_subcategory'] = 'send_mode'; + $array[$x]['default_setting_name'] = 'text'; + $array[$x]['default_setting_value'] = 'queue'; + $array[$x]['default_setting_enabled'] = 'false'; + $array[$x]['default_setting_description'] = ''; + $x++; + $array[$x]['default_setting_category'] = 'fax'; + $array[$x]['default_setting_subcategory'] = 'send_retry_limit'; + $array[$x]['default_setting_name'] = 'numeric'; + $array[$x]['default_setting_value'] = '5'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Number of attempts to send fax (count only calls with answer)'; + $x++; + $array[$x]['default_setting_category'] = 'fax'; + $array[$x]['default_setting_subcategory'] = 'send_retry_interval'; + $array[$x]['default_setting_name'] = 'numeric'; + $array[$x]['default_setting_value'] = '15'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Delay before we make next call after answered call'; + $x++; + $array[$x]['default_setting_category'] = 'fax'; + $array[$x]['default_setting_subcategory'] = 'send_no_answer_retry_limit'; + $array[$x]['default_setting_name'] = 'numeric'; + $array[$x]['default_setting_value'] = '3'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Number of unanswered attempts in sequence'; + $x++; + $array[$x]['default_setting_category'] = 'fax'; + $array[$x]['default_setting_subcategory'] = 'send_no_answer_retry_interval'; + $array[$x]['default_setting_name'] = 'numeric'; + $array[$x]['default_setting_value'] = '30'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Delay before we make next call after no answered call'; + $x++; + $array[$x]['default_setting_category'] = 'fax'; + $array[$x]['default_setting_subcategory'] = 'send_no_answer_limit'; + $array[$x]['default_setting_name'] = 'numeric'; + $array[$x]['default_setting_value'] = '3'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Giveup reach the destination after this number of sequences'; + $x++; + $array[$x]['default_setting_category'] = 'fax'; + $array[$x]['default_setting_subcategory'] = 'send_no_answer_interval'; + $array[$x]['default_setting_name'] = 'numeric'; + $array[$x]['default_setting_value'] = '300'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Delay before next call sequence'; + $x++; //get an array of the default settings $sql = "select * from v_default_settings "; $prep_statement = $db->prepare($sql); diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 27ffdc8ca4..28d7613324 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -135,8 +135,10 @@ else { } else { $forward_prefix = $forward_prefix.$fax_forward_number.'#'; //found } - $fax_local = check_str($_POST["fax_local"]); + $fax_local = check_str($_POST["fax_local"]); //! @todo check in database $fax_description = check_str($_POST["fax_description"]); + $fax_send_greeting = check_str($_POST["fax_send_greeting"]); + $fax_send_channels = check_str($_POST["fax_send_channels"]); } //delete the user from the fax users @@ -274,6 +276,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($fax_forward_number) > 0) { $sql .= "fax_forward_number, "; } + $sql .= "fax_send_greeting,"; + $sql .= "fax_send_channels,"; $sql .= "fax_description "; $sql .= ")"; $sql .= "values "; @@ -305,6 +309,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($fax_forward_number) > 0) { $sql .= "'$fax_forward_number', "; } + $sql .= (strlen($fax_send_greeting)==0?'NULL':"'$fax_send_greeting'") . ","; + $sql .= (strlen($fax_send_channels)==0?'NULL':"'$fax_send_channels'") . ","; + $sql .= "'$fax_description' "; $sql .= ")"; $db->exec(check_sql($sql)); @@ -345,9 +352,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { else { $sql .= "fax_forward_number = null, "; } + $tmp = strlen($fax_send_greeting)==0?'NULL':"'$fax_send_greeting'"; + $sql .= "fax_send_greeting = $tmp,"; + $tmp = strlen($fax_send_channels)==0?'NULL':"'$fax_send_channels'"; + $sql .= "fax_send_channels = $tmp,"; + $sql .= "fax_description = '$fax_description' "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= "and fax_uuid = '$fax_uuid' "; + $db->exec(check_sql($sql)); unset($sql); } @@ -426,9 +440,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { $fax_caller_id_number = $row["fax_caller_id_number"]; $fax_forward_number = $row["fax_forward_number"]; $fax_description = $row["fax_description"]; + $fax_send_greeting = $row["fax_send_greeting"]; + $fax_send_channels = $row["fax_send_channels"]; } unset ($prep_statement); } + else{ + $fax_send_channels = 10; + } //replace the dash with a space $fax_name = str_replace("-", " ", $fax_name); @@ -678,6 +697,27 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; + echo "