mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-16 04:27:55 +00:00
more call success when calling a number
This commit is contained in:
parent
8b0486f169
commit
cd509ca387
1 changed files with 10 additions and 5 deletions
|
|
@ -457,16 +457,21 @@
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC);
|
LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC);
|
||||||
LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(cfg, value.UTF8String);
|
const char * normvalue;
|
||||||
|
if (linphone_proxy_config_is_phone_number(cfg, value.UTF8String)) {
|
||||||
|
normvalue = linphone_proxy_config_normalize_phone_number(cfg, value.UTF8String);
|
||||||
|
} else {
|
||||||
|
normvalue = value.UTF8String;
|
||||||
|
}
|
||||||
|
LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(cfg, normvalue);
|
||||||
|
|
||||||
// first try to find a friend with the given address
|
// first try to find a friend with the given address
|
||||||
Contact *c = [FastAddressBook getContactWithAddress:addr];
|
Contact *c = [FastAddressBook getContactWithAddress:addr];
|
||||||
if (c && c.friend) {
|
if (c && c.friend) {
|
||||||
LinphoneFriend *f = c.friend;
|
LinphoneFriend *f = c.friend;
|
||||||
const LinphonePresenceModel *m =
|
const LinphonePresenceModel *m =
|
||||||
f ? linphone_friend_get_presence_model_for_uri_or_tel(f, value.UTF8String) : NULL;
|
f ? linphone_friend_get_presence_model_for_uri_or_tel(f, normvalue) : NULL;
|
||||||
const char *contact = m ? linphone_presence_model_get_contact(m) : NULL;
|
const char *contact = m ? linphone_presence_model_get_contact(m) : NULL;
|
||||||
if (contact) {
|
if (contact) {
|
||||||
LinphoneAddress *contact_addr = linphone_address_new(contact);
|
LinphoneAddress *contact_addr = linphone_address_new(contact);
|
||||||
|
|
@ -478,7 +483,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// since user wants to escape plus, we assume it expects to have phone numbers by default
|
// since user wants to escape plus, we assume it expects to have phone numbers by default
|
||||||
if (addr && cfg && linphone_proxy_config_get_dial_escape_plus(cfg)) {
|
if (addr && cfg && (linphone_proxy_config_get_dial_escape_plus(cfg) || linphone_proxy_config_get_dial_prefix(cfg))) {
|
||||||
char *phone = linphone_proxy_config_normalize_phone_number(cfg, value.UTF8String);
|
char *phone = linphone_proxy_config_normalize_phone_number(cfg, value.UTF8String);
|
||||||
if (phone) {
|
if (phone) {
|
||||||
linphone_address_set_username(addr, phone);
|
linphone_address_set_username(addr, phone);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue