From 0e95a54e526702cffa93a6e17347801ecdaccccb Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Fri, 10 Jan 2014 15:04:38 +0100 Subject: [PATCH] Handle sips: prefix as valid SIP address --- Classes/ChatRoomViewController.m | 2 +- Classes/LinphoneManager.m | 2 +- Classes/Utils/FastAddressBook.m | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 2a370e117..ee14b36ed 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -238,7 +238,7 @@ static UICompositeViewDescription *compositeDescription = nil; if(remoteAddress != nil) { [remoteAddress release]; } - if ([aRemoteAddress hasPrefix:@"sip:"]) { + if ([aRemoteAddress hasPrefix:@"sip:"] || [aRemoteAddress hasPrefix:@"sips:"]) { remoteAddress = [aRemoteAddress copy]; } else { char normalizedUserName[256]; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index aab879474..104a1c566 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -1294,7 +1294,7 @@ static void audioRouteChangeListenerCallback ( LinphoneCall* call=NULL; if ([address length] == 0) return; //just return - if ([address hasPrefix:@"sip:"]) { + if ([address hasPrefix:@"sip:"] || [address hasPrefix:@"sips:"]) { LinphoneAddress* linphoneAddress = linphone_address_new([address cStringUsingEncoding:[NSString defaultCStringEncoding]]); if(displayName!=nil) { linphone_address_set_display_name(linphoneAddress,[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]); diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 9831c2812..2ff38bf6e 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -57,7 +57,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf } + (BOOL)isSipURI:(NSString*)address { - return [address hasPrefix:@"sip:"]; + return [address hasPrefix:@"sip:"] || [address hasPrefix:@"sips:"]; } + (NSString*)appendCountryCodeIfPossible:(NSString*)number {