Check for valid fax numbers
Validate the fax destination number - Check outbound routes - Check valid extension - Set the status to failed for all other numbers
This commit is contained in:
parent
1a10543851
commit
475696ecff
|
|
@ -275,9 +275,23 @@
|
|||
}
|
||||
$route_array = outbound_route_to_bridge($domain_uuid, $fax_prefix . $fax_number, $channel_variables);
|
||||
if (count($route_array) == 0) {
|
||||
//check for valid extension
|
||||
$sql = "select count(extension_uuid) ";
|
||||
$sql .= "from v_extensions ";
|
||||
$sql .= "where extension = :fax_number ";
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$parameters['fax_number'] = $fax_number;
|
||||
$database = new database;
|
||||
$extension_count = $database->select($sql, $parameters, 'column');
|
||||
if ($extension_count > 0) {
|
||||
//send the internal call to the registered extension
|
||||
$route_array[] = "user/".$fax_number."@".$domain_name;
|
||||
}
|
||||
else {
|
||||
$fax_status = 'failed';
|
||||
}
|
||||
}
|
||||
|
||||
//set the origination uuid
|
||||
$origination_uuid = uuid();
|
||||
|
|
@ -322,7 +336,9 @@
|
|||
$fax_instance_id = pathinfo($fax_file, PATHINFO_FILENAME);
|
||||
|
||||
//set the fax status
|
||||
if (empty($fax_status)) {
|
||||
$fax_status = 'sending';
|
||||
}
|
||||
|
||||
//update the database to say status to trying and set the command
|
||||
$array['fax_queue'][0]['fax_queue_uuid'] = $fax_queue_uuid;
|
||||
|
|
|
|||
Loading…
Reference in New Issue