Fix a bug when saving sip account with different registrar changing user_id property, reported by Bauersachs Ingo.

Fix request uri when using registrar address different from user id server part, , reported by Bauersachs Ingo.
Don't construct account uid string every time, if it exists loaded it from the account props.
cusax-fix
Damian Minkov 15 years ago
parent cb5e87d2d2
commit 6713576cbd

@ -1036,7 +1036,8 @@ public Request createRegisterRequest(Address addressOfRecord,
.getMaxForwardsHeader();
//create a host-only uri for the request uri header.
String domain = ((SipURI) toHeader.getAddress().getURI()).getHost();
String domain = protocolProvider.getAccountID().
getAccountPropertyString(ProtocolProviderFactory.SERVER_ADDRESS);
//Request URI
SipURI requestURI = protocolProvider.getAddressFactory()

@ -369,13 +369,15 @@ public void loadAccount(AccountID accountID)
String xCapPassword =
accountID.getAccountPropertyString("XCAP_PASSWORD");
connectionPanel.setServerOverridden(
accountID.getAccountPropertyBoolean(
ProtocolProviderFactory.IS_SERVER_OVERRIDDEN, false));
boolean isServerOverridden = accountID.getAccountPropertyBoolean(
ProtocolProviderFactory.IS_SERVER_OVERRIDDEN, false);
connectionPanel.setServerOverridden(isServerOverridden);
accountPanel.setUserIDEnabled(false);
accountPanel.setUserID((serverAddress == null) ? accountID.getUserID()
: (accountID.getUserID() + "@" + serverAddress));
: accountID.getAccountPropertyString(
ProtocolProviderFactory.USER_ID));
if (password != null)
{
@ -384,7 +386,7 @@ public void loadAccount(AccountID accountID)
}
connectionPanel.setServerAddress(serverAddress);
connectionPanel.setServerEnabled(false);
connectionPanel.setServerEnabled(isServerOverridden);
if (displayName != null && displayName.length() > 0)
accountPanel.setDisplayName(displayName);

@ -413,6 +413,9 @@ else if(serverAddress == null &&
}
else
{
accountProperties.put(ProtocolProviderFactory.PROXY_AUTO_CONFIG,
Boolean.FALSE.toString());
accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS,
registration.getProxy());

@ -112,6 +112,9 @@ private static final String getOverriddenProtocolName(
/**
* Creates an account id for the specified provider userid and
* accountProperties.
* If account uid exists in account properties, we are loading the account
* and so load its value from there, prevent changing account uid
* when server changed (serviceName has changed).
* @param userID a String that uniquely identifies the user.
* @param accountProperties a Map containing any other protocol and
* implementation specific account initialization properties
@ -140,13 +143,23 @@ protected AccountID( String userID,
= new HashMap<String, String>(accountProperties);
this.serviceName = serviceName;
//create a unique identifier string
this.accountUID
= protocolDisplayName
+ ":"
+ userID
+ "@"
+ ((serviceName == null) ? "" : serviceName);
String existingAccountUID =
accountProperties.get(ProtocolProviderFactory.ACCOUNT_UID);
if(existingAccountUID == null)
{
//create a unique identifier string
this.accountUID
= protocolDisplayName
+ ":"
+ userID
+ "@"
+ ((serviceName == null) ? "" : serviceName);
}
else
{
this.accountUID = existingAccountUID;
}
}
/**

Loading…
Cancel
Save