From 51bf02f8d71b172f65618d4976ac8a420bef5d33 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 12 Feb 2018 10:27:16 +0100 Subject: [PATCH 01/23] factorize test of sip service --- Classes/Contact.m | 7 +++---- Classes/ContactDetailsTableView.m | 7 ++----- Classes/Utils/FastAddressBook.h | 5 +++-- Classes/Utils/FastAddressBook.m | 15 +++++++++++++++ 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/Classes/Contact.m b/Classes/Contact.m index 4974e1339..f868d5e23 100644 --- a/Classes/Contact.m +++ b/Classes/Contact.m @@ -39,10 +39,9 @@ if ([_person respondsToSelector:NSSelectorFromString( CNInstantMessageAddressUsernameKey)] || [_person respondsToSelector:NSSelectorFromString(CNContactInstantMessageAddressesKey)]) { if (_person.instantMessageAddresses != NULL) { for (CNLabeledValue *sipAddr in _person.instantMessageAddresses) { - NSString *username = sipAddr.value.username; - NSString *service = sipAddr.value.service; - if (username && ([service isEqualToString:LinphoneManager.instance.contactSipField] || ([service isEqualToString:@"INSTANT_MESSAGING_NAME"] && [FastAddressBook isSipURI:username]))){ - [_sipAddresses addObject:username]; + if ([FastAddressBook isSipAddress:sipAddr]) { + NSString *username = sipAddr.value.username; + [_sipAddresses addObject:username]; } } } diff --git a/Classes/ContactDetailsTableView.m b/Classes/ContactDetailsTableView.m index a7685e5bc..19c1cc99b 100644 --- a/Classes/ContactDetailsTableView.m +++ b/Classes/ContactDetailsTableView.m @@ -102,11 +102,8 @@ NSInteger count = 0; if (mCNContact.instantMessageAddresses != NULL) { for (CNLabeledValue *sipAddr in mCNContact.instantMessageAddresses) { - NSString *username = sipAddr.value.username; - NSString *service = sipAddr.value.service; - if (username && ([service isEqualToString:LinphoneManager.instance.contactSipField] || ([service isEqualToString:@"INSTANT_MESSAGING_NAME"] && [FastAddressBook isSipURI:username]))){ - count ++; - } + if ([FastAddressBook isSipAddress:sipAddr]) + count++; } } return count; diff --git a/Classes/Utils/FastAddressBook.h b/Classes/Utils/FastAddressBook.h index 2c7224830..1d008b036 100644 --- a/Classes/Utils/FastAddressBook.h +++ b/Classes/Utils/FastAddressBook.h @@ -51,8 +51,9 @@ + (NSString *)displayNameForContact:(Contact *)person; + (NSString *)displayNameForAddress:(const LinphoneAddress *)addr; -+ (BOOL)isSipURI:(NSString *)address; // should be removed -+ (NSString *)normalizeSipURI:(NSString *)address; // should be removed ++ (BOOL)isSipURI:(NSString *)address; ++ (BOOL)isSipAddress:(CNLabeledValue *)sipAddr; ++ (NSString *)normalizeSipURI:(NSString *)address; + (NSString *)localizedLabel:(NSString *)label; - (void)registerAddrsFor:(Contact *)contact; diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 7378e20b6..9b6ec51a1 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -89,6 +89,21 @@ return [address hasPrefix:@"sip:"] || [address hasPrefix:@"sips:"]; } ++ (BOOL)isSipAddress:(CNLabeledValue *)sipAddr { + NSString *username = sipAddr.value.username; + NSString *service = sipAddr.value.service; + if (!username) + return FALSE; + + if ([service isEqualToString:LinphoneManager.instance.contactSipField]) + return TRUE; + + if (([service isEqualToString:@"INSTANT_MESSAGING_NAME"] || [service isEqualToString:@"IM_SERVICE_NAME"]) && [FastAddressBook isSipURI:username]) + return TRUE; + + return FALSE; +} + + (NSString *)normalizeSipURI:(NSString *)address { // replace all whitespaces (non-breakable, utf8 nbsp etc.) by the "classical" whitespace NSString *normalizedSipAddress = nil; From e28918bbdff9cf431b218c87d8c0c9b2cae3c998 Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Thu, 8 Feb 2018 11:39:16 +0100 Subject: [PATCH 02/23] [ChatCreate] update fix chat create new conversation search --- Classes/ChatConversationCreateTableView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index c07dd7b76..c91d83397 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -95,7 +95,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSString *uri; - LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:[_sortedAddresses objectAtIndex:indexPath.row]]; + LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:[_contactsAddresses objectAtIndex:indexPath.row]]; if (addr) { uri = [NSString stringWithUTF8String:linphone_address_as_string(addr)]; } else { From 870852c522dfe91fadad7aafe2390172059da76e Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Thu, 15 Feb 2018 10:46:41 +0100 Subject: [PATCH 03/23] [DialPrefix] fix country code prefix automatically added on call --- Classes/Utils/Utils.m | 84 ++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/Classes/Utils/Utils.m b/Classes/Utils/Utils.m index 443c87f31..9ffea111a 100644 --- a/Classes/Utils/Utils.m +++ b/Classes/Utils/Utils.m @@ -454,53 +454,47 @@ } + (LinphoneAddress *)normalizeSipOrPhoneAddress:(NSString *)value { - if (!value || [value isEqualToString:@""]) { - return NULL; - } - LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC); - 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 - Contact *c = [FastAddressBook getContactWithAddress:addr]; + if (!value || [value isEqualToString:@""]) { + return NULL; + } + LinphoneProxyConfig *cfg = linphone_core_get_default_proxy_config(LC); + 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 + Contact *c = [FastAddressBook getContactWithAddress:addr]; - if (c && c.friend) { - LinphoneFriend *f = c.friend; - const LinphonePresenceModel *m = - f ? linphone_friend_get_presence_model_for_uri_or_tel(f, - value.UTF8String) - : NULL; - const char *contact = m ? linphone_presence_model_get_contact(m) : NULL; - if (contact) { - LinphoneAddress *contact_addr = linphone_address_new(contact); - if (contact_addr) { - linphone_address_destroy(addr); - return contact_addr; - } - } - } + if (c && c.friend) { + LinphoneFriend *f = c.friend; + const LinphonePresenceModel *m = f ? linphone_friend_get_presence_model_for_uri_or_tel(f, value.UTF8String) : NULL; + const char *contact = m ? linphone_presence_model_get_contact(m) : NULL; + if (contact) { + LinphoneAddress *contact_addr = linphone_address_new(contact); + if (contact_addr) { + linphone_address_destroy(addr); + return contact_addr; + } + } + } - // since user wants to escape plus, we assume it expects to have phone - // numbers by default - if (addr) { - if (cfg && (linphone_proxy_config_get_dial_escape_plus(cfg))) { - if (linphone_proxy_config_is_phone_number(cfg, normvalue)) { - linphone_address_set_username(addr, normvalue); - } - } else { - if (linphone_proxy_config_is_phone_number(cfg, value.UTF8String)) { - linphone_address_set_username(addr, value.UTF8String); - } - } - } - - return addr; + // since user wants to escape plus, we assume it expects to have phone + // numbers by default + if (addr) { + if (cfg || (linphone_proxy_config_get_dial_escape_plus(cfg))) { + if (linphone_proxy_config_is_phone_number(cfg, normvalue)) { + linphone_address_set_username(addr, normvalue); + } + } else { + if (linphone_proxy_config_is_phone_number(cfg, value.UTF8String)) { + linphone_address_set_username(addr, value.UTF8String); + } + } + } + return addr; } @end From 2a595c83a2bddf9b92d4f65b1cd11d50d404ddcb Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 20 Feb 2018 11:48:39 +0100 Subject: [PATCH 04/23] update linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index fd4827f90..10702c5f3 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit fd4827f907e7b24ae97e675f52204a321ec1ce57 +Subproject commit 10702c5f36bd3fa80e0944e972248e1513a1cea4 From 5b821df4eaff2bf3ebe23780d79b5d5dcd505379 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 16 Feb 2018 10:42:24 +0100 Subject: [PATCH 05/23] sort create chat room view alphabetically --- Classes/ChatConversationCreateTableView.m | 38 ++++++++++------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index c91d83397..b76cd6891 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -13,7 +13,7 @@ @interface ChatConversationCreateTableView () -@property(nonatomic, strong) NSMutableDictionary *contacts; +@property(nonatomic, strong) NSMutableArray *addresses; @property(nonatomic, strong) NSDictionary *allContacts; @property(nonatomic, strong) NSMutableArray *contactsAddresses; @property(nonatomic, strong) NSArray *sortedAddresses; @@ -32,24 +32,23 @@ else return [[first.firstName lowercaseString] compare:[second.firstName lowercaseString]]; }]; - self.contacts = [[NSMutableDictionary alloc] initWithCapacity:_allContacts.count]; + self.contactsAddresses = [NSMutableArray array]; - [_searchBar becomeFirstResponder]; + _addresses = [[NSMutableArray alloc] initWithCapacity:_sortedAddresses.count]; [_searchBar setText:@""]; [self searchBar:_searchBar textDidChange:_searchBar.text]; self.tableView.accessibilityIdentifier = @"Suggested addresses"; } - (void)reloadDataWithFilter:(NSString *)filter { - [_contacts removeAllObjects]; + [_addresses removeAllObjects]; [_contactsAddresses removeAllObjects]; for (NSString* key in _sortedAddresses){ NSString *address = (NSString *)key; NSString *name = [FastAddressBook displayNameForContact:[_allContacts objectForKey:key]]; if ((filter.length == 0) || ([name.lowercaseString containsSubstring:filter.lowercaseString]) || ([address.lowercaseString containsSubstring:filter.lowercaseString])) { - [_contacts setObject:name forKey:address] ; - [_contactsAddresses insertObject:address atIndex:[_contactsAddresses count]]; + [_addresses addObject:key]; } } // also add current entry, if not listed @@ -61,10 +60,10 @@ ms_free(uri); linphone_address_destroy(addr); } - if (nsuri.length > 0 && [_contacts valueForKey:nsuri] == nil) { - [_contacts setObject:filter forKey:nsuri] ; - [_contactsAddresses insertObject:nsuri atIndex:[_contactsAddresses count]]; - } + + if (nsuri.length > 0 && ![_addresses containsObject:nsuri]) + [_addresses addObject:nsuri]; + [self.tableView reloadData]; } @@ -73,7 +72,7 @@ } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - return [self.contacts count]; + return _addresses.count; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -81,14 +80,11 @@ UIChatCreateCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; if (cell == nil) { cell = [[UIChatCreateCell alloc] initWithIdentifier:kCellId]; - } - LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:[_contactsAddresses objectAtIndex:indexPath.row]]; - cell.displayNameLabel.text = [_contacts objectForKey:[_contactsAddresses objectAtIndex:indexPath.row]]; - if (addr) { - cell.addressLabel.text = [NSString stringWithUTF8String:linphone_address_as_string(addr)]; - } else { - cell.addressLabel.text = [_contacts.allKeys objectAtIndex:indexPath.row]; - } + + NSString *key = [_addresses objectAtIndex:indexPath.row]; + LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:key]; + cell.displayNameLabel.text = [FastAddressBook displayNameForAddress:addr]; + cell.addressLabel.text = [NSString stringWithUTF8String:linphone_address_as_string(addr)]; return cell; } @@ -99,7 +95,7 @@ if (addr) { uri = [NSString stringWithUTF8String:linphone_address_as_string(addr)]; } else { - uri = [_contacts.allKeys objectAtIndex:indexPath.row]; + uri = [_addresses objectAtIndex:indexPath.row]; } LinphoneChatRoom *room = linphone_core_get_chat_room_from_uri(LC, uri.UTF8String); if (!room) { @@ -108,7 +104,7 @@ message:NSLocalizedString(@"Please specify the entire SIP address for the chat", nil) preferredStyle:UIAlertControllerStyleAlert]; - + UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; From ad882406f9d6bd30ae3bec90138d575203e3a0e6 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Wed, 21 Feb 2018 15:47:51 +0100 Subject: [PATCH 06/23] fix build --- Classes/ChatConversationCreateTableView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index b76cd6891..e45440710 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -78,7 +78,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *kCellId = NSStringFromClass(UIChatCreateCell.class); UIChatCreateCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId]; - if (cell == nil) { + if (cell == nil) cell = [[UIChatCreateCell alloc] initWithIdentifier:kCellId]; NSString *key = [_addresses objectAtIndex:indexPath.row]; From b3c053f8e8369b4b1a721851b641b25044072539 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 22 Feb 2018 11:42:32 +0100 Subject: [PATCH 07/23] fix typo in READMe --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77337da66..7a6f948bd 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ After the SDK has been built, add all the `.framework` files located in `liblinp Make sure that your project FRAMEWORK_SEARCH_PATHS contains "$(PROJECT_DIR)/liblinphone-sdk/apple-darwin/Frameworks" Make sure that your project HEADER_SEARCH_PATHS contains "$(SRCROOT)/liblinphone-sdk/apple-darwin/include" Make sure that your project LD_RUNPATH_SEARCH_PATHS contains "$(inherited) @executable_path/Frameworks"; -Add a Run Script step to your build steps, put it after your step to embed frameworks, set it to use our `deploy.sh` script located in `liblinphone-sdk/apple-darwin/Tools`. +Add a Run Script step to your build steps, put it after your step to embed frameworks, set it to use our `deploy.sh` script located in the `Tools` folder of linphone-iphone root directory. ## Licensing: GPL third parties versus non GPL third parties From ff6adcb5e65f300392c16a2cb13e0837f19bdd36 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 22 Feb 2018 11:04:12 +0100 Subject: [PATCH 08/23] do not put speaker when starting video call if BTheadest --- Classes/LinphoneManager.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index d93bbffe3..84e4bb458 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -958,8 +958,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore *lc, const char // Enable speaker when video if (state == LinphoneCallIncomingReceived || state == LinphoneCallOutgoingInit || state == LinphoneCallConnected || state == LinphoneCallStreamsRunning) { - if (linphone_call_params_video_enabled( linphone_call_get_current_params(call)) && - !speaker_already_enabled) { + if (linphone_call_params_video_enabled( linphone_call_get_current_params(call)) && !speaker_already_enabled && !_bluetoothEnabled) { [self setSpeakerEnabled:TRUE]; speaker_already_enabled = TRUE; } From eea0b8e329c92c0acf8684afc08fc9a7439b0bc8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 1 Mar 2018 21:43:29 +0100 Subject: [PATCH 09/23] Fix a problem where app looses network after receiving INVITE because iOS suspends it and no background task is taken. --- submodules/belle-sip | 2 +- submodules/linphone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/submodules/belle-sip b/submodules/belle-sip index dd5de8022..c805efcad 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit dd5de8022ff5a1ef4ea2d4b2a5761658f1c6010c +Subproject commit c805efcad8a0bb1c9aa39293aa20731a925e5a00 diff --git a/submodules/linphone b/submodules/linphone index 10702c5f3..9e2ef6241 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 10702c5f36bd3fa80e0944e972248e1513a1cea4 +Subproject commit 9e2ef62411f529cc79a070328d758b2dc8c98f84 From 566bba0d2fef81baaa9bc582f09c8892377437c8 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 6 Mar 2018 16:16:36 +0100 Subject: [PATCH 10/23] update linphone submodule --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 9e2ef6241..8ef84da0a 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 9e2ef62411f529cc79a070328d758b2dc8c98f84 +Subproject commit 8ef84da0a05c18eaf52be5296c1f65e6ed98cfcf From 34352e8af5c0d6ac8adf90273ae0070743b4883a Mon Sep 17 00:00:00 2001 From: Brieuc Viel Date: Tue, 6 Mar 2018 16:36:02 +0100 Subject: [PATCH 11/23] [FastAddressBook] update registerAddrsFor cleaned-up --- Classes/Utils/FastAddressBook.m | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 9b6ec51a1..22c02c021 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -209,25 +209,22 @@ } - (void)registerAddrsFor:(Contact *)contact { + if(!_addressBookMap) + return; Contact* mContact = contact; - for (NSString *phone in mContact.phones) { - char *normalizedPhone = linphone_proxy_config_normalize_phone_number(linphone_core_get_default_proxy_config(LC), phone.UTF8String); - NSString *name = [FastAddressBook normalizeSipURI:normalizedPhone ? [NSString stringWithUTF8String:normalizedPhone] : phone]; - if (phone != NULL) { - if(_addressBookMap){ - if(mContact){ - [_addressBookMap setObject:mContact forKey:(name ?: [FastAddressBook localizedLabel:phone])]; - }else{ - // Dosomte - } - } - } + for (NSString *phone in mContact.phones) { + char *normalizedPhone = linphone_proxy_config_normalize_phone_number(linphone_core_get_default_proxy_config(LC), phone.UTF8String); + NSString *name = [FastAddressBook normalizeSipURI:normalizedPhone ? [NSString stringWithUTF8String:normalizedPhone] : phone]; + if (phone != NULL) { + if(mContact) + [_addressBookMap setObject:mContact forKey:(name ?: [FastAddressBook localizedLabel:phone])]; if (normalizedPhone) ms_free(normalizedPhone); } - for (NSString *sip in mContact.sipAddresses) { - [_addressBookMap setObject:mContact forKey:([FastAddressBook normalizeSipURI:sip] ?: sip)]; - } + } + for (NSString *sip in mContact.sipAddresses) { + [_addressBookMap setObject:mContact forKey:([FastAddressBook normalizeSipURI:sip] ?: sip)]; + } } #pragma mark - Tools From dd8ad97456a0fff8960ed0974e42eca6f3ee2627 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Wed, 7 Mar 2018 14:13:28 +0100 Subject: [PATCH 12/23] fix crash when creating a chat --- Classes/ChatConversationCreateTableView.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Classes/ChatConversationCreateTableView.m b/Classes/ChatConversationCreateTableView.m index e45440710..18c26c5ac 100644 --- a/Classes/ChatConversationCreateTableView.m +++ b/Classes/ChatConversationCreateTableView.m @@ -15,7 +15,6 @@ @property(nonatomic, strong) NSMutableArray *addresses; @property(nonatomic, strong) NSDictionary *allContacts; -@property(nonatomic, strong) NSMutableArray *contactsAddresses; @property(nonatomic, strong) NSArray *sortedAddresses; @end @@ -33,7 +32,6 @@ return [[first.firstName lowercaseString] compare:[second.firstName lowercaseString]]; }]; - self.contactsAddresses = [NSMutableArray array]; _addresses = [[NSMutableArray alloc] initWithCapacity:_sortedAddresses.count]; [_searchBar setText:@""]; [self searchBar:_searchBar textDidChange:_searchBar.text]; @@ -42,7 +40,6 @@ - (void)reloadDataWithFilter:(NSString *)filter { [_addresses removeAllObjects]; - [_contactsAddresses removeAllObjects]; for (NSString* key in _sortedAddresses){ NSString *address = (NSString *)key; NSString *name = [FastAddressBook displayNameForContact:[_allContacts objectForKey:key]]; @@ -91,7 +88,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSString *uri; - LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:[_contactsAddresses objectAtIndex:indexPath.row]]; + LinphoneAddress *addr = [LinphoneUtils normalizeSipOrPhoneAddress:[_addresses objectAtIndex:indexPath.row]]; if (addr) { uri = [NSString stringWithUTF8String:linphone_address_as_string(addr)]; } else { From c898b72b7e38b87f3791466a104adf7e7943f9b5 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Sun, 11 Mar 2018 17:23:07 +0100 Subject: [PATCH 13/23] update linphone submodule --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 8ef84da0a..3fd706a70 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 8ef84da0a05c18eaf52be5296c1f65e6ed98cfcf +Subproject commit 3fd706a702eb43f0de36ebeca60bb72ca36b65aa From 190552d4670605dbfefe988d085dad5e254b7257 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Mon, 12 Mar 2018 12:01:59 +0100 Subject: [PATCH 14/23] repair flexisip pusher notification display --- Classes/LinphoneAppDelegate.m | 8 ++++++- Classes/LinphoneManager.m | 45 ++++++++++++++++++++--------------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 9a54ffac8..df95b7f7a 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -434,7 +434,7 @@ return; } - NSString *loc_key = [aps objectForKey:@"loc-key"]; + NSString *loc_key = [aps objectForKey:@"loc-key"] ?: [[aps objectForKey:@"alert"] objectForKey:@"loc-key"]; NSString *callId = [aps objectForKey:@"call-id"] ?: @""; if (!loc_key) { LOGE(@"Notification [%p] has no loc_key, it's impossible to process it.", userInfo); @@ -486,6 +486,12 @@ } - (BOOL)addLongTaskIDforCallID:(NSString *)callId { + if (!callId) + return FALSE; + + if ([callId isEqualToString:@""]) + return FALSE; + NSDictionary *dict = LinphoneManager.instance.pushDict; if ([[dict allKeys] indexOfObject:callId] != NSNotFound) return FALSE; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 84e4bb458..a8d1e4f24 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1163,18 +1163,18 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, LinphoneAut @"provide password again, or check your " @"account configuration in the settings.", nil), username, realm] preferredStyle:UIAlertControllerStyleAlert]; - + UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; - + [alertView addTextFieldWithConfigurationHandler:^(UITextField *textField) { textField.placeholder = NSLocalizedString(@"Password", nil); textField.clearButtonMode = UITextFieldViewModeWhileEditing; textField.borderStyle = UITextBorderStyleRoundedRect; textField.secureTextEntry = YES; }]; - + UIAlertAction* continueAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Confirm password", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { @@ -1185,13 +1185,13 @@ static void linphone_iphone_popup_password_request(LinphoneCore *lc, LinphoneAut linphone_core_add_auth_info(LC, info); [LinphoneManager.instance refreshRegisters]; }]; - + UIAlertAction* settingsAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Go to settings", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { [PhoneMainView.instance changeCurrentView:SettingsView.compositeViewDescription]; }]; - + [alertView addAction:defaultAction]; [alertView addAction:continueAction]; [alertView addAction:settingsAction]; @@ -1674,7 +1674,7 @@ static void networkReachabilityNotification(CFNotificationCenterRef center, void if ([newSSID compare:mgr.SSID] == NSOrderedSame) return; - + if (newSSID != Nil && newSSID.length > 0 && mgr.SSID != Nil && newSSID.length > 0) { if (SCNetworkReachabilityGetFlags([mgr getProxyReachability], &flags)) { LOGI(@"Wifi SSID changed, resesting transports."); @@ -1836,7 +1836,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach /** Should be called once per linphone_core_new() */ - (void)finishCoreConfiguration { - + //Force keep alive to workaround push notif on chat message linphone_core_enable_keep_alive(theLinphoneCore, true); @@ -1901,7 +1901,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach linphone_core_enable_video_display(theLinphoneCore, FALSE); linphone_core_enable_video_capture(theLinphoneCore, FALSE); } - + [self enableProxyPublish:([UIApplication sharedApplication].applicationState == UIApplicationStateActive)]; LOGI(@"Linphone [%s] started on [%s]", linphone_core_get_version(), [[UIDevice currentDevice].model UTF8String]); @@ -1950,11 +1950,11 @@ static BOOL libStarted = FALSE; UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"No microphone", nil) message:NSLocalizedString(@"You need to plug a microphone to your device to use the application.", nil) preferredStyle:UIAlertControllerStyleAlert]; - + UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; - + [errView addAction:defaultAction]; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; } @@ -1980,11 +1980,11 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat message:[NSString stringWithFormat:NSLocalizedString(@"Link your Linphone.org account %s to your phone number.", nil), linphone_address_get_username(linphone_proxy_config_get_identity_address(cfg))] preferredStyle:UIAlertControllerStyleAlert]; - + UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Maybe later", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; - + UIAlertAction* continueAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Let's go", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { @@ -2082,7 +2082,7 @@ void popup_link_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreat libmsopenh264_init(f); libmswebrtc_init(f); libmscodec2_init(f); - + linphone_core_reload_ms_plugins(theLinphoneCore, NULL); [self migrationAllPost]; @@ -2256,6 +2256,13 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { } - (void)startPushLongRunningTask:(BOOL)msg callId:(NSString *)callId { + + if (!callId) + return; + + if ([callId isEqualToString:@""]) + return; + if (msg) { [[UIApplication sharedApplication] endBackgroundTask:pushBgTaskMsg]; pushBgTaskMsg = 0; @@ -2325,7 +2332,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { if (linphone_core_get_global_state(LC) != LinphoneGlobalOn || !linphone_core_get_default_friend_list(LC)) { LOGW(@"Not changing presence configuration because linphone core not ready yet"); return; - } + } if ([self lpConfigBoolForKey:@"publish_presence"]) { // set present to "tv", because "available" does not work yet @@ -2360,7 +2367,7 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { // disable presence [self enableProxyPublish:NO]; - + // handle proxy config if any if (proxyCfg) { const char *refkey = proxyCfg ? linphone_proxy_config_get_ref_key(proxyCfg) : NULL; @@ -2651,11 +2658,11 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { UIAlertController *errView = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Network Error", nil) message:NSLocalizedString(@"There is no network connection available, enable WIFI or WWAN prior to place a call", nil) preferredStyle:UIAlertControllerStyleAlert]; - + UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; - + [errView addAction:defaultAction]; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; return; @@ -2684,11 +2691,11 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) { message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a " @"call or use a valid SIP address (I.E sip:john@example.net)", nil) preferredStyle:UIAlertControllerStyleAlert]; - + UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {}]; - + [errView addAction:defaultAction]; [PhoneMainView.instance presentViewController:errView animated:YES completion:nil]; return; From 3960675de73e5a9681d6481362c97bf51cf2a969 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 13 Mar 2018 20:35:29 +0100 Subject: [PATCH 15/23] upgrade linphone submodule --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 3fd706a70..08a66cdf6 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 3fd706a702eb43f0de36ebeca60bb72ca36b65aa +Subproject commit 08a66cdf6f526b3452fc08155083a337791bc7fd From 2e390e13b9287ddc7d4129cf882454b00ec125c8 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 28 Mar 2018 11:22:59 +0200 Subject: [PATCH 16/23] update bctbx --- submodules/bctoolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/bctoolbox b/submodules/bctoolbox index 25e640640..7b1ff9782 160000 --- a/submodules/bctoolbox +++ b/submodules/bctoolbox @@ -1 +1 @@ -Subproject commit 25e640640000e2ea691c4eb6137e8edebf6b3a52 +Subproject commit 7b1ff978297d9077dbfbdb15967962db6beea4e2 From 7d14f5392e160bec3a1abb4af6aa16dc1129a56b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 30 Mar 2018 14:56:25 +0200 Subject: [PATCH 17/23] [Switch submodule branch] Switch back to srtp 1 while there is still some interoperability issues with version 2. --- submodules/externals/srtp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/externals/srtp b/submodules/externals/srtp index 451b1daa3..4caa4843b 160000 --- a/submodules/externals/srtp +++ b/submodules/externals/srtp @@ -1 +1 @@ -Subproject commit 451b1daa314dfdb20d59433a92dda0319b5d8c11 +Subproject commit 4caa4843b4bfc54be596d309b5d00a81a35e3276 From 24739357e360502342c9955a323c67ba765a43e4 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 30 Mar 2018 17:21:58 +0200 Subject: [PATCH 18/23] update mediastreamer2 (ICE bugfixes) --- submodules/mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/mediastreamer2 b/submodules/mediastreamer2 index ccf9f4d79..b83f3f885 160000 --- a/submodules/mediastreamer2 +++ b/submodules/mediastreamer2 @@ -1 +1 @@ -Subproject commit ccf9f4d79c76b9f8737e116d290616e4ced4c3e5 +Subproject commit b83f3f885025ed28075499547f502dd05d316c52 From 0269738960defb98773be3220bd5cd2d275ec7f3 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 2 Apr 2018 18:33:08 +0200 Subject: [PATCH 19/23] update submodules for certificate matching with regex feature. --- submodules/bctoolbox | 2 +- submodules/belle-sip | 2 +- submodules/externals/mbedtls | 2 +- submodules/linphone | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/submodules/bctoolbox b/submodules/bctoolbox index 7b1ff9782..b41ca6b5d 160000 --- a/submodules/bctoolbox +++ b/submodules/bctoolbox @@ -1 +1 @@ -Subproject commit 7b1ff978297d9077dbfbdb15967962db6beea4e2 +Subproject commit b41ca6b5d85780990c2986f861b2f7832cb79e2e diff --git a/submodules/belle-sip b/submodules/belle-sip index c805efcad..a9af682b9 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit c805efcad8a0bb1c9aa39293aa20731a925e5a00 +Subproject commit a9af682b9931213743c0af65e261e70e2280b1c9 diff --git a/submodules/externals/mbedtls b/submodules/externals/mbedtls index 83d21d543..cb152c35d 160000 --- a/submodules/externals/mbedtls +++ b/submodules/externals/mbedtls @@ -1 +1 @@ -Subproject commit 83d21d543c26a31943b2bd08c66b029f2ef742be +Subproject commit cb152c35ddf7cc837221072e7dc99809f0f7c885 diff --git a/submodules/linphone b/submodules/linphone index 08a66cdf6..149a7304d 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 08a66cdf6f526b3452fc08155083a337791bc7fd +Subproject commit 149a7304dec5b5ccf5b8d2f093e92c3699c27d0a From 3bcf21af25085a315c280c0f6bd705467b8d2024 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 10 Apr 2018 16:15:45 +0200 Subject: [PATCH 20/23] update linphone submodule (fix issue with nat64 networks) --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 149a7304d..6368bc0ba 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 149a7304dec5b5ccf5b8d2f093e92c3699c27d0a +Subproject commit 6368bc0ba0dff0f59397159fdc75f9810023ab70 From e4a4232c29e0992a0301c3320406d3bdd8a28b6c Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Wed, 11 Apr 2018 11:56:51 +0200 Subject: [PATCH 21/23] change submodule libxml2 repo url --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 752680c11..e60d0e3f2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,7 +49,7 @@ ignore = dirty [submodule "submodules/externals/libxml2"] path = submodules/externals/libxml2 - url = git://git.gnome.org/libxml2 + url = https://github.com/GNOME/libxml2.git ignore = dirty [submodule "submodules/externals/openh264"] path = submodules/externals/openh264 From 23525ef943f61a8dd2bedff9180081121bb3c2a7 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 25 Apr 2018 12:20:18 +0200 Subject: [PATCH 22/23] update belle-sip to workaround missing scope id in scope-link ipv6 dns addresses. --- submodules/belle-sip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/belle-sip b/submodules/belle-sip index a9af682b9..cbb4ab4c2 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit a9af682b9931213743c0af65e261e70e2280b1c9 +Subproject commit cbb4ab4c2a58e4fa1954043f6b17266e1685c887 From 9389797aaede6bdd8711a14120ad1657c032fbc6 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 25 May 2018 15:28:58 +0200 Subject: [PATCH 23/23] update belle-sip --- submodules/belle-sip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/belle-sip b/submodules/belle-sip index cbb4ab4c2..411e1c3ea 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit cbb4ab4c2a58e4fa1954043f6b17266e1685c887 +Subproject commit 411e1c3ea8752927cff2ebb2c0170351f3879bab