liblinphone: fix sip address parsing (missing linphone_proxy_config_normalize_sip_uri paramater)

This commit is contained in:
Gautier Pelloux-Prayer 2015-11-24 10:25:27 +01:00
parent 9d93265706
commit c549024029
8 changed files with 10 additions and 14 deletions

View file

@ -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];

View file

@ -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 = @{

View file

@ -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;

View file

@ -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 "

View file

@ -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];

View file

@ -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) {

View file

@ -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;

@ -1 +1 @@
Subproject commit c4d781f152cb67f905610511a2a31b0427eaf8a7
Subproject commit 1d13688204c1cf189ba5036dcc67e5d07451d145