diff --git a/gui/static/js/endpointgroups.js b/gui/static/js/endpointgroups.js index 811a0ff6..4a93bbcb 100644 --- a/gui/static/js/endpointgroups.js +++ b/gui/static/js/endpointgroups.js @@ -459,37 +459,37 @@ /* listener for fusionPBX toggle */ $('.modal-body .toggleFusionPBXDomain').change(function() { - var modal = $(this).closest('div.modal'); + var self = $(this); + var modal = self.closest('div.modal'); var modal_body = modal.find('.modal-body'); - if ($(this).is(":checked") || $(this).prop("checked")) { + if (self.is(":checked") || self.prop("checked")) { modal_body.find('.FusionPBXDomainOptions').removeClass("hidden"); modal_body.find('.fusionpbx_db_enabled').val(1); - - /* uncheck other toggles */ - //modal_body.find(".toggleFreePBXDomain").bootstrapToggle('off'); + self.bootstrapToggle('on'); } else { modal_body.find('.FusionPBXDomainOptions').addClass("hidden"); modal_body.find('.fusionpbx_db_enabled').val(0); + self.bootstrapToggle('off'); } }); /* listener for freePBX toggle */ $('.modal-body .toggleFreePBXDomain').change(function() { - var modal = $(this).closest('div.modal'); + var self = $(this); + var modal = self.closest('div.modal'); var modal_body = modal.find('.modal-body'); - if ($(this).is(":checked") || $(this).prop("checked")) { + if (self.is(":checked") || self.prop("checked")) { modal_body.find('.FreePBXDomainOptions').removeClass("hidden"); modal_body.find('.freepbx_enabled').val(1); - - /* uncheck other toggles */ - modal_body.find(".toggleFusionPBXDomain").bootstrapToggle('off'); + self.bootstrapToggle('on'); } else { modal_body.find('.FreePBXDomainOptions').addClass("hidden"); modal_body.find('.freepbx_enabled').val(0); + self.bootstrapToggle('off'); } }); diff --git a/gui/templates/endpointgroups.html b/gui/templates/endpointgroups.html index 45637703..b2519691 100644 --- a/gui/templates/endpointgroups.html +++ b/gui/templates/endpointgroups.html @@ -143,7 +143,9 @@
DSIPROUTER_IP={{dsiprouter_ip}}
-sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" /etc/postgresql/*/main/postgresql.conf
+
iptables -A INPUT -p udp -s <dsip ip address>/32 --dport <pbx sip port> -j ACCEPT
-iptables-save
+ DSIPROUTER_IP={{ dsiprouter_ip }}
+PBX_SIP_PORTS=(5060 5080)
+for PORT in ${PBX_SIP_PORTS[@]}; do
+ iptables -A INPUT -p udp -s $DSIPROUTER_IP/32 --dport $PORT -j ACCEPT
+done
+iptables-save >/etc/iptables/rules.v4
# Run this command if your using fail2ban
-sed -i -r "s|(ignoreip = .*)|\1 {{dsiprouter_ip}}/32|" /etc/fail2ban/jail.conf
+sed -i -r "s|(ignoreip = .*)|\1 $DSIPROUTER_IP/32|" /etc/fail2ban/jail.conf
systemctl restart fail2ban
@@ -362,7 +368,9 @@ Add Endpoint Group Details
Hostname/IP
Description
Weight
-
+
+
+
@@ -432,42 +440,43 @@ Add Endpoint Group Details
FusionPBX Domain Support
-
+
-
-
-
-
-
-
- You need access to the FusionPBX database. Run these commands as root on the FusionPBX server.
- Replace <ip address> with the ip address of this server.
-
- DSIPROUTER_IP={{dsiprouter_ip}}
+
+
+
+
+
@@ -475,12 +484,16 @@ Add Endpoint Group Details
Run these commands as root on the FreePBX server.
- Replace values within angle brackets '<value>' with your own values.
+ Replace PBX_SIP_PORTS with your own values if they are not set to the defaults.
- iptables -A INPUT -p udp -s <dsip ip address>/32 --dport <pbx sip port> -j ACCEPT
-iptables-save
+ DSIPROUTER_IP={{ dsiprouter_ip }}
+PBX_SIP_PORTS=(5060 5080)
+for PORT in ${PBX_SIP_PORTS[@]}; do
+ iptables -A INPUT -p udp -s $DSIPROUTER_IP/32 --dport $PORT -j ACCEPT
+done
+iptables-save >/etc/iptables/rules.v4
# Run this command if your using fail2ban
-sed -i -r "s|(ignoreip = .*)|\1 <{{dsiprouter_ip}}>/32|" /etc/fail2ban/jail.conf
+sed -i -r "s|(ignoreip = .*)|\1 $DSIPROUTER_IP/32|" /etc/fail2ban/jail.conf
systemctl restart fail2ban