From 30706fa11de4fec0658391ea226b447dd7766283 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Thu, 29 Jan 2015 07:07:54 +0000 Subject: [PATCH] Tested gateway with registration set to false on 1.4.15 no longer requires a username and password so it is no longer required in fusionpbx when the registration is set to false. --- app/gateways/gateway_edit.php | 4 ++-- .../resources/scripts/configuration/sofia.conf.lua | 10 +++------- resources/switch.php | 8 +------- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/app/gateways/gateway_edit.php b/app/gateways/gateway_edit.php index d1b3ebe41c..5ca7d19b3f 100644 --- a/app/gateways/gateway_edit.php +++ b/app/gateways/gateway_edit.php @@ -421,7 +421,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " ".$text['label-username'].":\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-username']."\n"; echo "\n"; @@ -432,7 +432,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " ".$text['label-password'].":\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo "
\n"; echo " ".$text['description-password']."\n"; echo "\n"; diff --git a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua index 2068d29926..5c20c1ff39 100644 --- a/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua +++ b/resources/install/scripts/app/xml_handler/resources/scripts/configuration/sofia.conf.lua @@ -113,7 +113,7 @@ sql = "select * from v_gateways as g, v_domains as d "; sql = sql .. "where g.profile = '"..sip_profile_name.."' "; sql = sql .. "and g.enabled = 'true' "; - sql = sql .. "and g.domain_uuid = d.domain_uuid "; + sql = sql .. "and (g.domain_uuid = d.domain_uuid or g.domain_uuid is null) "; else sql = "select * from v_gateways "; sql = sql .. "where enabled = 'true' and profile = '"..sip_profile_name.."' "; @@ -126,9 +126,7 @@ table.insert(xml, [[ ]]); if (string.len(field.username) > 0) then - table.insert(xml, [[ ]]); - else - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]);; end if (string.len(field.distinct_to) > 0) then table.insert(xml, [[ ]]); @@ -137,9 +135,7 @@ table.insert(xml, [[ ]]); end if (string.len(field.password) > 0) then - table.insert(xml, [[ ]]); - else - table.insert(xml, [[ ]]); + table.insert(xml, [[ ]]);; end if (string.len(field.realm) > 0) then table.insert(xml, [[ ]]); diff --git a/resources/switch.php b/resources/switch.php index 485779555d..e300a3ac6d 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -1808,7 +1808,7 @@ function save_gateway_xml() { //get the list of gateways and write the xml $sql = "select * from v_gateways "; - $sql .= "where domain_uuid = '$domain_uuid' "; + $sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); @@ -1827,9 +1827,6 @@ function save_gateway_xml() { if (strlen($row['username']) > 0) { $xml .= " \n"; } - else { - $xml .= " \n"; - } if (strlen($row['distinct_to']) > 0) { $xml .= " \n"; } @@ -1839,9 +1836,6 @@ function save_gateway_xml() { if (strlen($row['password']) > 0) { $xml .= " \n"; } - else { - $xml .= " \n"; - } if (strlen($row['realm']) > 0) { $xml .= " \n"; }