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.
This commit is contained in:
+3
-7
@@ -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, [[ <gateway name="]] .. string.lower(field.gateway_uuid) .. [[">]]);
|
||||
|
||||
if (string.len(field.username) > 0) then
|
||||
table.insert(xml, [[ <param name="username" value="]] .. field.username .. [["/>]]);
|
||||
else
|
||||
table.insert(xml, [[ <param name="username" value="register:false"/>]]);
|
||||
table.insert(xml, [[ <param name="username" value="]] .. field.username .. [["/>]]);;
|
||||
end
|
||||
if (string.len(field.distinct_to) > 0) then
|
||||
table.insert(xml, [[ <param name="distinct-to" value="]] .. field.distinct_to .. [["/>]]);
|
||||
@@ -137,9 +135,7 @@
|
||||
table.insert(xml, [[ <param name="auth-username" value="]] .. field.auth_username .. [["/>]]);
|
||||
end
|
||||
if (string.len(field.password) > 0) then
|
||||
table.insert(xml, [[ <param name="password" value="]] .. field.password .. [["/>]]);
|
||||
else
|
||||
table.insert(xml, [[ <param name="password" value="register:false"/>]]);
|
||||
table.insert(xml, [[ <param name="password" value="]] .. field.password .. [["/>]]);;
|
||||
end
|
||||
if (string.len(field.realm) > 0) then
|
||||
table.insert(xml, [[ <param name="realm" value="]] .. field.realm .. [["/>]]);
|
||||
|
||||
@@ -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 .= " <param name=\"username\" value=\"" . $row['username'] . "\"/>\n";
|
||||
}
|
||||
else {
|
||||
$xml .= " <param name=\"username\" value=\"register:false\"/>\n";
|
||||
}
|
||||
if (strlen($row['distinct_to']) > 0) {
|
||||
$xml .= " <param name=\"distinct-to\" value=\"" . $row['distinct_to'] . "\"/>\n";
|
||||
}
|
||||
@@ -1839,9 +1836,6 @@ function save_gateway_xml() {
|
||||
if (strlen($row['password']) > 0) {
|
||||
$xml .= " <param name=\"password\" value=\"" . $row['password'] . "\"/>\n";
|
||||
}
|
||||
else {
|
||||
$xml .= " <param name=\"password\" value=\"register:false\"/>\n";
|
||||
}
|
||||
if (strlen($row['realm']) > 0) {
|
||||
$xml .= " <param name=\"realm\" value=\"" . $row['realm'] . "\"/>\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user