Merge pull request #154 from iant-gmbh/master

Support for HA PBX
smack4
Ingo Bauersachs 10 years ago
commit 9b0eda2b39

@ -1232,6 +1232,7 @@ plugin.sipaccregwizz.PREFERRED_TRANSPORT=Preferred transport
plugin.sipaccregwizz.ADVANCED_OPTIONS=Advanced options
plugin.sipaccregwizz.PROXY_OPTIONS=Proxy options
plugin.sipaccregwizz.PROXY_AUTO=Configure proxy automatically
plugin.sipaccregwizz.PROXY_FORCE_BYPASS=Bypass proxy security check for HA scenarios (use only if needed)
plugin.sipaccregwizz.ENABLE_PRESENCE=Enable presence (SIMPLE)
plugin.sipaccregwizz.FORCE_P2P_PRESENCE=Force peer-to-peer presence mode
plugin.sipaccregwizz.OFFLINE_CONTACT_POLLING_PERIOD=Offline contacts polling period (in s.)

@ -1027,11 +1027,21 @@ private void filterByAddress(
List<ProtocolProviderServiceSipImpl> candidates,
Request request)
{
Iterator<ProtocolProviderServiceSipImpl> iterPP = candidates.iterator();
Iterator<ProtocolProviderServiceSipImpl> iterPP =
candidates.iterator();
while (iterPP.hasNext())
{
ProtocolProviderServiceSipImpl candidate = iterPP.next();
boolean forceProxyBypass
= candidate.getAccountID()
.getAccountPropertyBoolean(
ProtocolProviderFactory.FORCE_PROXY_BYPASS, false);
if(forceProxyBypass)
{
// Proxy check is disabled all connections are
// ok (HA sipXecs, sipXcom, ...)
continue;
}
if(candidate.getRegistrarConnection() == null)
{
//RegistrarLess connections are ok

@ -63,6 +63,8 @@ public class ConnectionPanel
private final JCheckBox proxyAutoCheckBox;
private final JCheckBox proxyForceBypassCheckBox;
private final JComboBox certificate = new JComboBox();
private JComboBox transportCombo
@ -127,6 +129,24 @@ public void actionPerformed(ActionEvent e)
}
});
proxyForceBypassCheckBox = new SIPCommCheckBox(
Resources.getString("plugin.sipaccregwizz.PROXY_FORCE_BYPASS"),
regform.getRegistration().isProxyForceBypassConfigure());
enablesProxyForceBypassConfigure(
proxyForceBypassCheckBox.isSelected());
proxyForceBypassCheckBox.addActionListener(new ActionListener()
{
/**
* Invoked when an action occurs.
*/
public void actionPerformed(ActionEvent e)
{
enablesProxyForceBypassConfigure(
proxyForceBypassCheckBox.isSelected());
ConnectionPanel.this.regform.reValidateInput();
}
});
this.transportCombo.addItemListener(this);
transportCombo.setSelectedItem(
@ -185,7 +205,11 @@ public void actionPerformed(ActionEvent e)
proxyAutoCheckBox.setSelected(
regform.getRegistration().isProxyAutoConfigure());
if(!StringUtils.isNullOrEmpty(
proxyForceBypassCheckBox.setSelected(regform.getRegistration()
.isProxyForceBypassConfigure());
if (!StringUtils.isNullOrEmpty(
regform.getRegistration().getProxy()))
proxyField.setText(regform.getRegistration().getProxy());
if(!StringUtils.isNullOrEmpty(
@ -215,6 +239,8 @@ public void actionPerformed(ActionEvent e)
proxyPortPanel.add(proxyPortField, BorderLayout.EAST);
proxyPanel.add(proxyPortPanel, BorderLayout.EAST);
JPanel proxyNorthPanel =
new TransparentPanel(new GridLayout(2, 1, 10, 1));
labelsPanel = new TransparentPanel(new GridLayout(0, 1, 10, 10));
valuesPanel = new TransparentPanel(new GridLayout(0, 1, 10, 10));
@ -222,8 +248,11 @@ public void actionPerformed(ActionEvent e)
labelsPanel.add(transportLabel);
valuesPanel.add(proxyPanel);
valuesPanel.add(transportCombo);
proxyNorthPanel.add(proxyForceBypassCheckBox);
proxyNorthPanel.add(proxyAutoCheckBox);
proxyMainPanel.add(proxyAutoCheckBox, BorderLayout.NORTH);
proxyMainPanel.add(proxyNorthPanel, BorderLayout.NORTH);
proxyMainPanel.add(labelsPanel, BorderLayout.WEST);
proxyMainPanel.add(valuesPanel, BorderLayout.CENTER);
proxyMainPanel.setBorder(BorderFactory.createTitledBorder(
@ -825,6 +854,28 @@ void enablesProxyAutoConfigure(boolean isEnable)
regform.reValidateInput();
}
/**
* Indicates if the proxy force bypass-configure is enabled.
* @return <tt>true</tt> if the proxy force bypass-configuration is
* enabled, <tt>false</tt> - otherwise
*/
boolean isProxyForceBypassConfigureEnabled()
{
return proxyForceBypassCheckBox.isSelected();
}
/**
* Enables/disables the proxy force bypass-configuration.
*
* @param isEnable <tt>true</tt> to enable force proxy bypass-
* configuration, <tt>false</tt> - otherwise
*/
void enablesProxyForceBypassConfigure(boolean isEnable)
{
proxyForceBypassCheckBox.setSelected(isEnable);
regform.reValidateInput();
}
/**
* Handles the <tt>DocumentEvent</tt> triggered when user types in the
* proxy or port field. Enables or disables the "Next" wizard button

@ -297,6 +297,9 @@ public boolean commitPage(SIPAccountRegistration registration)
registration.setProxyAutoConfigure(
connectionPanel.isProxyAutoConfigureEnabled());
registration.setProxyForceBypassConfigure(
connectionPanel.isProxyForceBypassConfigureEnabled());
registration.setEnablePresence(
presencePanel.isPresenceEnabled());
registration.setForceP2PMode(
@ -381,7 +384,11 @@ public void loadAccount(SIPAccountRegistration sipAccReg)
String clientTlsCertificateId = sipAccReg.getTlsClientCertificate();
boolean proxyAutoConfigureEnabled = sipAccReg.isProxyAutoConfigure();
boolean proxyAutoConfigureEnabled =
sipAccReg.isProxyAutoConfigure();
boolean proxyForceBypassConfigureEnabled =
sipAccReg.isProxyForceBypassConfigure();
String pollingPeriod = sipAccReg.getPollingPeriod();
@ -427,7 +434,10 @@ public void loadAccount(SIPAccountRegistration sipAccReg)
connectionPanel.setAuthenticationName(authName);
connectionPanel.setCertificateId(clientTlsCertificateId);
connectionPanel.enablesProxyAutoConfigure(proxyAutoConfigureEnabled);
connectionPanel.enablesProxyAutoConfigure(
proxyAutoConfigureEnabled);
connectionPanel.enablesProxyForceBypassConfigure(
proxyForceBypassConfigureEnabled);
connectionPanel.setServerPort(serverPort);
connectionPanel.setProxy(proxyAddress);

@ -185,6 +185,27 @@ public void setProxyAutoConfigure(boolean proxyAutoConfigure)
putAccountProperty(ProtocolProviderFactory.PROXY_AUTO_CONFIG,
proxyAutoConfigure);
}
/**
* Is proxy force bypass configured.
* @return <tt>true</tt> if proxy is force bypass configured.
*/
public boolean isProxyForceBypassConfigure()
{
return getAccountPropertyBoolean(
ProtocolProviderFactory.FORCE_PROXY_BYPASS, false);
}
/**
* Sets force bypass configuration of proxy enabled or disabled.
* @param proxyForceBypassConfigure <tt>true</tt> if the proxy will bypassed
* needed for HA scenarios with load balancing.
*/
public void setProxyForceBypassConfigure(boolean proxyForceBypassConfigure)
{
putAccountProperty(ProtocolProviderFactory.FORCE_PROXY_BYPASS,
proxyForceBypassConfigure);
}
/**
* Sets the proxy port.

Loading…
Cancel
Save