Fix editing sip account details.

cusax-fix
Damian Minkov 16 years ago
parent f36d83fb98
commit 7ad9ba2eed

@ -38,9 +38,9 @@ public class SIPAccountRegistration
private String authorizationName;
private String serverPort = DEFAULT_PORT;
private String serverPort = null;
private String proxyPort = DEFAULT_PORT;
private String proxyPort = null;
private String proxy;
@ -93,7 +93,10 @@ public String getProxy()
public void setProxy(String proxy)
{
this.proxy = proxy;
if(proxy != null && proxy.length() == 0)
this.proxy = null;
else
this.proxy = proxy;
}
/**
@ -214,7 +217,10 @@ public void setUserID(String id)
*/
public void setServerAddress(String serverAddress)
{
this.serverAddress = serverAddress;
if(serverAddress != null && serverAddress.length() == 0)
this.serverAddress = null;
else
this.serverAddress = serverAddress;
}
/**
@ -224,7 +230,10 @@ public void setServerAddress(String serverAddress)
*/
public void setServerPort(String port)
{
this.serverPort = port;
if(port != null && port.length() == 0)
this.serverPort = null;
else
this.serverPort = port;
}
/**
@ -234,7 +243,10 @@ public void setServerPort(String port)
*/
public void setDisplayName(String displayName)
{
this.displayName = displayName;
if(displayName != null && displayName.length() == 0)
this.displayName = null;
else
this.displayName = displayName;
}
/**
@ -244,7 +256,10 @@ public void setDisplayName(String displayName)
*/
public void setAuthorizationName(String authName)
{
this.authorizationName = authName;
if(authName != null && authName.length() == 0)
this.authorizationName = null;
else
this.authorizationName = authName;
}
/**
@ -254,7 +269,10 @@ public void setAuthorizationName(String authName)
*/
public void setProxyPort(String port)
{
this.proxyPort = port;
if(port != null && port.length() == 0)
this.proxyPort = null;
else
this.proxyPort = port;
}
/**

@ -329,8 +329,8 @@ private ProtocolProviderService installAccount(
String passwd)
throws OperationFailedException
{
Hashtable<String, String> accountProperties
= new Hashtable<String, String>();
HashMap<String, String> accountProperties
= new HashMap<String, String>();
accountProperties.put(ProtocolProviderFactory.PROTOCOL, getProtocol());
String protocolIconPath = getProtocolIconPath();
@ -382,31 +382,20 @@ else if(serverAddress == null &&
Boolean.toString(true));
}
if(registration.getDisplayName() != null)
accountProperties.put(ProtocolProviderFactory.DISPLAY_NAME,
registration.getDisplayName());
accountProperties.put(ProtocolProviderFactory.DISPLAY_NAME,
registration.getDisplayName());
if(registration.getAuthorizationName() != null)
accountProperties.put(ProtocolProviderFactory.AUTHORIZATION_NAME,
registration.getAuthorizationName());
accountProperties.put(ProtocolProviderFactory.AUTHORIZATION_NAME,
registration.getAuthorizationName());
String serverPort = registration.getServerPort();
if(serverPort != null && serverPort.length() > 0)
accountProperties.put(ProtocolProviderFactory.SERVER_PORT,
serverPort);
accountProperties.put(ProtocolProviderFactory.SERVER_PORT,
registration.getServerPort());
String proxyAddress = null;
if (registration.getProxy() != null)
proxyAddress = registration.getProxy();
accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS,
registration.getProxy());
if (proxyAddress != null && proxyAddress.length() > 0)
accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS,
proxyAddress);
String proxyPort = registration.getProxyPort();
if(proxyPort != null && proxyPort.length() > 0)
accountProperties.put(ProtocolProviderFactory.PROXY_PORT,
proxyPort);
accountProperties.put(ProtocolProviderFactory.PROXY_PORT,
registration.getProxyPort());
accountProperties.put(ProtocolProviderFactory.PREFERRED_TRANSPORT,
registration.getPreferredTransport());
@ -442,6 +431,9 @@ else if(serverAddress == null &&
if(registration.getKeepAliveMethod() != null)
accountProperties.put("KEEP_ALIVE_METHOD",
registration.getKeepAliveMethod());
else
accountProperties.put("KEEP_ALIVE_METHOD",
registration.getDefaultKeepAliveMethod());
accountProperties.put("KEEP_ALIVE_INTERVAL",
registration.getKeepAliveInterval());

@ -133,7 +133,7 @@ protected AccountID( String userID,
this.protocolName = protocolName;
this.userID = userID;
this.accountProperties
= new Hashtable<String, String>(accountProperties);
= new HashMap<String, String>(accountProperties);
this.serviceName = serviceName;
//create a unique identifier string
@ -211,7 +211,7 @@ public String getAccountUniqueID()
*/
public Map<String, String> getAccountProperties()
{
return new Hashtable<String, String>(accountProperties);
return new HashMap<String, String>(accountProperties);
}
public Object getAccountProperty(Object key)

Loading…
Cancel
Save