Fixed normalizedPhoneNumber use

This commit is contained in:
Sylvain Berfini 2017-11-29 10:16:52 +01:00
parent d579948c7f
commit 0e13ceb15d
4 changed files with 10 additions and 9 deletions

View file

@ -566,16 +566,14 @@ public class LinphoneManager implements CoreListener, ChatMessageListener, Senso
}
}
ProxyConfig lpc = getLc().getDefaultProxyConfig();
/*if (lpc != null) {
to = lpc.normalizePhoneNumber(to);
}*/
Address lAddress;
lAddress = mLc.interpretUrl(to);
lAddress = mLc.interpretUrl(to); // InterpretUrl does normalizePhoneNumber
if (lAddress == null) {
Log.e("Couldn't convert to String to Address : " + to);
return;
}
ProxyConfig lpc = mLc.getDefaultProxyConfig();
if (mR.getBoolean(R.bool.forbid_self_call) && lpc != null && lAddress.asStringUriOnly().equals(lpc.getIdentityAddress())) {
return;
}

View file

@ -144,10 +144,12 @@ public class ContactDetailsFragment extends Fragment implements OnClickListener
ProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
if (lpc != null && !noa.isSIPAddress()) {
if (lpc != null) {
String username = lpc.normalizePhoneNumber(displayednumberOrAddress);
if (username != null) {
value = LinphoneUtils.getFullAddressFromUsername(username);
}
}
String contactAddress = contact.getPresenceModelForUriOrTel(noa.getValue());
if (contactAddress != null) {

View file

@ -231,6 +231,7 @@ public class ContactsManager extends ContentObserver {
}
if (lpc == null) return null;
String normalized = lpc.normalizePhoneNumber(phoneNumber);
if (normalized == null) normalized = phoneNumber;
Address addr = lpc.normalizeSipUri(normalized);
if (addr == null) {

@ -1 +1 @@
Subproject commit 94a51d3ec1b7dd69fd595e1eab50fda72c33dbda
Subproject commit 447076eadcd364815cc105578676d5579b358aa0