From 9d432546034b3396eb22094355cb3ce44ef6bbc9 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 24 Mar 2025 18:29:09 -0600 Subject: [PATCH] Set enabled to true by default --- .../dialplan_outbound_add.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/app/dialplan_outbound/dialplan_outbound_add.php b/app/dialplan_outbound/dialplan_outbound_add.php index 2db18d3f3c..3538e12c1e 100644 --- a/app/dialplan_outbound/dialplan_outbound_add.php +++ b/app/dialplan_outbound/dialplan_outbound_add.php @@ -70,30 +70,37 @@ $toll_allow = $_POST["toll_allow"] ?? ''; $pin_numbers_enable = $_POST["pin_numbers_enabled"] ?? null; if (empty($pin_numbers_enable)) { $pin_numbers_enable = "false"; } + //set the default type $gateway_type = 'gateway'; $gateway_2_type = 'gateway'; $gateway_3_type = 'gateway'; + //set the gateway type to bridge if (strtolower(substr($gateway, 0, 6)) == "bridge") { $gateway_type = 'bridge'; } + //set the type to enum if (strtolower(substr($gateway, 0, 4)) == "enum") { $gateway_type = 'enum'; } + //set the type to freetdm if (strtolower(substr($gateway, 0, 7)) == "freetdm") { $gateway_type = 'freetdm'; } + //set the type to transfer if (strtolower(substr($gateway, 0, 8)) == "transfer") { $gateway_type = 'transfer'; } + //set the type to dingaling if (strtolower(substr($gateway, 0, 4)) == "xmpp") { $gateway_type = 'xmpp'; } + //set the gateway_uuid and gateway_name if ($gateway_type == "gateway") { $gateway_array = explode(":",$gateway); @@ -107,26 +114,32 @@ //set the gateway_2 variable $gateway_2 = $_POST["gateway_2"]; + //set the type to bridge if (strtolower(substr($gateway_2, 0, 6)) == "bridge") { $gateway_2_type = 'bridge'; } + //set type to enum if (strtolower(substr($gateway_2, 0, 4)) == "enum") { $gateway_2_type = 'enum'; } + //set the type to freetdm if (strtolower(substr($gateway_2, 0, 7)) == "freetdm") { $gateway_2_type = 'freetdm'; } + //set the type to transfer if (strtolower(substr($gateway_2, 0, 8)) == "transfer") { $gateway_type = 'transfer'; } + //set the type to dingaling if (strtolower(substr($gateway_2, 0, 4)) == "xmpp") { $gateway_2_type = 'xmpp'; } + //set the gateway_2_id and gateway_2_name if ($gateway_2_type == "gateway" && !empty($_POST["gateway_2"])) { $gateway_2_array = explode(":",$gateway_2); @@ -140,26 +153,32 @@ //set the gateway_3 variable $gateway_3 = $_POST["gateway_3"]; + //set the type to bridge if (strtolower(substr($gateway_3, 0, 6)) == "bridge") { $gateway_3_type = 'bridge'; } + //set the type to enum if (strtolower(substr($gateway_3, 0, 4)) == "enum") { $gateway_3_type = 'enum'; } + //set the type to freetdm if (strtolower(substr($gateway_3, 0, 7)) == "freetdm") { $gateway_3_type = 'freetdm'; } + //set the type to dingaling if (strtolower(substr($gateway_3, 0, 4)) == "xmpp") { $gateway_3_type = 'xmpp'; } + //set the type to transfer if (strtolower(substr($gateway_3, 0, 8)) == "transfer") { $gateway_type = 'transfer'; } + //set the gateway_3_id and gateway_3_name if ($gateway_3_type == "gateway" && !empty($_POST["gateway_3"])) { $gateway_3_array = explode(":",$gateway_3); @@ -170,6 +189,7 @@ $gateway_3_id = ''; $gateway_3_name = ''; } + //set additional variables $dialplan_enabled = $_POST["dialplan_enabled"] ?? 'false'; $dialplan_description = $_POST["dialplan_description"]; @@ -881,6 +901,9 @@ unset($sql, $parameters); } +//set defaults + if (empty($dialplan_enabled)) { $dialplan_enabled = "true"; } + //create token $object = new token; $token = $object->create($_SERVER['PHP_SELF']);