diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index a6de82ed7..9dd2ae315 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -44,7 +44,7 @@ }]; // also add current entry, if not listed NSString *nsuri = filter.lowercaseString; - LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, nsuri.UTF8String); + LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], nsuri.UTF8String); if (addr) { char *uri = linphone_address_as_string(addr); nsuri = [NSString stringWithUTF8String:uri]; diff --git a/Classes/ContactDetailsTableView.m b/Classes/ContactDetailsTableView.m index 9bd1e9a9e..abbd1f9a8 100644 --- a/Classes/ContactDetailsTableView.m +++ b/Classes/ContactDetailsTableView.m @@ -271,7 +271,7 @@ if ([lDict objectForKey:(__bridge NSString *)kABPersonInstantMessageServiceKey] == nil) { /*too bad probably a gtalk number, storing uri*/ NSString *username = [lDict objectForKey:(NSString *)kABPersonInstantMessageUsernameKey]; - LinphoneAddress *address = linphone_proxy_config_normalize_sip_uri(NULL, [username UTF8String]); + LinphoneAddress *address = linphone_core_interpret_url([LinphoneManager getLc], [username UTF8String]); if (address) { char *uri = linphone_address_as_string_uri_only(address); NSDictionary *dict2 = @{ diff --git a/Classes/ContactDetailsView.m b/Classes/ContactDetailsView.m index eb9f284da..def1ee196 100644 --- a/Classes/ContactDetailsView.m +++ b/Classes/ContactDetailsView.m @@ -124,7 +124,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info } - (void)addCurrentContactContactField:(NSString *)address { - LinphoneAddress *linphoneAddress = linphone_proxy_config_normalize_sip_uri(NULL, address.UTF8String); + LinphoneAddress *linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], address.UTF8String); NSString *username = linphoneAddress ? [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)] : address; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index c2624fbb7..78208ddf6 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1917,7 +1917,7 @@ static void audioRouteChangeListenerCallback(void *inUserData, // 1 // Continue by checking that the provided address is a valid SIP address, abort otherwise. if ([address length] == 0) { // no address provided... nothing to do - } else if ((addr = linphone_proxy_config_normalize_sip_uri(NULL, address.UTF8String)) == NULL) { + } else if ((addr = linphone_core_interpret_url([LinphoneManager getLc], address.UTF8String)) == NULL) { UIAlertView *error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid SIP address", nil) message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a " diff --git a/Classes/LinphoneUI/UIContactDetailsCell.m b/Classes/LinphoneUI/UIContactDetailsCell.m index 4aca6345c..2d301fdbd 100644 --- a/Classes/LinphoneUI/UIContactDetailsCell.m +++ b/Classes/LinphoneUI/UIContactDetailsCell.m @@ -43,7 +43,7 @@ - (void)setAddress:(NSString *)address { _addressLabel.text = _editTextfield.text = address; - LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, _addressLabel.text.UTF8String); + LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String); _chatButton.enabled = _callButton.enabled = (addr != NULL); _chatButton.accessibilityLabel = @@ -75,7 +75,7 @@ } - (IBAction)onCallClick:(id)event { - LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, _addressLabel.text.UTF8String); + LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String); if (addr == NULL) return; char *lAddress = linphone_address_as_string_uri_only(addr); @@ -89,7 +89,7 @@ } - (IBAction)onChatClick:(id)event { - LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, _addressLabel.text.UTF8String); + LinphoneAddress *addr = linphone_core_interpret_url([LinphoneManager getLc], _addressLabel.text.UTF8String); if (addr == NULL) return; [PhoneMainView.instance changeCurrentView:ChatsListView.compositeViewDescription]; diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 3580fdfe9..251ba6fe1 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -90,7 +90,7 @@ static void sync_address_book(ABAddressBookRef addressBook, CFDictionaryRef info address = [[address componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] componentsJoinedByString:@" "]; NSString *normalizedSipAddress = nil; - LinphoneAddress *linphoneAddress = linphone_proxy_config_normalize_sip_uri(NULL, [address UTF8String]); + LinphoneAddress *linphoneAddress = linphone_core_interpret_url([LinphoneManager getLc], [address UTF8String]); if (linphoneAddress != NULL) { char *tmp = linphone_address_as_string_uri_only(linphoneAddress); if (tmp != NULL) { diff --git a/TestsUI/LinphoneTestCase.m b/TestsUI/LinphoneTestCase.m index a08b9c64c..f3753090c 100644 --- a/TestsUI/LinphoneTestCase.m +++ b/TestsUI/LinphoneTestCase.m @@ -78,18 +78,14 @@ while (proxies) { LinphoneProxyConfig *cfg = (LinphoneProxyConfig *)proxies->data; const char *domain = linphone_proxy_config_get_domain(cfg); - const char *identity = linphone_proxy_config_get_identity(cfg); - LinphoneAddress *addr = linphone_proxy_config_normalize_sip_uri(NULL, identity); + const LinphoneAddress *addr = linphone_proxy_config_get_identity_address(cfg); const char *username = linphone_address_get_username(addr); if (addr && (username && strcmp(username, [[self me] UTF8String]) == 0) && (domain && strcmp(domain, [[self accountDomain] UTF8String]) == 0) && linphone_proxy_config_get_state(cfg) == LinphoneRegistrationOk) { isOK = true; - linphone_address_destroy(addr); break; - } else if (addr) { - linphone_address_destroy(addr); } proxies = proxies->next; diff --git a/submodules/linphone b/submodules/linphone index c4d781f15..1d1368820 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit c4d781f152cb67f905610511a2a31b0427eaf8a7 +Subproject commit 1d13688204c1cf189ba5036dcc67e5d07451d145