if (!isTelephoneNumber(uri)) return uri;
if (uri.isSipURI()) {
// Since we are modifying the uri we need a copy
SipURI tmpUri = (SipURI) uri.clone();
TelURL telUrl;
try {
telUrl = convertToTelURL(tmpUri);
if (telUrl.isGlobal()) {
telUrl.setPhoneNumber("+" + com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(telUrl.getPhoneNumber()));
} else {
telUrl.setPhoneNumber(com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(telUrl.getPhoneNumber()), telUrl.getPhoneContext());
}
tmpUri.setUser(getAsSipUriUser(telUrl));
} catch (UriUtilException e) {
// This was not a phone number. Silently ignore
}
return tmpUri;
} else {
// Since we are modifying the uri we need a copy
TelURLImpl tmpUri = (TelURLImpl) uri.clone();
if (tmpUri.isGlobal()) {
tmpUri.setPhoneNumber("+" + com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(tmpUri.getPhoneNumber()));
} else {
tmpUri.setPhoneNumber(com.ericsson.ssa.sip.UriUtil.cleanupPhonenumber(tmpUri.getPhoneNumber()), tmpUri.getPhoneContext());
}
return tmpUri;
}
}