diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php
index d9e2d2f20b..60ae2b55e0 100644
--- a/app/dialplan_inbound/dialplan_inbound_add.php
+++ b/app/dialplan_inbound/dialplan_inbound_add.php
@@ -61,15 +61,15 @@
$destination = new destinations;
//get the http post values and set them as php variables
- if (count($_POST) > 0) {
+ if (!empty($_POST) && count($_POST) > 0) {
$dialplan_name = $_POST["dialplan_name"];
$caller_id_outbound_prefix = $_POST["caller_id_outbound_prefix"];
$limit = $_POST["limit"];
$public_order = $_POST["public_order"];
- $condition_field_1 = $_POST["condition_field_1"];
- $condition_expression_1 = $_POST["condition_expression_1"];
- $condition_field_2 = $_POST["condition_field_2"];
- $condition_expression_2 = $_POST["condition_expression_2"];
+ $condition_field_1 = $_POST["condition_field_1"] ?? null;
+ $condition_expression_1 = $_POST["condition_expression_1"] ?? null;
+ $condition_field_2 = $_POST["condition_field_2"] ?? null;
+ $condition_expression_2 = $_POST["condition_expression_2"] ?? null;
$destination_uuid = $_POST["destination_uuid"];
$action_1 = $_POST["action_1"];
@@ -78,7 +78,7 @@
$action_application_1 = array_shift($action_1_array);
$action_data_1 = join(':', $action_1_array);
- $action_2 = $_POST["action_2"];
+ $action_2 = $_POST["action_2"] ?? '';
//$action_2 = "transfer:1001 XML default";
$action_2_array = explode(":", $action_2);
$action_application_2 = array_shift($action_2_array);
@@ -105,7 +105,7 @@
$destination_number = $row["destination_number"];
$condition_expression_1 = $row["destination_number"];
$fax_uuid = $row["fax_uuid"];
- $destination_carrier = $row["destination_carrier"];
+ $destination_carrier = $row["destination_carrier"] ?? null;
$destination_accountcode = $row["destination_accountcode"];
}
unset($sql, $parameters, $row);
@@ -122,7 +122,7 @@
$condition_expression_1 = '^('.$condition_expression_1.')$';
}
}
- $dialplan_enabled = $_POST["dialplan_enabled"];
+ $dialplan_enabled = $_POST["dialplan_enabled"] ?? 'false';
$dialplan_description = $_POST["dialplan_description"];
if (empty($dialplan_enabled)) { $dialplan_enabled = "true"; } //set default to enabled
}
@@ -139,6 +139,7 @@
}
//check for all required data
+ $msg = '';
if (empty($domain_uuid)) { $msg .= "".$text['label-required-domain_uuid']."
\n"; }
if (empty($dialplan_name)) { $msg .= "".$text['label-required-dialplan_name']."
\n"; }
if (empty($condition_field_1)) { $msg .= "".$text['label-required-condition_field_1']."
\n"; }
@@ -739,7 +740,6 @@
echo "