diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 75fd29cce..3e8da2008 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -17,6 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#import "LinphoneManager.h" #import "ChatRoomTableViewController.h" #import "UIChatRoomCell.h" #import "Utils.h" @@ -108,7 +109,7 @@ self->remoteAddress = [aremoteAddress copy]; [self loadData]; [ChatModel readConversation:remoteAddress]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneTextReceived" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self]; } diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 7e3744458..ba620059b 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -106,7 +106,7 @@ static UICompositeViewDescription *compositeDescription = nil; object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textReceivedEvent:) - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; if([tableController isEditing]) [tableController setEditing:FALSE animated:FALSE]; @@ -130,7 +130,7 @@ static UICompositeViewDescription *compositeDescription = nil; name:UIKeyboardWillHideNotification object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; } @@ -223,7 +223,7 @@ static UICompositeViewDescription *compositeDescription = nil; caseInsensitiveCompare:remoteAddress] == NSOrderedSame) { [chat setRead:[NSNumber numberWithInt:1]]; [chat update]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneTextReceived" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self]; [tableController addChatEntry:chat]; } ms_free(fromStr); diff --git a/Classes/ChatTableViewController.m b/Classes/ChatTableViewController.m index 91b6287bc..47e240fb6 100644 --- a/Classes/ChatTableViewController.m +++ b/Classes/ChatTableViewController.m @@ -105,7 +105,7 @@ [data removeObjectAtIndex:[indexPath row]]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; [tableView endUpdates]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneTextReceived" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self]; } } diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index ac91c6d5b..51c636024 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -56,7 +56,7 @@ [super viewWillAppear:animated]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textReceivedEvent:) - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; if([tableController isEditing]) [tableController setEditing:FALSE animated:FALSE]; @@ -68,7 +68,7 @@ [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; } diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index bf0d990c6..fc7230442 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -56,15 +56,16 @@ @implementation ContactDetailsTableViewController enum _ContactSections { - ContactSections_Number = 0, + ContactSections_None = 0, + ContactSections_Number, ContactSections_Sip, ContactSections_MAX }; /* MODIFICATION Toggle SIP/Number -static const int contactSections[ContactSections_MAX] = {ContactSections_Number, ContactSections_Sip}; +static const int contactSections[ContactSections_MAX] = {ContactSections_None, ContactSections_Number, ContactSections_Sip}; */ -static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, ContactSections_Number}; +static const int contactSections[ContactSections_MAX] = {ContactSections_None, ContactSections_Sip, ContactSections_Number}; /**/ @synthesize footerController; @@ -211,7 +212,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); BOOL add = false; if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { - if(CFStringCompare((CFStringRef)CONTACT_SIP_FIELD, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { + if(CFStringCompare((CFStringRef)kContactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { add = true; } } else { @@ -279,7 +280,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co lMap = ABMultiValueCreateMutable(kABDictionaryPropertyType); } CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey }; - CFTypeRef values[] = { [value copy], CONTACT_SIP_FIELD }; + CFTypeRef values[] = { [value copy], kContactSipField }; CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 1, NULL, NULL); CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0]; if(!ABMultiValueAddValueAndLabel(lMap, lDict, label, &identifier)) { @@ -378,6 +379,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co } self->contact = acontact; [self loadData]; + [headerController setContact:contact]; } - (void)addSipField:(NSString*)address { @@ -563,18 +565,23 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co if(!editing) { [ContactDetailsTableViewController findAndResignFirstResponder:[self tableView]]; } - - [super setEditing:editing animated:animated]; + + [headerController setEditing:editing animated:animated]; + [footerController setEditing:editing animated:animated]; if(animated) { [self.tableView beginUpdates]; } if(editing) { - for (int section = 0; section <[self numberOfSectionsInTableView:[self tableView]]; ++section) { + for (int section = 0; section < [self numberOfSectionsInTableView:[self tableView]]; ++section) { + if(contactSections[section] == ContactSections_Number || + contactSections[section] == ContactSections_Sip) [self addEntry:self.tableView section:section animated:animated]; } } else { - for (int section = 0; section <[self numberOfSectionsInTableView:[self tableView]]; ++section) { + for (int section = 0; section < [self numberOfSectionsInTableView:[self tableView]]; ++section) { + if(contactSections[section] == ContactSections_Number || + contactSections[section] == ContactSections_Sip) [self removeEmptyEntry:self.tableView section:section animated:animated]; } } @@ -582,8 +589,10 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co [self.tableView endUpdates]; } - [headerController setEditing:editing animated:animated]; - [footerController setEditing:editing animated:animated]; + [super setEditing:editing animated:animated]; + if(contactDetailsDelegate != nil) { + [contactDetailsDelegate onModification:nil]; + } } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { @@ -595,11 +604,8 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { - if(section == 0) { - UIView *headerView = [headerController view]; - [headerController setContact:contact]; - [headerController setEditing:[self isEditing] animated:FALSE]; - return headerView; + if(section == ContactSections_None) { + return [headerController view]; } else { return nil; } @@ -607,8 +613,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { if(section == (ContactSections_MAX - 1)) { - UIView *footerView = [footerController view]; - return footerView; + return [footerController view]; } else { return nil; } @@ -618,7 +623,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co if(contactSections[section] == ContactSections_Number) { return NSLocalizedString(@"Phone numbers", nil); } else if(contactSections[section] == ContactSections_Sip) { - return NSLocalizedString(@"SIP", nil); + return NSLocalizedString(@"SIP addresses", nil); } return nil; } @@ -628,8 +633,8 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - if(section == 0) { - return [UIContactDetailsHeader height:[self isEditing]]; + if(section == ContactSections_None) { + return [UIContactDetailsHeader height:[headerController isEditing]]; } else { // Hide section if nothing in it if([[self getSectionData:section] count] > 0) @@ -640,8 +645,10 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co } - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { - if(section != 0) { - return [UIContactDetailsFooter height:[self isEditing]]; + if(section == (ContactSections_MAX - 1)) { + return [UIContactDetailsFooter height:[footerController isEditing]]; + } else if(section == ContactSections_None) { + return 0.000001f; // Hack UITableView = 0 } return 10.0f; } @@ -717,7 +724,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_Sip, Co CFRelease(lcMap); int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; - CFTypeRef values[] = { [value copy], CONTACT_SIP_FIELD }; + CFTypeRef values[] = { [value copy], kContactSipField }; CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); ABMultiValueReplaceValueAtIndex(lMap, lDict, index); CFRelease(lDict); diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index c899915a9..b14b7fc4b 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -122,7 +122,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Set observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdateEvent:) - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; // Update on show if([LinphoneManager isLcReady]) { @@ -137,7 +137,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Remove observer [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; } diff --git a/Classes/FirstLoginViewController.m b/Classes/FirstLoginViewController.m index 38f93cf6a..9d447b0d5 100644 --- a/Classes/FirstLoginViewController.m +++ b/Classes/FirstLoginViewController.m @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - +#import "LinphoneManager.h" #import "FirstLoginViewController.h" #import "LinphoneManager.h" #import "PhoneMainView.h" @@ -76,7 +76,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Set observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdateEvent:) - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; [usernameField setText:[[LinphoneManager instance].settingsStore objectForKey:@"username_preference"]]; @@ -97,7 +97,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Remove observer [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; } diff --git a/Classes/HistoryDetailsViewController.m b/Classes/HistoryDetailsViewController.m index 56941f55a..f0af8e22e 100644 --- a/Classes/HistoryDetailsViewController.m +++ b/Classes/HistoryDetailsViewController.m @@ -99,7 +99,7 @@ static UICompositeViewDescription *compositeDescription = nil; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(update:) - name:@"LinphoneAddressBookUpdate" + name:kLinphoneAddressBookUpdate object:nil]; [self update]; } @@ -108,7 +108,7 @@ static UICompositeViewDescription *compositeDescription = nil; [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneAddressBookUpdate" + name:kLinphoneAddressBookUpdate object:nil]; } diff --git a/Classes/HistoryViewController.m b/Classes/HistoryViewController.m index 30ec0ffc6..11f4f951a 100644 --- a/Classes/HistoryViewController.m +++ b/Classes/HistoryViewController.m @@ -85,7 +85,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Reset missed call linphone_core_reset_missed_calls_count([LinphoneManager getLc]); // Fake event - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self]; } - (void)viewDidLoad { diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 95109499c..9518ceb85 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -126,7 +126,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Remove observer [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; } @@ -139,7 +139,7 @@ static UICompositeViewDescription *compositeDescription = nil; // Set observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdateEvent:) - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; // Update on show diff --git a/Classes/IncomingCallViewController.m b/Classes/IncomingCallViewController.m index 19207b5fc..2a738cb0c 100644 --- a/Classes/IncomingCallViewController.m +++ b/Classes/IncomingCallViewController.m @@ -52,7 +52,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdateEvent:) - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; } @@ -60,7 +60,7 @@ [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; } diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 39f2a343c..48f26e8af 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -187,6 +187,19 @@ int __aeabi_idiv(int a, int b) { - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Receive %@", userInfo]; + NSDictionary *aps = [userInfo objectForKey:@"aps"]; + if(aps != nil) { + NSDictionary *alert = [aps objectForKey:@"alert"]; + if(alert != nil) { + NSString *loc_key = [alert objectForKey:@"loc-key"]; + if(loc_key != nil) { + if([loc_key isEqualToString:@"IM_MSG"]) { + [[LinphoneManager instance] addInhibitedEvent:kLinphoneTextReceivedSound]; + [[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]]; + } + } + } + } } - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 8fd94df92..b6615903f 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -363,7 +363,7 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args); [tokenString appendFormat:@"%02X", (unsigned int)tokenBuffer[i]]; } // NSLocalizedString(@"IC_MSG", nil); // Fake - NSString *params = [NSString stringWithFormat:@"APN-TOK=%@;APN-MSG=IC_MSG;APN-SND=oldphone-mono-30s.caf", tokenString]; + NSString *params = [NSString stringWithFormat:@"APN-TOK=%@;APN-MSG=IM_MSG;APN-CAL=IC_MSG;APN-CAL-SND=ring.caf;APN-MSG-SND=msg.caf", tokenString]; linphone_proxy_config_set_contact_parameters(proxyCfg, [params UTF8String]); } diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 5d4f6d970..f4736b145 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -20,6 +20,7 @@ #import #import #import +#import #import #import "LogView.h" @@ -31,7 +32,14 @@ #include "linphonecore.h" -extern const NSString *CONTACT_SIP_FIELD; +extern NSString *const kLinphoneTextReceived; +extern NSString *const kLinphoneTextReceivedSound; +extern NSString *const kLinphoneCallUpdate; +extern NSString *const kLinphoneRegistrationUpdate; +extern NSString *const kLinphoneMainViewChange; +extern NSString *const kLinphoneAddressBookUpdate; + +extern NSString *const kContactSipField; typedef enum _Connectivity { wifi, @@ -55,6 +63,11 @@ typedef struct _LinphoneCallAppData { UILocalNotification *notification; } LinphoneCallAppData; +typedef struct _LinphoneManagerSounds { + SystemSoundID call; + SystemSoundID message; +} LinphoneManagerSounds; + @interface LinphoneManager : NSObject { @protected SCNetworkReachabilityRef proxyReachability; @@ -69,10 +82,13 @@ typedef struct _LinphoneCallAppData { FastAddressBook* fastAddressBook; + LinphoneManagerSounds sounds; + NSMutableArray *inhibitedEvent; id settingsStore; sqlite3 *database; NSDictionary *castelCommands; + @public CallContext currentCallContextBeforeGoingBackground; } @@ -101,6 +117,9 @@ typedef struct _LinphoneCallAppData { - (void)enableSpeaker:(BOOL)enable; - (BOOL)isSpeakerEnabled; +- (void)addInhibitedEvent:(NSString*)event; +- (BOOL)removeInhibitedEvent:(NSString*)event; + - (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer; @property (nonatomic, retain) id settingsStore; @@ -111,6 +130,7 @@ typedef struct _LinphoneCallAppData { @property (readonly) const char* backCamId; @property (readonly) sqlite3* database; @property (nonatomic, retain) NSData *pushNotificationToken; +@property (readonly) LinphoneManagerSounds sounds; @property (readonly) NSDictionary* castelCommands; @end diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 56fbfadfb..330a9d512 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -38,9 +38,16 @@ #include "lpconfig.h" #include "private.h" -static LinphoneCore* theLinphoneCore=nil; -static LinphoneManager* theLinphoneManager=nil; -const NSString *CONTACT_SIP_FIELD = @"SIP"; +static LinphoneCore* theLinphoneCore = nil; +static LinphoneManager* theLinphoneManager = nil; + +NSString *const kLinphoneTextReceived = @"LinphoneTextReceived"; +NSString *const kLinphoneTextReceivedSound = @"LinphoneTextReceivedSound"; +NSString *const kLinphoneCallUpdate = @"LinphoneCallUpdate"; +NSString *const kLinphoneRegistrationUpdate = @"LinphoneRegistrationUpdate"; +NSString *const kLinphoneAddressBookUpdate = @"LinphoneAddressBookUpdate"; +NSString *const kLinphoneMainViewChange = @"LinphoneMainViewChange"; +NSString *const kContactSipField = @"SIP"; extern void libmsilbc_init(); #ifdef HAVE_AMR @@ -71,6 +78,7 @@ extern void libmsbcg729_init(); @synthesize database; @synthesize fastAddressBook; @synthesize pushNotificationToken; +@synthesize sounds; @synthesize castelCommands; struct codec_name_pref_table{ @@ -173,6 +181,24 @@ struct codec_name_pref_table codec_pref_table[]={ - (id)init { if ((self = [super init])) { fastAddressBook = [[FastAddressBook alloc] init]; + + { + NSString *path = [[NSBundle mainBundle] pathForResource:@"ring" ofType:@"wav"]; + sounds.call = 0; + OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.call); + if(status != 0){ + [LinphoneLogger log:LinphoneLoggerWarning format:@"Can't set \"call\" system sound"]; + } + } + { + NSString *path = [[NSBundle mainBundle] pathForResource:@"msg" ofType:@"wav"]; + sounds.message = 0; + OSStatus status = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &sounds.message); + if(status != 0){ + [LinphoneLogger log:LinphoneLoggerWarning format:@"Can't set \"message\" system sound"]; + } + } + inhibitedEvent = [[NSMutableArray alloc] init]; database = NULL; settingsStore = nil; self.defaultExpires = 600; @@ -182,6 +208,14 @@ struct codec_name_pref_table codec_pref_table[]={ } - (void)dealloc { + if(sounds.call) { + AudioServicesDisposeSystemSoundID(sounds.call); + } + if(sounds.message) { + AudioServicesDisposeSystemSoundID(sounds.message); + } + + [inhibitedEvent release]; [fastAddressBook release]; [self closeDatabase]; [settingsStore release]; @@ -605,11 +639,11 @@ static LinphoneCoreVTable linphonec_vtable = { linphone_core_set_root_ca(theLinphoneCore, lRootCa); // Set audio assets - const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + const char* lRing = [[myBundle pathForResource:@"ring"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; linphone_core_set_ring(theLinphoneCore, lRing ); const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; linphone_core_set_ringback(theLinphoneCore, lRingBack); - const char* lPlay = [[myBundle pathForResource:@"toy-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + const char* lPlay = [[myBundle pathForResource:@"hold"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; linphone_core_set_play_file(theLinphoneCore, lPlay); linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]); @@ -930,4 +964,17 @@ static LinphoneCoreVTable linphonec_vtable = { } } +- (void)addInhibitedEvent:(NSString*)event { + [inhibitedEvent addObject:event]; +} + +- (BOOL)removeInhibitedEvent:(NSString*)event { + NSUInteger index = [inhibitedEvent indexOfObject:kLinphoneTextReceivedSound]; + if(index != NSNotFound) { + [inhibitedEvent removeObjectAtIndex:index]; + return TRUE; + } + return FALSE; +} + @end diff --git a/Classes/LinphoneUI/UICallBar.m b/Classes/LinphoneUI/UICallBar.m index 8f2455fd6..b5f6b0279 100644 --- a/Classes/LinphoneUI/UICallBar.m +++ b/Classes/LinphoneUI/UICallBar.m @@ -226,7 +226,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdateEvent:) - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self @@ -246,7 +246,7 @@ [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self name:@"LinphoneCastelCommands" diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index aadba1a95..acfecb71a 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -99,25 +99,33 @@ // Message [chatContentLabel setText:[chat message]]; - +} + +- (void)layoutSubviews { + [super layoutSubviews]; // // Adapt size // CGRect displayNameFrame = [addressLabel frame]; CGRect chatContentFrame = [chatContentLabel frame]; - chatContentFrame.origin.x -= displayNameFrame.size.width; - // Compute firstName size - CGSize contraints; - contraints.height = [addressLabel frame].size.height; - contraints.width = ([chatContentLabel frame].size.width + [chatContentLabel frame].origin.x) - [addressLabel frame].origin.x; - CGSize firstNameSize = [[addressLabel text] sizeWithFont:[addressLabel font] constrainedToSize: contraints]; - displayNameFrame.size.width = firstNameSize.width; + CGSize displayNameSize = [[addressLabel text] sizeWithFont:[addressLabel font]]; + CGSize chatContentSize = [[chatContentLabel text] sizeWithFont:[chatContentLabel font]]; + float sum = displayNameSize.width + 5 + chatContentSize.width; + float limit = self.bounds.size.width - 5 - displayNameFrame.origin.x; + if(sum >limit) { + displayNameSize.width *= limit/sum; + chatContentSize.width *= limit/sum; + } + + displayNameFrame.size.width = displayNameSize.width; + chatContentFrame.size.width = chatContentSize.width; // Compute lastName size & position - chatContentFrame.origin.x += displayNameFrame.size.width; - chatContentFrame.size.width = (contraints.width + [addressLabel frame].origin.x) - chatContentFrame.origin.x; + chatContentFrame.origin.x = displayNameFrame.origin.x + displayNameFrame.size.width; + if(displayNameFrame.size.width) + chatContentFrame.origin.x += 5; [addressLabel setFrame: displayNameFrame]; [chatContentLabel setFrame: chatContentFrame]; diff --git a/Classes/LinphoneUI/UIChatRoomCell.h b/Classes/LinphoneUI/UIChatRoomCell.h index cfc479c23..7bbb46af9 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.h +++ b/Classes/LinphoneUI/UIChatRoomCell.h @@ -23,7 +23,7 @@ @interface UIChatRoomCell : UITableViewCell { UIImageView *backgroundImage; - UIView *contentView; + UIView *innerView; UIView *messageView; UILabel *messageLabel; UIButton *deleteButton; @@ -33,7 +33,7 @@ } @property (nonatomic, retain) ChatModel *chat; -@property (nonatomic, retain) IBOutlet UIView *contentView; +@property (nonatomic, retain) IBOutlet UIView *innerView; @property (nonatomic, retain) IBOutlet UIView *messageView; @property (nonatomic, retain) IBOutlet UIImageView* backgroundImage; @property (nonatomic, retain) IBOutlet UILabel *messageLabel; diff --git a/Classes/LinphoneUI/UIChatRoomCell.m b/Classes/LinphoneUI/UIChatRoomCell.m index 44b261a31..e9351809d 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.m +++ b/Classes/LinphoneUI/UIChatRoomCell.m @@ -24,7 +24,7 @@ @implementation UIChatRoomCell -@synthesize contentView; +@synthesize innerView; @synthesize messageView; @synthesize backgroundImage; @synthesize messageLabel; @@ -47,14 +47,14 @@ static UIFont *CELL_FONT = nil; [[NSBundle mainBundle] loadNibNamed:@"UIChatRoomCell" owner:self options:nil]; - [self addSubview:contentView]; + [self addSubview:innerView]; } return self; } - (void)dealloc { [backgroundImage release]; - [contentView release]; + [innerView release]; [messageView release]; [messageLabel release]; [deleteButton release]; @@ -143,20 +143,20 @@ static UIFont *CELL_FONT = nil; - (void)layoutSubviews { [super layoutSubviews]; if(chat != nil) { - // Resize Content - CGRect contentFrame = [contentView frame]; - contentFrame.size = [UIChatRoomCell viewSize:[chat message] width:[self frame].size.width]; + // Resize inner + CGRect innerFrame; + innerFrame.size = [UIChatRoomCell viewSize:[chat message] width:[self frame].size.width]; if([[chat direction] intValue]) { // Inverted - contentFrame.origin.x = 0.0f; - contentFrame.origin.y = 0.0f; + innerFrame.origin.x = 0.0f; + innerFrame.origin.y = 0.0f; } else { - contentFrame.origin.x = [self frame].size.width - contentFrame.size.width; - contentFrame.origin.y = 0.0f; + innerFrame.origin.x = [self frame].size.width - innerFrame.size.width; + innerFrame.origin.y = 0.0f; } - [contentView setFrame:contentFrame]; + [innerView setFrame:innerFrame]; CGRect messageFrame = [messageView frame]; - messageFrame.origin.y = ([contentView frame].size.height - messageFrame.size.height)/2; + messageFrame.origin.y = ([innerView frame].size.height - messageFrame.size.height)/2; if([[chat direction] intValue]) { // Inverted [backgroundImage setImage:[TUNinePatchCache imageOfSize:[backgroundImage bounds].size forNinePatchNamed:@"chat_bubble_incoming"]]; diff --git a/Classes/LinphoneUI/UIChatRoomCell.xib b/Classes/LinphoneUI/UIChatRoomCell.xib index b5bdba778..3b9e82293 100644 --- a/Classes/LinphoneUI/UIChatRoomCell.xib +++ b/Classes/LinphoneUI/UIChatRoomCell.xib @@ -35,7 +35,7 @@ - 301 + 256 @@ -227,14 +227,6 @@ 13 - - - contentView - - - - 14 - messageLabel @@ -267,6 +259,14 @@ 24 + + + innerView + + + + 25 + onDeleteClick: @@ -304,7 +304,7 @@ - contentView + innerView 7 @@ -375,7 +375,7 @@ - 24 + 25 @@ -395,9 +395,9 @@ UIImageView - UIView UILabel UIButton + UIView UILabel UIView @@ -406,10 +406,6 @@ backgroundImage UIImageView - - contentView - UIView - dateLabel UILabel @@ -418,6 +414,10 @@ deleteButton UIButton + + innerView + UIView + messageLabel UILabel diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index a57ff28b9..7de22a1e4 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -251,7 +251,7 @@ // Update rotation UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]]; if(currentOrientation != correctOrientation) { - [PhoneMainView forceOrientation:correctOrientation animated:currentOrientation!=UIDeviceOrientationUnknown]; + [PhoneMainView setOrientation:correctOrientation animated:currentOrientation!=UIDeviceOrientationUnknown]; } } @@ -439,7 +439,7 @@ // Update rotation UIInterfaceOrientation correctOrientation = [self getCorrectInterfaceOrientation:[[UIDevice currentDevice] orientation]]; if(currentOrientation != correctOrientation) { - [PhoneMainView forceOrientation:correctOrientation animated:currentOrientation!=UIDeviceOrientationUnknown]; + [PhoneMainView setOrientation:correctOrientation animated:currentOrientation!=UIDeviceOrientationUnknown]; } else { [self updateInterfaceOrientation:correctOrientation]; } diff --git a/Classes/LinphoneUI/UIContactCell.m b/Classes/LinphoneUI/UIContactCell.m index 8e087186a..bee9f1448 100644 --- a/Classes/LinphoneUI/UIContactCell.m +++ b/Classes/LinphoneUI/UIContactCell.m @@ -111,7 +111,7 @@ // Compute firstName size CGSize firstNameSize = [[firstNameLabel text] sizeWithFont:[firstNameLabel font]]; - CGSize lastNameSize = [[lastNameLabel text] sizeWithFont:[firstNameLabel font]]; + CGSize lastNameSize = [[lastNameLabel text] sizeWithFont:[lastNameLabel font]]; float sum = firstNameSize.width + 5 + lastNameSize.width; float limit = self.bounds.size.width - 5 - firstNameFrame.origin.x; if(sum >limit) { diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.m b/Classes/LinphoneUI/UIContactDetailsHeader.m index 1d7bfa4ef..5e0de1c51 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.m +++ b/Classes/LinphoneUI/UIContactDetailsHeader.m @@ -39,6 +39,7 @@ propertyList = [[NSArray alloc] initWithObjects: [NSNumber numberWithInt:kABPersonFirstNameProperty], [NSNumber numberWithInt:kABPersonLastNameProperty], nil]; + editing = FALSE; } - (id)init { @@ -83,6 +84,9 @@ - (void)viewDidLoad { [super viewDidLoad]; removeTableBackground(tableView); // Can't do it in Xib: issue with ios4 + [normalView setAlpha:1.0f]; + [editView setAlpha:0.0f]; + [tableView setEditing:TRUE animated:false]; } @@ -159,16 +163,11 @@ [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.3]; } - [tableView setEditing:editing animated:animated]; if(editing) { - CGRect frame = [editView frame]; - frame.size.height = [UIContactDetailsHeader height:editing]; - [editView setFrame:frame]; + [editView setAlpha:1.0f]; [normalView setAlpha:0.0f]; } else { - CGRect frame = [editView frame]; - frame.size.height = 0; - [editView setFrame:frame]; + [editView setAlpha:0.0f]; [normalView setAlpha:1.0f]; } if(animated) { diff --git a/Classes/LinphoneUI/UIContactDetailsHeader.xib b/Classes/LinphoneUI/UIContactDetailsHeader.xib index e6fe80dcc..2ad58ddc6 100644 --- a/Classes/LinphoneUI/UIContactDetailsHeader.xib +++ b/Classes/LinphoneUI/UIContactDetailsHeader.xib @@ -35,7 +35,7 @@ - 290 + 274 @@ -378,6 +378,7 @@ AAgACAAIAAEAAQABAAE UILabel UIImageView + id UIView UIView UITableView @@ -391,6 +392,10 @@ AAgACAAIAAEAAQABAAE avatarImage UIImageView + + contactDetailsDelegate + id + editView UIView diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index 764091d59..6c95f51f1 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -70,16 +70,16 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeViewEvent:) - name:@"LinphoneMainViewChange" + name:kLinphoneMainViewChange object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; /* MODIFICATION Remove chat [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textReceived:) - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; */ [self update:FALSE]; @@ -89,14 +89,14 @@ [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneMainViewChange" + name:kLinphoneMainViewChange object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; /* MODIFICATION Remove chat [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; */ } diff --git a/Classes/LinphoneUI/UIPauseButton.m b/Classes/LinphoneUI/UIPauseButton.m index 235ff282d..d7d747961 100644 --- a/Classes/LinphoneUI/UIPauseButton.m +++ b/Classes/LinphoneUI/UIPauseButton.m @@ -118,7 +118,7 @@ linphone_core_leave_conference([LinphoneManager getLc]); // Fake event - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self]; break; } case UIPauseButtonType_CurrentCall: @@ -153,7 +153,7 @@ { linphone_core_enter_conference([LinphoneManager getLc]); // Fake event - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneCallUpdate" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCallUpdate object:self]; break; } case UIPauseButtonType_CurrentCall: diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m index af07b4f2e..aa686e2ea 100644 --- a/Classes/LinphoneUI/UIStateBar.m +++ b/Classes/LinphoneUI/UIStateBar.m @@ -74,7 +74,7 @@ NSTimer *callSecurityTimer; // Set observer [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdate:) - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; @@ -93,7 +93,7 @@ NSTimer *callSecurityTimer; // Remove observer [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; if(callQualityTimer != nil) { diff --git a/Classes/PhoneMainView.h b/Classes/PhoneMainView.h index c6ede5c86..30cd2e7aa 100644 --- a/Classes/PhoneMainView.h +++ b/Classes/PhoneMainView.h @@ -69,7 +69,7 @@ - (void)fullScreen:(BOOL)enabled; - (void)startUp; -+ (void)forceOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated; ++ (void)setOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated; + (PhoneMainView*) instance; diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 9e911815a..25e0cd835 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -102,16 +102,16 @@ static PhoneMainView* phoneMainViewInstance=nil; // Set observers [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(callUpdate:) - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdate:) - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; /* MODIFICATION disable chat [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(textReceived:) - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; */ [[NSNotificationCenter defaultCenter] addObserver:self @@ -130,14 +130,14 @@ static PhoneMainView* phoneMainViewInstance=nil; // Remove observers [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneCallUpdate" + name:kLinphoneCallUpdate object:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; /* MODIFICATION disable chat [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneTextReceived" + name:kLinphoneTextReceived object:nil]; */ [[NSNotificationCenter defaultCenter] removeObserver:self @@ -173,11 +173,27 @@ static PhoneMainView* phoneMainViewInstance=nil; return NO; } ++ (UIView*)findFirstResponder:(UIView*)view { + if (view.isFirstResponder) { + return view; + } + for (UIView *subView in view.subviews) { + UIView *ret = [PhoneMainView findFirstResponder:subView]; + if (ret != nil) + return ret; + } + return nil; +} + /* Will simulate a device rotation */ -+ (void)forceOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated { ++ (void)setOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated { + UIView *firstResponder = nil; for(UIWindow *window in [[UIApplication sharedApplication] windows]) { + if([NSStringFromClass(window.class) isEqualToString:@"UITextEffectsWindow"]) { + continue; + } UIView *view = window; UIViewController *controller = nil; CGRect frame = [view frame]; @@ -220,8 +236,15 @@ static PhoneMainView* phoneMainViewInstance=nil; [UIView commitAnimations]; } [controller didRotateFromInterfaceOrientation:oldOrientation]; + if(firstResponder == nil) { + firstResponder = [PhoneMainView findFirstResponder:view]; + } } [[UIApplication sharedApplication] setStatusBarOrientation:orientation animated:animated]; + if(firstResponder) { + [firstResponder resignFirstResponder]; + [firstResponder becomeFirstResponder]; + } } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { @@ -251,8 +274,8 @@ static PhoneMainView* phoneMainViewInstance=nil; ChatModel *chat = [[notif userInfo] objectForKey:@"chat"]; if(chat != nil) { [self displayMessage:chat]; - [self updateApplicationBadgeNumber]; } + [self updateApplicationBadgeNumber]; } */ @@ -481,7 +504,7 @@ static PhoneMainView* phoneMainViewInstance=nil; } NSDictionary* mdict = [NSMutableDictionary dictionaryWithObject:currentView forKey:@"view"]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneMainViewChange" object:self userInfo:mdict]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneMainViewChange object:self userInfo:mdict]; return [mainViewController getCurrentViewController]; } @@ -577,13 +600,15 @@ static PhoneMainView* phoneMainViewInstance=nil; notif.repeatInterval = 0; notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"%@ sent you a message",nil), address]; notif.alertAction = NSLocalizedString(@"Show", nil); - notif.soundName = UILocalNotificationDefaultSoundName; + notif.soundName = @"msg.caf"; notif.userInfo = [NSDictionary dictionaryWithObject:[chat remoteContact] forKey:@"chat"]; [[UIApplication sharedApplication] presentLocalNotificationNow:notif]; } } else { - AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); + if(![[LinphoneManager instance] removeInhibitedEvent:kLinphoneTextReceivedSound]) { + AudioServicesPlaySystemSound([LinphoneManager instance].sounds.message); + } } } */ @@ -627,10 +652,10 @@ static PhoneMainView* phoneMainViewInstance=nil; appData->notification.repeatInterval = 0; appData->notification.alertBody =[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil), address]; appData->notification.alertAction = NSLocalizedString(@"Answer", nil); - appData->notification.soundName = @"oldphone-mono-30s.caf"; + appData->notification.soundName = @"ring.caf"; appData->notification.userInfo = [NSDictionary dictionaryWithObject:[NSData dataWithBytes:&call length:sizeof(call)] forKey:@"call"]; - [[UIApplication sharedApplication] presentLocalNotificationNow:appData->notification]; + [[UIApplication sharedApplication] presentLocalNotificationNow:appData->notification]; } } else { IncomingCallViewController *controller = DYNAMIC_CAST([self changeCurrentView:[IncomingCallViewController compositeViewDescription] push:TRUE],IncomingCallViewController); diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index 7065ebd2d..e09152d7a 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -142,7 +142,7 @@ CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); BOOL add = false; if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { - if(CFStringCompare((CFStringRef)CONTACT_SIP_FIELD, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { + if(CFStringCompare((CFStringRef)kContactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { add = true; } } else { @@ -161,7 +161,7 @@ } CFRelease(lContacts); } - [[NSNotificationCenter defaultCenter] postNotificationName:@"LinphoneAddressBookUpdate" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneAddressBookUpdate object:self]; } void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef info, void *context) { diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index 3049e127f..746bae50a 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -125,7 +125,7 @@ static UICompositeViewDescription *compositeDescription = nil; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdateEvent:) - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self @@ -141,7 +141,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:@"LinphoneRegistrationUpdate" + name:kLinphoneRegistrationUpdate object:nil]; diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 5077d42c4..0f3dedb8c 100644 Binary files a/Resources/en.lproj/Localizable.strings and b/Resources/en.lproj/Localizable.strings differ diff --git a/Resources/toy-mono.wav b/Resources/hold.wav similarity index 100% rename from Resources/toy-mono.wav rename to Resources/hold.wav diff --git a/Resources/msg.caf b/Resources/msg.caf new file mode 100644 index 000000000..7d843230a Binary files /dev/null and b/Resources/msg.caf differ diff --git a/Resources/msg.wav b/Resources/msg.wav new file mode 100755 index 000000000..a6ffd42f2 Binary files /dev/null and b/Resources/msg.wav differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index fa19cf00a..d8da7c166 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -32,8 +32,8 @@ 22276E8913C73DC000210156 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22276E8813C73DC000210156 /* CoreMedia.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 223148E41178A08200637D6A /* libilbc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 223148E31178A08200637D6A /* libilbc.a */; }; 223148E61178A09900637D6A /* libmsilbc.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 223148E51178A09900637D6A /* libmsilbc.a */; }; - 2237D4091084D7A9001383EE /* oldphone-mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2237D4081084D7A9001383EE /* oldphone-mono.wav */; }; - 2242E313125235120061DDCE /* oldphone-mono-30s.caf in Resources */ = {isa = PBXBuildFile; fileRef = 2242E312125235120061DDCE /* oldphone-mono-30s.caf */; }; + 2237D4091084D7A9001383EE /* ring.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2237D4081084D7A9001383EE /* ring.wav */; }; + 2242E313125235120061DDCE /* ring.caf in Resources */ = {isa = PBXBuildFile; fileRef = 2242E312125235120061DDCE /* ring.caf */; }; 224567C2107B968500F10948 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 224567C1107B968500F10948 /* AVFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 2245F78A1201D38000C4179D /* MoreViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22E0A81B111C44E100B04932 /* MoreViewController.xib */; }; 2248E90E12F7E4CF00220D9C /* UIDigitButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2248E90D12F7E4CF00220D9C /* UIDigitButton.m */; }; @@ -389,8 +389,8 @@ D34BD6CD15C13DB70070C209 /* numpad_two_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F311582223B00336684 /* numpad_two_over.png */; }; D34BD6CE15C13DB70070C209 /* numpad_zero_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F2C1582223B00336684 /* numpad_zero_default.png */; }; D34BD6CF15C13DB70070C209 /* numpad_zero_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3F83F2D1582223B00336684 /* numpad_zero_over.png */; }; - D34BD6D015C13DB70070C209 /* oldphone-mono-30s.caf in Resources */ = {isa = PBXBuildFile; fileRef = 2242E312125235120061DDCE /* oldphone-mono-30s.caf */; }; - D34BD6D115C13DB70070C209 /* oldphone-mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2237D4081084D7A9001383EE /* oldphone-mono.wav */; }; + D34BD6D015C13DB70070C209 /* ring.caf in Resources */ = {isa = PBXBuildFile; fileRef = 2242E312125235120061DDCE /* ring.caf */; }; + D34BD6D115C13DB70070C209 /* ring.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2237D4081084D7A9001383EE /* ring.wav */; }; D34BD6D215C13DB70070C209 /* options_add_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3196D3015A321E2007FEEBA /* options_add_default.png */; }; D34BD6D315C13DB70070C209 /* options_add_default_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = D3C31A1515BD8DED008ED271 /* options_add_default_landscape.png */; }; D34BD6D415C13DB70070C209 /* options_add_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8253F15AE204D00D493FA /* options_add_disabled.png */; }; @@ -443,7 +443,7 @@ D34BD70E15C13DB70070C209 /* statebar_background_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = D3C31A2915BD8DED008ED271 /* statebar_background_landscape.png */; }; D34BD70F15C13DB70070C209 /* switch_camera_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D35E757515931E5D0066B1C1 /* switch_camera_default.png */; }; D34BD71015C13DB70070C209 /* switch_camera_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D35E757615931E5D0066B1C1 /* switch_camera_over.png */; }; - D34BD71115C13DB70070C209 /* toy-mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = D3C714B2159DB84400705B8E /* toy-mono.wav */; }; + D34BD71115C13DB70070C209 /* hold.wav in Resources */ = {isa = PBXBuildFile; fileRef = D3C714B2159DB84400705B8E /* hold.wav */; }; D34BD71215C13DB70070C209 /* transfer_call_default.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8254115AE204D00D493FA /* transfer_call_default.png */; }; D34BD71315C13DB70070C209 /* transfer_call_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8254E15AE256100D493FA /* transfer_call_disabled.png */; }; D34BD71415C13DB70070C209 /* transfer_call_over.png in Resources */ = {isa = PBXBuildFile; fileRef = C9C8254215AE204D00D493FA /* transfer_call_over.png */; }; @@ -555,6 +555,10 @@ D37DC6C21594AE1800B2A5EB /* LinphoneCoreSettingsStore.m in Sources */ = {isa = PBXBuildFile; fileRef = D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */; }; D37DC7181594AF3400B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; D37DC7191594AF3F00B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; + D3804E6015D92A57008072A5 /* msg.caf in Resources */ = {isa = PBXBuildFile; fileRef = D3804E5E15D92A57008072A5 /* msg.caf */; }; + D3804E6115D92A57008072A5 /* msg.caf in Resources */ = {isa = PBXBuildFile; fileRef = D3804E5E15D92A57008072A5 /* msg.caf */; }; + D3804E6215D92A57008072A5 /* msg.wav in Resources */ = {isa = PBXBuildFile; fileRef = D3804E5F15D92A57008072A5 /* msg.wav */; }; + D3804E6315D92A57008072A5 /* msg.wav in Resources */ = {isa = PBXBuildFile; fileRef = D3804E5F15D92A57008072A5 /* msg.wav */; }; D3807FBF15C28940005BE9BC /* DCRoundSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FB815C28940005BE9BC /* DCRoundSwitch.m */; }; D3807FC015C28940005BE9BC /* DCRoundSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FB815C28940005BE9BC /* DCRoundSwitch.m */; }; D3807FC115C28940005BE9BC /* DCRoundSwitchKnobLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = D3807FBA15C28940005BE9BC /* DCRoundSwitchKnobLayer.m */; }; @@ -666,7 +670,7 @@ D3C6526815AC1A8F0092A874 /* UIEditableTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3C6526615AC1A8F0092A874 /* UIEditableTableViewCell.m */; }; D3C6526B15AC228A0092A874 /* contact_ok_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3C6526915AC228A0092A874 /* contact_ok_default.png */; }; D3C6526D15AC228A0092A874 /* contact_ok_over.png in Resources */ = {isa = PBXBuildFile; fileRef = D3C6526A15AC228A0092A874 /* contact_ok_over.png */; }; - D3C714B3159DB84400705B8E /* toy-mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = D3C714B2159DB84400705B8E /* toy-mono.wav */; }; + D3C714B3159DB84400705B8E /* hold.wav in Resources */ = {isa = PBXBuildFile; fileRef = D3C714B2159DB84400705B8E /* hold.wav */; }; D3D14E7C15A711700074A527 /* avatar_shadow_small.png in Resources */ = {isa = PBXBuildFile; fileRef = D3D14E7B15A711700074A527 /* avatar_shadow_small.png */; }; D3D6A39E159B0EEF005F692C /* add_call_default.png in Resources */ = {isa = PBXBuildFile; fileRef = D3D6A39B159B0EEF005F692C /* add_call_default.png */; }; D3D6A3A0159B0EEF005F692C /* add_call_disabled.png in Resources */ = {isa = PBXBuildFile; fileRef = D3D6A39C159B0EEF005F692C /* add_call_disabled.png */; }; @@ -989,8 +993,8 @@ 22276E8813C73DC000210156 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 223148E31178A08200637D6A /* libilbc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libilbc.a; path = "liblinphone-sdk/apple-darwin/lib/libilbc.a"; sourceTree = ""; }; 223148E51178A09900637D6A /* libmsilbc.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsilbc.a; path = "liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsilbc.a"; sourceTree = ""; }; - 2237D4081084D7A9001383EE /* oldphone-mono.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "oldphone-mono.wav"; path = "liblinphone-sdk/apple-darwin/share/sounds/linphone/rings/oldphone-mono.wav"; sourceTree = ""; }; - 2242E312125235120061DDCE /* oldphone-mono-30s.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "oldphone-mono-30s.caf"; path = "liblinphone-sdk/apple-darwin/share/sounds/linphone/rings/oldphone-mono-30s.caf"; sourceTree = ""; }; + 2237D4081084D7A9001383EE /* ring.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = ring.wav; path = "liblinphone-sdk/apple-darwin/share/sounds/linphone/rings/ring.wav"; sourceTree = ""; }; + 2242E312125235120061DDCE /* ring.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ring.caf; path = "liblinphone-sdk/apple-darwin/share/sounds/linphone/rings/ring.caf"; sourceTree = ""; }; 224567C1107B968500F10948 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 2248E90C12F7E4CF00220D9C /* UIDigitButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButton.h; sourceTree = ""; }; 2248E90D12F7E4CF00220D9C /* UIDigitButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDigitButton.m; sourceTree = ""; }; @@ -1346,6 +1350,8 @@ D37DC6BF1594AE1800B2A5EB /* LinphoneCoreSettingsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinphoneCoreSettingsStore.h; sourceTree = ""; }; D37DC6C01594AE1800B2A5EB /* LinphoneCoreSettingsStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LinphoneCoreSettingsStore.m; sourceTree = ""; }; D37DC7171594AF3400B2A5EB /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + D3804E5E15D92A57008072A5 /* msg.caf */ = {isa = PBXFileReference; lastKnownFileType = file; name = msg.caf; path = Resources/msg.caf; sourceTree = ""; }; + D3804E5F15D92A57008072A5 /* msg.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = msg.wav; path = Resources/msg.wav; sourceTree = ""; }; D3807FB715C28940005BE9BC /* DCRoundSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCRoundSwitch.h; sourceTree = ""; }; D3807FB815C28940005BE9BC /* DCRoundSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DCRoundSwitch.m; sourceTree = ""; }; D3807FB915C28940005BE9BC /* DCRoundSwitchKnobLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DCRoundSwitchKnobLayer.h; sourceTree = ""; }; @@ -1566,7 +1572,7 @@ D3C6526615AC1A8F0092A874 /* UIEditableTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIEditableTableViewCell.m; sourceTree = ""; }; D3C6526915AC228A0092A874 /* contact_ok_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_ok_default.png; path = Resources/contact_ok_default.png; sourceTree = ""; }; D3C6526A15AC228A0092A874 /* contact_ok_over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contact_ok_over.png; path = Resources/contact_ok_over.png; sourceTree = ""; }; - D3C714B2159DB84400705B8E /* toy-mono.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "toy-mono.wav"; path = "Resources/toy-mono.wav"; sourceTree = ""; }; + D3C714B2159DB84400705B8E /* hold.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = hold.wav; path = Resources/hold.wav; sourceTree = ""; }; D3D14E7B15A711700074A527 /* avatar_shadow_small.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = avatar_shadow_small.png; path = Resources/avatar_shadow_small.png; sourceTree = ""; }; D3D6A39B159B0EEF005F692C /* add_call_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = add_call_default.png; path = Resources/add_call_default.png; sourceTree = ""; }; D3D6A39C159B0EEF005F692C /* add_call_disabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = add_call_disabled.png; path = Resources/add_call_disabled.png; sourceTree = ""; }; @@ -2505,6 +2511,7 @@ D347347D1580E5F8003C7B8C /* history_selected.png */, D3A74E8615C69392001500B9 /* history_selected_landscape~ipad.png */, D3A74E8715C69392001500B9 /* history_selected~ipad.png */, + D3C714B2159DB84400705B8E /* hold.wav */, D3432A5C158A4446001C6B0B /* led_connected.png */, D3432A70158A45AF001C6B0B /* led_disconnected.png */, D3432A5D158A4446001C6B0B /* led_error.png */, @@ -2539,6 +2546,8 @@ D3C31A1415BD8DED008ED271 /* micro_on_over_landscape.png */, D339889715C6DD1600CAF1E4 /* micro_on_over_landscape~ipad.png */, D3A74E8D15C69392001500B9 /* micro_on_over~ipad.png */, + D3804E5E15D92A57008072A5 /* msg.caf */, + D3804E5F15D92A57008072A5 /* msg.wav */, D306BC0915CFF79E00FDB80F /* more_default.png */, D306BC0A15CFF79E00FDB80F /* more_over.png */, D306BC0B15CFF79E00FDB80F /* more_selected.png */, @@ -2566,8 +2575,6 @@ D3F83F311582223B00336684 /* numpad_two_over.png */, D3F83F2C1582223B00336684 /* numpad_zero_default.png */, D3F83F2D1582223B00336684 /* numpad_zero_over.png */, - 2242E312125235120061DDCE /* oldphone-mono-30s.caf */, - 2237D4081084D7A9001383EE /* oldphone-mono.wav */, D3196D3015A321E2007FEEBA /* options_add_default.png */, D3C31A1515BD8DED008ED271 /* options_add_default_landscape.png */, D339889815C6DD1600CAF1E4 /* options_add_default_landscape~ipad.png */, @@ -2624,6 +2631,8 @@ D3C31A2215BD8DED008ED271 /* pause_on_over_landscape.png */, D33988A515C6DD1600CAF1E4 /* pause_on_over_landscape~ipad.png */, D3A74E9B15C69392001500B9 /* pause_on_over~ipad.png */, + 2242E312125235120061DDCE /* ring.caf */, + 2237D4081084D7A9001383EE /* ring.wav */, 22F254801073D99800AC9B3F /* ringback.wav */, 70571E1913FABCB000CDD3C2 /* rootca.pem */, D3D6A3A5159B0EFE005F692C /* security_ko.png */, @@ -2680,7 +2689,6 @@ D35E757515931E5D0066B1C1 /* switch_camera_default.png */, D35E757615931E5D0066B1C1 /* switch_camera_over.png */, D3A74E5815C68162001500B9 /* toolsbar_background.png */, - D3C714B2159DB84400705B8E /* toy-mono.wav */, C9C8254115AE204D00D493FA /* transfer_call_default.png */, D3A74EAA15C69392001500B9 /* transfer_call_default~ipad.png */, C9C8254E15AE256100D493FA /* transfer_call_disabled.png */, @@ -3009,10 +3017,10 @@ 2274550810700509006EC466 /* linphonerc in Resources */, 22F2508F107141E100AC9B3F /* DialerViewController.xib in Resources */, 22F254811073D99800AC9B3F /* ringback.wav in Resources */, - 2237D4091084D7A9001383EE /* oldphone-mono.wav in Resources */, + 2237D4091084D7A9001383EE /* ring.wav in Resources */, 22E0A823111C44E100B04932 /* ConsoleViewController.xib in Resources */, 2245F78A1201D38000C4179D /* MoreViewController.xib in Resources */, - 2242E313125235120061DDCE /* oldphone-mono-30s.caf in Resources */, + 2242E313125235120061DDCE /* ring.caf in Resources */, 2218A92612FBE1340088A667 /* FirstLoginViewController.xib in Resources */, 2214783D1386A2030020F8B8 /* Localizable.strings in Resources */, 70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */, @@ -3163,7 +3171,7 @@ D3211BBE159CBFD60098460B /* back_default.png in Resources */, D3211BC0159CBFD70098460B /* back_disabled.png in Resources */, D3211BC2159CBFD70098460B /* back_over.png in Resources */, - D3C714B3159DB84400705B8E /* toy-mono.wav in Resources */, + D3C714B3159DB84400705B8E /* hold.wav in Resources */, D377BBFA15A19DA6002B696B /* video_on_disabled.png in Resources */, D37B96B715A1A6F20005CCD2 /* call_state_delete_default.png in Resources */, D37B96B915A1A6F20005CCD2 /* call_state_delete_over.png in Resources */, @@ -3267,6 +3275,8 @@ D3A74E5915C68162001500B9 /* toolsbar_background.png in Resources */, D3A74EE815C69392001500B9 /* contacts_over~ipad.png in Resources */, D30BBD1815D402A7000F93DD /* contact_ok_disabled.png in Resources */, + D3804E6015D92A57008072A5 /* msg.caf in Resources */, + D3804E6215D92A57008072A5 /* msg.wav in Resources */, D306BC0C15CFF79E00FDB80F /* castel_icon_57.png in Resources */, D306BC0E15CFF79E00FDB80F /* castel_icon_72.png in Resources */, D306BC1015CFF79E00FDB80F /* more_default.png in Resources */, @@ -3462,8 +3472,8 @@ D34BD6CD15C13DB70070C209 /* numpad_two_over.png in Resources */, D34BD6CE15C13DB70070C209 /* numpad_zero_default.png in Resources */, D34BD6CF15C13DB70070C209 /* numpad_zero_over.png in Resources */, - D34BD6D015C13DB70070C209 /* oldphone-mono-30s.caf in Resources */, - D34BD6D115C13DB70070C209 /* oldphone-mono.wav in Resources */, + D34BD6D015C13DB70070C209 /* ring.caf in Resources */, + D34BD6D115C13DB70070C209 /* ring.wav in Resources */, D34BD6D215C13DB70070C209 /* options_add_default.png in Resources */, D34BD6D315C13DB70070C209 /* options_add_default_landscape.png in Resources */, D34BD6D415C13DB70070C209 /* options_add_disabled.png in Resources */, @@ -3516,7 +3526,7 @@ D34BD70E15C13DB70070C209 /* statebar_background_landscape.png in Resources */, D34BD70F15C13DB70070C209 /* switch_camera_default.png in Resources */, D34BD71015C13DB70070C209 /* switch_camera_over.png in Resources */, - D34BD71115C13DB70070C209 /* toy-mono.wav in Resources */, + D34BD71115C13DB70070C209 /* hold.wav in Resources */, D34BD71215C13DB70070C209 /* transfer_call_default.png in Resources */, D34BD71315C13DB70070C209 /* transfer_call_disabled.png in Resources */, D34BD71415C13DB70070C209 /* transfer_call_over.png in Resources */, @@ -3540,6 +3550,8 @@ D3A74E5A15C68162001500B9 /* toolsbar_background.png in Resources */, D3A74EE915C69392001500B9 /* contacts_over~ipad.png in Resources */, D30BBD1915D402A7000F93DD /* contact_ok_disabled.png in Resources */, + D3804E6115D92A57008072A5 /* msg.caf in Resources */, + D3804E6315D92A57008072A5 /* msg.wav in Resources */, D306BC0D15CFF79E00FDB80F /* castel_icon_57.png in Resources */, D306BC0F15CFF79E00FDB80F /* castel_icon_72.png in Resources */, D306BC1115CFF79E00FDB80F /* more_default.png in Resources */,