diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index f2e8586d7..f11c2a97b 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -239,9 +239,11 @@ int __aeabi_idiv(int a, int b) { // Settings, setup delegate settingsController.delegate = [LinphoneManager instance]; - settingsController.settingsReader.delegate = [LinphoneManager instance]; + settingsController.settingsReaderDelegate = [LinphoneManager instance]; settingsController.settingsStore=[[LinphoneCoreSettingsStore alloc] init]; - [settingsController.settingsReader init]; + //settingsController.file=@"settings/Inappsettings.bundle"; + settingsController.showCreditsFooter=FALSE; + //[settingsController.settingsReader init]; [[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound]; diff --git a/Classes/LinphoneCoreSettingsStore.h b/Classes/LinphoneCoreSettingsStore.h index 95d04546a..af1f272c2 100644 --- a/Classes/LinphoneCoreSettingsStore.h +++ b/Classes/LinphoneCoreSettingsStore.h @@ -15,7 +15,6 @@ NSDictionary *dict; } -- (void) enableCodecWithName: (const char*) name andRate: (int) rate to:(id)value; -(void) transformLinphoneCoreToKeys; @end diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 370d9323f..0df80d755 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -11,59 +11,6 @@ #include "lpconfig.h" -#if 0 -// linphone_core_enable_logs_with_cb - linphone_core_disable_logs -debugenable_preference - -// on change: edit/create linphone_core_get_default_proxy() -transport_preference -username_preference -domain_preference -password_preference -outbound_proxy_preference -proxy_preference -prefix_preference ++ -substitute_+_by_00_preference ++ - -// app internal setting -check_config_disable_preference -wifi_only_preference -backgroundmode_preference - -// linphone_core_enable_payload_type -silk_24k_preference -speex_16k_preference -speex_8k_preference -silk_16k_preference -amr_8k_preference -gsm_8k_preference -ilbc_preference -pcmu_preference -pcma_preference -g722_preference -g729_preference - -// linphone_core_enable_payload_type -mp4v-es_preference -h264_preference -vp8_preference - -// linphone_core_enable_video -enable_video_preference -// linphone_core_set_video_policy -start_video_preference - -// linphone_core_set_media_encryption -enable_srtp_preference - -// linphone_core_set_stun_server -// linphone_core_set_firewall_policy -stun_preference - - - -#endif - struct codec_name_pref_table{ const char *name; int rate; @@ -123,6 +70,10 @@ static NSString *getPrefForCodec(const char *name, int rate){ [self setObject: obj forKey:key]; } +- (NSString*) stringForKey:(NSString*) key{ + return [self objectForKey: key]; +} + -(void) transformCodecsToKeys: (const MSList *)codecs{ LinphoneCore *lc=[LinphoneManager getLc]; const MSList *elem=codecs; @@ -231,6 +182,9 @@ static NSString *getPrefForCodec(const char *name, int rate){ -(void) setObject:(id)value forKey:(NSString *)key { [dict setValue:value forKey:key]; + NSString *changed_value=[[NSString alloc] initWithFormat:@"%@_changed", key]; + [dict setValue:[NSNumber numberWithBool:TRUE] forKey:changed_value]; + [changed_value release]; } - (id)objectForKey:(NSString*)key { @@ -238,17 +192,180 @@ static NSString *getPrefForCodec(const char *name, int rate){ } - (BOOL)synchronize { - ms_message("Called in SettingsStore synchronize"); + LinphoneCore *lc=[LinphoneManager getLc]; + LinphoneManager* lLinphoneMgr = [LinphoneManager instance]; + + NSLog(@"Called in SettingsStore synchronize"); + if ([self boolForKey:@"username_preference_changed"]) + NSLog(@"username_preference_changed !!"); + return YES; + /* unregister before modifying any settings */ + { + LinphoneProxyConfig* proxyCfg; + linphone_core_get_default_proxy(lc, &proxyCfg); + + if (proxyCfg) { + // this will force unregister WITHOUT destorying the proxyCfg object + linphone_proxy_config_edit(proxyCfg); + + int i=0; + while (linphone_proxy_config_get_state(proxyCfg)!=LinphoneRegistrationNone && + linphone_proxy_config_get_state(proxyCfg)!=LinphoneRegistrationCleared && + linphone_proxy_config_get_state(proxyCfg)!=LinphoneRegistrationFailed && + i++<40 ) { + linphone_core_iterate(lc); + usleep(10000); + } + } + } + + NSString* transport = [self stringForKey:@"transport_preference"]; + + LCSipTransports transportValue; + if (transport!=nil) { + if (linphone_core_get_sip_transports(lc, &transportValue)) { + ms_error("cannot get current transport"); + } + // Only one port can be set at one time, the others's value is 0 + if ([transport isEqualToString:@"tcp"]) { + if (transportValue.tcp_port == 0) transportValue.tcp_port=transportValue.udp_port + transportValue.tls_port; + transportValue.udp_port=0; + transportValue.tls_port=0; + } else if ([transport isEqualToString:@"udp"]){ + if (transportValue.udp_port == 0) transportValue.udp_port=transportValue.tcp_port + transportValue.tls_port; + transportValue.tcp_port=0; + transportValue.tls_port=0; + } else if ([transport isEqualToString:@"tls"]){ + if (transportValue.tls_port == 0) transportValue.tls_port=transportValue.udp_port + transportValue.tcp_port; + transportValue.tcp_port=0; + transportValue.udp_port=0; + } else { + ms_error("unexpected transport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]); + } + if (linphone_core_set_sip_transports(lc, &transportValue)) { + ms_error("cannot set transport"); + } + } + + + //configure sip account + + //mandatory parameters + + NSString* username = [self stringForKey:@"username_preference"]; + NSString* domain = [self stringForKey:@"domain_preference"]; + NSString* accountPassword = [self stringForKey:@"password_preference"]; + bool isOutboundProxy= [self boolForKey:@"outbound_proxy_preference"]; + + + //clear auth info list + linphone_core_clear_all_auth_info(lc); + //clear existing proxy config + linphone_core_clear_proxy_config(lc); + if (username && [username length] >0 && domain && [domain length]>0) { + const char* identity = [[NSString stringWithFormat:@"sip:%@@%@",username,domain] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + const char* password = [accountPassword cStringUsingEncoding:[NSString defaultCStringEncoding]]; + + NSString* proxyAddress = [[NSUserDefaults standardUserDefaults] stringForKey:@"proxy_preference"]; + if ((!proxyAddress || [proxyAddress length] <1 ) && domain) { + proxyAddress = [NSString stringWithFormat:@"sip:%@",domain] ; + } else { + proxyAddress = [NSString stringWithFormat:@"sip:%@",proxyAddress] ; + } + + const char* proxy = [proxyAddress cStringUsingEncoding:[NSString defaultCStringEncoding]]; + + NSString* prefix = [[NSUserDefaults standardUserDefaults] stringForKey:@"prefix_preference"]; + bool substitute_plus_by_00 = [[NSUserDefaults standardUserDefaults] boolForKey:@"substitute_+_by_00_preference"]; + //possible valid config detected + LinphoneProxyConfig* proxyCfg; + proxyCfg = linphone_proxy_config_new(); + + // add username password + LinphoneAddress *from = linphone_address_new(identity); + LinphoneAuthInfo *info; + if (from !=0){ + info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL); + linphone_core_add_auth_info(lc,info); + } + linphone_address_destroy(from); + + // configure proxy entries + linphone_proxy_config_set_identity(proxyCfg,identity); + linphone_proxy_config_set_server_addr(proxyCfg,proxy); + linphone_proxy_config_enable_register(proxyCfg,true); + BOOL isWifiOnly = [self boolForKey:@"wifi_only_preference"]; + + if (isWifiOnly && lLinphoneMgr.connectivity == wwan) { + linphone_proxy_config_expires(proxyCfg, 0); + } else { + linphone_proxy_config_expires(proxyCfg, lLinphoneMgr.defaultExpires); + } + + if (isOutboundProxy) + linphone_proxy_config_set_route(proxyCfg,proxy); + + if ([prefix length]>0) { + linphone_proxy_config_set_dial_prefix(proxyCfg, [prefix cStringUsingEncoding:[NSString defaultCStringEncoding]]); + } + linphone_proxy_config_set_dial_escape_plus(proxyCfg,substitute_plus_by_00); + + linphone_core_add_proxy_config(lc,proxyCfg); + //set to default proxy + linphone_core_set_default_proxy(lc,proxyCfg); + + } + + //Configure Codecs + + PayloadType *pt; + const MSList *elem; + //disable all codecs + for (elem=linphone_core_get_audio_codecs(lc);elem!=NULL;elem=elem->next){ + pt=(PayloadType*)elem->data; + linphone_core_enable_payload_type(lc,pt,[self boolForKey: getPrefForCodec(pt->mime_type,pt->clock_rate)]); + } + for (elem=linphone_core_get_video_codecs(lc);elem!=NULL;elem=elem->next){ + pt=(PayloadType*)elem->data; + linphone_core_enable_payload_type(lc,pt,[self boolForKey: getPrefForCodec(pt->mime_type,pt->clock_rate)]); + } + + bool enableVideo = [self boolForKey:@"enable_video_preference"]; + linphone_core_enable_video(lc, enableVideo, enableVideo); + + NSString *menc = [self stringForKey:@"media_encryption_preference"]; + if (menc && [menc compare:@"SRTP"]) + linphone_core_set_media_encryption(lc, LinphoneMediaEncryptionSRTP); + else if (menc && [menc compare:@"ZRTP"]) + linphone_core_set_media_encryption(lc, LinphoneMediaEncryptionZRTP); + else linphone_core_set_media_encryption(lc, LinphoneMediaEncryptionNone); + + NSString* stun_server = [self stringForKey:@"stun_preference"]; + if ([stun_server length]>0){ + linphone_core_set_stun_server(lc,[stun_server cStringUsingEncoding:[NSString defaultCStringEncoding]]); + linphone_core_set_firewall_policy(lc, LinphonePolicyUseStun); + }else{ + linphone_core_set_stun_server(lc, NULL); + linphone_core_set_firewall_policy(lc, LinphonePolicyNoFirewall); + } + + LinphoneVideoPolicy policy; + policy.automatically_accept = [self boolForKey:@"start_video_preference"];; + policy.automatically_initiate = [self boolForKey:@"start_video_preference"]; + linphone_core_set_video_policy(lc, &policy); + + UIDevice* device = [UIDevice currentDevice]; + bool backgroundSupported = false; + if ([device respondsToSelector:@selector(isMultitaskingSupported)]) + backgroundSupported = [device isMultitaskingSupported]; + BOOL isbackgroundModeEnabled; + if (backgroundSupported) { + isbackgroundModeEnabled = [self boolForKey:@"backgroundmode_preference"]; + } else { + isbackgroundModeEnabled=false; + } + lp_config_set_int(linphone_core_get_config(lc),"app","backgroundmode_preference",backgroundSupported); return YES; } -- (void) enableCodecWithName: (const char*) name andRate: (int) rate to:(id)value{ - LinphoneCore *lc=[LinphoneManager getLc]; - PayloadType *pt; - pt=linphone_core_find_payload_type(lc, name, rate); - if (pt){ - linphone_core_enable_payload_type(lc, pt, [value boolValue]); - } -} - @end diff --git a/Classes/LinphoneUI/LinphoneManager.h b/Classes/LinphoneUI/LinphoneManager.h index b2f4dfc3d..c108d36f8 100644 --- a/Classes/LinphoneUI/LinphoneManager.h +++ b/Classes/LinphoneUI/LinphoneManager.h @@ -66,9 +66,7 @@ typedef struct _LinphoneCallAppData { FastAddressBook* mFastAddressBook; const char* frontCamId; const char* backCamId; - - NSDictionary* currentSettings; - + @public CallContext currentCallContextBeforeGoingBackground; } @@ -92,13 +90,13 @@ typedef struct _LinphoneCallAppData { -(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log; -(UIImage*) getImageFromAddressBook:(NSString*) number; --(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)oldSettings; -(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx; -(void) refreshRegisters; @property (nonatomic, retain) id callDelegate; @property (nonatomic, retain) id registrationDelegate; @property Connectivity connectivity; +@property (nonatomic) int defaultExpires; @property (readonly) const char* frontCamId; @property (readonly) const char* backCamId; @property (nonatomic) bool isbackgroundModeEnabled; diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index 2188d73c6..92722dae8 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -20,6 +20,7 @@ #import "LinphoneManager.h" #include "linphonecore_utils.h" +#include "lpconfig.h" #include #include #include @@ -42,7 +43,7 @@ extern void libmsx264_init(); #endif #define FRONT_CAM_NAME "AV Capture: Front Camera" #define BACK_CAM_NAME "AV Capture: Back Camera" -#define DEFAULT_EXPIRES 600 + #if defined (HAVE_SILK) extern void libmssilk_init(); #endif @@ -57,12 +58,14 @@ extern void libmsbcg729_init(); @synthesize frontCamId; @synthesize backCamId; @synthesize isbackgroundModeEnabled; +@synthesize defaultExpires; -(id) init { assert (!theLinphoneManager); if ((self= [super init])) { mFastAddressBook = [[FastAddressBook alloc] init]; theLinphoneManager = self; + self.defaultExpires=600; } return self; } @@ -429,14 +432,6 @@ static LinphoneCoreVTable linphonec_vtable = { }; --(void) configurePayloadType:(const char*) type fromPrefKey: (NSString*)key withRate:(int)rate { - if ([[NSUserDefaults standardUserDefaults] boolForKey:key]) { - PayloadType* pt; - if((pt = linphone_core_find_payload_type(theLinphoneCore,type,rate))) { - linphone_core_enable_payload_type(theLinphoneCore,pt, TRUE); - } - } -} -(void) kickOffNetworkConnection { /*start a new thread to avoid blocking the main ui in case of peer host failure*/ [NSThread detachNewThreadSelector:@selector(runNetworkConnection) toTarget:self withObject:nil]; @@ -487,7 +482,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach [[LinphoneManager instance] kickOffNetworkConnection]; } else { Connectivity newConnectivity; - BOOL isWifiOnly = [[NSUserDefaults standardUserDefaults] boolForKey:@"wifi_only_preference"]; + BOOL isWifiOnly = lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]),"app","wifi_only_preference",FALSE); if (!ctx || ctx->testWWan) newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi; else @@ -499,7 +494,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach && (lLinphoneMgr.connectivity == newConnectivity || lLinphoneMgr.connectivity == none)) { linphone_proxy_config_expires(proxy, 0); } else if (proxy){ - linphone_proxy_config_expires(proxy, DEFAULT_EXPIRES); //might be better to save the previous value + linphone_proxy_config_expires(proxy, lLinphoneMgr.defaultExpires); //might be better to save the previous value } if (lLinphoneMgr.connectivity == none) { @@ -522,276 +517,29 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } } --(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)settings { - if (theLinphoneCore==nil) { - ms_warning("cannot configure linphone because not initialized yet"); - return NO; - } - - [[NSUserDefaults standardUserDefaults] synchronize]; - NSDictionary* newSettings = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]; - if (settings != nil) { - /* reconfigure only if newSettings != settings */ - if ([newSettings isEqualToDictionary:settings]) { - ms_message("Same settings: no need to reconfigure linphone"); - return NO; - } - } - NSLog(@"Configuring Linphone (new settings)"); - - - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"debugenable_preference"]) { - //redirect all traces to the iphone log framework - linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler); - } - else { - linphone_core_disable_logs(); - } - - NSBundle* myBundle = [NSBundle mainBundle]; - - /* unregister before modifying any settings */ - { - LinphoneProxyConfig* proxyCfg; - linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg); - - if (proxyCfg) { - // this will force unregister WITHOUT destorying the proxyCfg object - linphone_proxy_config_edit(proxyCfg); - - int i=0; - while (linphone_proxy_config_get_state(proxyCfg)!=LinphoneRegistrationNone && - linphone_proxy_config_get_state(proxyCfg)!=LinphoneRegistrationCleared && - linphone_proxy_config_get_state(proxyCfg)!=LinphoneRegistrationFailed && - i++<40 ) { - linphone_core_iterate(theLinphoneCore); - usleep(100000); - } - } - } - - const char* lRootCa = [[myBundle pathForResource:@"rootca"ofType:@"pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - linphone_core_set_root_ca(theLinphoneCore, lRootCa); - - NSString* transport = [[NSUserDefaults standardUserDefaults] stringForKey:@"transport_preference"]; - - LCSipTransports transportValue; - if (transport!=nil) { - if (linphone_core_get_sip_transports(theLinphoneCore, &transportValue)) { - ms_error("cannot get current transport"); - } - // Only one port can be set at one time, the others's value is 0 - if ([transport isEqualToString:@"tcp"]) { - if (transportValue.tcp_port == 0) transportValue.tcp_port=transportValue.udp_port + transportValue.tls_port; - transportValue.udp_port=0; - transportValue.tls_port=0; - } else if ([transport isEqualToString:@"udp"]){ - if (transportValue.udp_port == 0) transportValue.udp_port=transportValue.tcp_port + transportValue.tls_port; - transportValue.tcp_port=0; - transportValue.tls_port=0; - } else if ([transport isEqualToString:@"tls"]){ - if (transportValue.tls_port == 0) transportValue.tls_port=transportValue.udp_port + transportValue.tcp_port; - transportValue.tcp_port=0; - transportValue.udp_port=0; - } else { - ms_error("unexpected transport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]); - } - if (linphone_core_set_sip_transports(theLinphoneCore, &transportValue)) { - ms_error("cannot set transport"); - } - } - - - - // Set audio assets - const char* lRing = [[myBundle pathForResource:@"oldphone-mono"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); - - - - //configure sip account - - //madatory parameters - - NSString* username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"]; - NSString* domain = [[NSUserDefaults standardUserDefaults] stringForKey:@"domain_preference"]; - NSString* accountPassword = [[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"]; - bool configCheckDisable = [[NSUserDefaults standardUserDefaults] boolForKey:@"check_config_disable_preference"]; - bool isOutboundProxy= [[NSUserDefaults standardUserDefaults] boolForKey:@"outbound_proxy_preference"]; - - - //clear auth info list - linphone_core_clear_all_auth_info(theLinphoneCore); - //clear existing proxy config - linphone_core_clear_proxy_config(theLinphoneCore); - if (username && [username length] >0 && domain && [domain length]>0) { - const char* identity = [[NSString stringWithFormat:@"sip:%@@%@",username,domain] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - const char* password = [accountPassword cStringUsingEncoding:[NSString defaultCStringEncoding]]; - - NSString* proxyAddress = [[NSUserDefaults standardUserDefaults] stringForKey:@"proxy_preference"]; - if ((!proxyAddress || [proxyAddress length] <1 ) && domain) { - proxyAddress = [NSString stringWithFormat:@"sip:%@",domain] ; - } else { - proxyAddress = [NSString stringWithFormat:@"sip:%@",proxyAddress] ; - } - - const char* proxy = [proxyAddress cStringUsingEncoding:[NSString defaultCStringEncoding]]; - - NSString* prefix = [[NSUserDefaults standardUserDefaults] stringForKey:@"prefix_preference"]; - bool substitute_plus_by_00 = [[NSUserDefaults standardUserDefaults] boolForKey:@"substitute_+_by_00_preference"]; - //possible valid config detected - LinphoneProxyConfig* proxyCfg; - proxyCfg = linphone_proxy_config_new(); - - // add username password - LinphoneAddress *from = linphone_address_new(identity); - LinphoneAuthInfo *info; - if (from !=0){ - info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL); - linphone_core_add_auth_info(theLinphoneCore,info); - } - linphone_address_destroy(from); - - // configure proxy entries - linphone_proxy_config_set_identity(proxyCfg,identity); - linphone_proxy_config_set_server_addr(proxyCfg,proxy); - linphone_proxy_config_enable_register(proxyCfg,true); - BOOL isWifiOnly = [[NSUserDefaults standardUserDefaults] boolForKey:@"wifi_only_preference"]; - LinphoneManager* lLinphoneMgr = [LinphoneManager instance]; - if (isWifiOnly && lLinphoneMgr.connectivity == wwan) { - linphone_proxy_config_expires(proxyCfg, 0); - } else { - linphone_proxy_config_expires(proxyCfg, DEFAULT_EXPIRES); - } - - if (isOutboundProxy) - linphone_proxy_config_set_route(proxyCfg,proxy); - - if ([prefix length]>0) { - linphone_proxy_config_set_dial_prefix(proxyCfg, [prefix cStringUsingEncoding:[NSString defaultCStringEncoding]]); - } - linphone_proxy_config_set_dial_escape_plus(proxyCfg,substitute_plus_by_00); - - linphone_core_add_proxy_config(theLinphoneCore,proxyCfg); - //set to default proxy - linphone_core_set_default_proxy(theLinphoneCore,proxyCfg); - - } else { - if (configCheckDisable == false ) { - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Warning",nil) - message:NSLocalizedString(@"It seems you have not configured any proxy server from settings",nil) - delegate:self - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:NSLocalizedString(@"Never remind",nil),nil]; - [error show]; - [error release]; - } - } - - //Configure Codecs - - PayloadType *pt; - //get codecs from linphonerc - const MSList *audioCodecs=linphone_core_get_audio_codecs(theLinphoneCore); - const MSList *elem; - //disable all codecs - for (elem=audioCodecs;elem!=NULL;elem=elem->next){ - pt=(PayloadType*)elem->data; - linphone_core_enable_payload_type(theLinphoneCore,pt,FALSE); - } - - //read codecs from setting bundle and enable them one by one - if ([self isNotIphone3G]) { - [self configurePayloadType:"SILK" fromPrefKey:@"silk_24k_preference" withRate:24000]; - } - else { - ms_message("SILK 24khz codec deactivated"); - } - [self configurePayloadType:"speex" fromPrefKey:@"speex_16k_preference" withRate:16000]; - [self configurePayloadType:"speex" fromPrefKey:@"speex_8k_preference" withRate:8000]; - [self configurePayloadType:"SILK" fromPrefKey:@"silk_16k_preference" withRate:16000]; - [self configurePayloadType:"AMR" fromPrefKey:@"amr_8k_preference" withRate:8000]; - [self configurePayloadType:"GSM" fromPrefKey:@"gsm_8k_preference" withRate:8000]; - [self configurePayloadType:"iLBC" fromPrefKey:@"ilbc_preference" withRate:8000]; - [self configurePayloadType:"PCMU" fromPrefKey:@"pcmu_preference" withRate:8000]; - [self configurePayloadType:"PCMA" fromPrefKey:@"pcma_preference" withRate:8000]; - [self configurePayloadType:"G722" fromPrefKey:@"g722_preference" withRate:8000]; - [self configurePayloadType:"G729" fromPrefKey:@"g729_preference" withRate:8000]; - - //get video codecs from linphonerc - const MSList *videoCodecs=linphone_core_get_video_codecs(theLinphoneCore); - //disable video all codecs - for (elem=videoCodecs;elem!=NULL;elem=elem->next){ - pt=(PayloadType*)elem->data; - linphone_core_enable_payload_type(theLinphoneCore,pt,FALSE); - } - [self configurePayloadType:"MP4V-ES" fromPrefKey:@"mp4v-es_preference" withRate:90000]; - [self configurePayloadType:"H264" fromPrefKey:@"h264_preference" withRate:90000]; - [self configurePayloadType:"VP8" fromPrefKey:@"vp8_preference" withRate:90000]; - - if ([self isNotIphone3G]) { - bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"]; - linphone_core_enable_video(theLinphoneCore, enableVideo, enableVideo); - } else { - linphone_core_enable_video(theLinphoneCore, FALSE, FALSE); - ms_warning("Disable video for phones prior to iPhone 3GS"); - } - bool enableSrtp = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_srtp_preference"]; - linphone_core_set_media_encryption(theLinphoneCore, enableSrtp?LinphoneMediaEncryptionSRTP:LinphoneMediaEncryptionZRTP); - - NSString* stun_server = [[NSUserDefaults standardUserDefaults] stringForKey:@"stun_preference"]; - if ([stun_server length]>0){ - linphone_core_set_stun_server(theLinphoneCore,[stun_server cStringUsingEncoding:[NSString defaultCStringEncoding]]); - linphone_core_set_firewall_policy(theLinphoneCore, LinphonePolicyUseStun); - }else{ - linphone_core_set_stun_server(theLinphoneCore, NULL); - linphone_core_set_firewall_policy(theLinphoneCore, LinphonePolicyNoFirewall); - } - - LinphoneVideoPolicy policy; - policy.automatically_accept = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];; - policy.automatically_initiate = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"]; - linphone_core_set_video_policy(theLinphoneCore, &policy); - - UIDevice* device = [UIDevice currentDevice]; - bool backgroundSupported = false; - if ([device respondsToSelector:@selector(isMultitaskingSupported)]) - backgroundSupported = [device isMultitaskingSupported]; - - if (backgroundSupported) { - isbackgroundModeEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"backgroundmode_preference"]; - } else { - isbackgroundModeEnabled=false; - } - - [currentSettings release]; - currentSettings = newSettings; - [currentSettings retain]; - - return YES; -} - (BOOL)isNotIphone3G { - size_t size; - sysctlbyname("hw.machine", NULL, &size, NULL, 0); - char *machine = malloc(size); - sysctlbyname("hw.machine", machine, &size, NULL, 0); - NSString *platform = [[NSString alloc ] initWithUTF8String:machine]; - free(machine); + static BOOL done=FALSE; + static BOOL result; + if (!done){ + size_t size; + sysctlbyname("hw.machine", NULL, &size, NULL, 0); + char *machine = malloc(size); + sysctlbyname("hw.machine", machine, &size, NULL, 0); + NSString *platform = [[NSString alloc ] initWithUTF8String:machine]; + free(machine); - BOOL result = ![platform isEqualToString:@"iPhone1,2"]; + result = ![platform isEqualToString:@"iPhone1,2"]; - [platform release]; + [platform release]; + done=TRUE; + } return result; } // no proxy configured alert - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { - if (buttonIndex == 1) { - [[NSUserDefaults standardUserDefaults] setBool:true forKey:@"check_config_disable_preference"]; - } + } -(void) destroyLibLinphone { [mIterateTimer invalidate]; @@ -906,18 +654,11 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *confiFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/.linphonerc"]; NSString *zrtpSecretsFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/zrtp_secrets"]; + const char* lRootCa = [[myBundle pathForResource:@"rootca"ofType:@"pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; connectivity=none; signal(SIGPIPE, SIG_IGN); //log management - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"debugenable_preference"]) { - //redirect all traces to the iphone log framework - linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler); - } - else { - linphone_core_disable_logs(); - } - libmsilbc_init(); #if defined (HAVE_SILK) libmssilk_init(); @@ -940,13 +681,17 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach , [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]] ,self); - [[NSUserDefaults standardUserDefaults] synchronize];//sync before loading config + linphone_core_set_root_ca(theLinphoneCore, lRootCa); + // Set audio assets + const char* lRing = [[myBundle pathForResource:@"oldphone-mono"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); + linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]); [self setupNetworkReachabilityCallback: "linphone.org" withContext:nil]; - - [self reconfigureLinphoneIfNeeded:nil]; // start scheduler mIterateTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 @@ -1001,6 +746,14 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach NSUInteger cpucount = [[NSProcessInfo processInfo] processorCount]; ms_set_cpu_count(cpucount); + if (![self isNotIphone3G]){ + PayloadType *pt=linphone_core_find_payload_type(theLinphoneCore,"SILK",24000); + if (pt) { + linphone_core_enable_payload_type(theLinphoneCore,pt,FALSE); + ms_warning("SILK/24000 and video disabled on old iPhone 3G"); + } + linphone_core_enable_video(theLinphoneCore, FALSE, FALSE); + } ms_warning("Linphone [%s] started on [%s], running with [%u] processor(s)" ,linphone_core_get_version() @@ -1026,15 +779,12 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach //back from standby and background mode is disabled [self startLibLinphone]; } else { - if (![self reconfigureLinphoneIfNeeded:currentSettings]) { - ms_message("becoming active with no config modification, make sure we are registered"); - [self refreshRegisters]; - } + [self refreshRegisters]; } /*IOS specific*/ linphone_core_start_dtmf_stream(theLinphoneCore); - } + -(void) registerLogView:(id) view { mLogView = view; } @@ -1070,7 +820,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } -(void) settingsViewControllerDidEnd:(IASKAppSettingsViewController *)sender { - [self reconfigureLinphoneIfNeeded: currentSettings]; + NSLog(@"settingsViewControllerDidEnd"); } -(NSDictionary*) filterPreferenceSpecifier:(NSDictionary *)specifier { @@ -1086,23 +836,21 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach // child pane maybe NSString* title = [specifier objectForKey:@"Title"]; if ([title isEqualToString:@"Video"]) { - if (!linphone_core_video_enabled(theLinphoneCore)) + if (!linphone_core_video_supported(theLinphoneCore)) return nil; } return specifier; } // NSLog(@"Specifier received: %@", identifier); - if ([identifier isEqualToString:@"srtp_preference"]) { - if (!ortp_srtp_supported()) - return nil; - } else if ([identifier hasPrefix:@"silk"]) { - if ([identifier isEqualToString:@"speex_24k_preference"]) { - if (linphone_core_find_payload_type(theLinphoneCore, "SILK", 24000)) return nil; - } else if ([identifier isEqualToString:@"speex_16k_preference"]) { - if (linphone_core_find_payload_type(theLinphoneCore, "SILK", 16000)) return nil; - } else if ([identifier isEqualToString:@"speex_8k_preference"]) { - if (linphone_core_find_payload_type(theLinphoneCore, "SILK", 8000)) return nil; - } + if ([identifier hasPrefix:@"silk"]) { + if (linphone_core_find_payload_type(theLinphoneCore,"SILK",8000)==NULL){ + return nil; + } + if ([identifier isEqualToString:@"silk_24k_preference"]) { + if (![self isNotIphone3G]) + return nil; + } + } else if ([identifier isEqualToString:@"backgroundmode_preference"]) { UIDevice* device = [UIDevice currentDevice]; if ([device respondsToSelector:@selector(isMultitaskingSupported)]) { diff --git a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h index 2eaaa2ca0..f98f3b494 100644 --- a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h +++ b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.h @@ -17,6 +17,7 @@ #import #import +#import "IASKSettingsReader.h" #import "IASKSettingsStore.h" #import "IASKViewController.h" @@ -64,6 +65,7 @@ NSMutableArray *_viewList; IASKSettingsReader *_settingsReader; + id _settingsReaderDelegate; id _settingsStore; NSString *_file; @@ -75,6 +77,7 @@ @property (nonatomic, assign) IBOutlet id delegate; @property (nonatomic, copy) NSString *file; +@property (nonatomic, assign) id settingsReaderDelegate; @property (nonatomic, assign) BOOL showCreditsFooter; @property (nonatomic, assign) BOOL showDoneButton; diff --git a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m index d3593e1b0..557c33730 100644 --- a/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m +++ b/InAppSettingsKit/Controllers/IASKAppSettingsViewController.m @@ -63,11 +63,12 @@ CGRect IASKCGRectSwap(CGRect rect); @synthesize showCreditsFooter = _showCreditsFooter; @synthesize showDoneButton = _showDoneButton; @synthesize settingsStore = _settingsStore; +@synthesize settingsReaderDelegate = _settingsReaderDelegate; #pragma mark accessors - (IASKSettingsReader*)settingsReader { if (!_settingsReader) { - _settingsReader = [[IASKSettingsReader alloc] initWithFile:self.file]; + _settingsReader = [[IASKSettingsReader alloc] initWithFile:self.file andDelegate:self.settingsReaderDelegate]; } return _settingsReader; } @@ -267,7 +268,7 @@ CGRect IASKCGRectSwap(CGRect rect); [self.delegate settingsViewControllerDidEnd:self]; } // reload - [self.settingsReader initWithFile:self.file]; + [self.settingsReader initWithFile:self.file andDelegate:self.settingsReaderDelegate]; [self.tableView reloadData]; } @@ -620,9 +621,9 @@ CGRect IASKCGRectSwap(CGRect rect); // load the view controll back in to push it targetViewController = [[self.viewList objectAtIndex:kIASKSpecifierChildViewControllerIndex] objectForKey:@"viewController"]; } + targetViewController.settingsReaderDelegate = self.settingsReaderDelegate; targetViewController.file = specifier.file; // changes settingsReader - targetViewController.settingsReader.delegate = self.settingsReader.delegate; - [targetViewController.settingsReader initWithFile:specifier.file]; + targetViewController.title = specifier.title; targetViewController.showCreditsFooter = NO; [[self navigationController] pushViewController:targetViewController animated:YES]; diff --git a/InAppSettingsKit/Models/IASKSettingsReader.h b/InAppSettingsKit/Models/IASKSettingsReader.h index bbdd1a5b5..c66156d8b 100644 --- a/InAppSettingsKit/Models/IASKSettingsReader.h +++ b/InAppSettingsKit/Models/IASKSettingsReader.h @@ -125,10 +125,10 @@ __VA_ARGS__ \ NSDictionary *_settingsBundle; NSArray *_dataSource; NSBundle *_bundle; - id delegate; + id _delegate; } -- (id)initWithFile:(NSString*)file; +- (id)initWithFile:(NSString*)file andDelegate:(id)delegate; - (NSInteger)numberOfSections; - (NSInteger)numberOfRowsForSection:(NSInteger)section; - (IASKSpecifier*)specifierForIndexPath:(NSIndexPath*)indexPath; @@ -145,5 +145,5 @@ __VA_ARGS__ \ @property (nonatomic, retain) NSString *bundlePath; @property (nonatomic, retain) NSDictionary *settingsBundle; @property (nonatomic, retain) NSArray *dataSource; -@property (nonatomic, retain) id delegate; + @end diff --git a/InAppSettingsKit/Models/IASKSettingsReader.m b/InAppSettingsKit/Models/IASKSettingsReader.m index dd82ce72b..7e53458ec 100644 --- a/InAppSettingsKit/Models/IASKSettingsReader.m +++ b/InAppSettingsKit/Models/IASKSettingsReader.m @@ -32,13 +32,13 @@ localizationTable=_localizationTable, bundlePath=_bundlePath, settingsBundle=_settingsBundle, dataSource=_dataSource; -@synthesize delegate; + - (id)init { - return [self initWithFile:@"Root"]; + return [self initWithFile:@"Root" andDelegate:nil]; } -- (id)initWithFile:(NSString*)file { +- (id)initWithFile:(NSString*)file andDelegate:(id)delegate{ if ((self=[super init])) { @@ -61,7 +61,7 @@ dataSource=_dataSource; self.localizationTable = @"Root"; } } - + _delegate=delegate; if (_settingsBundle) { [self _reinterpretBundle:_settingsBundle]; } @@ -86,8 +86,8 @@ dataSource=_dataSource; NSMutableArray *dataSource = [[[NSMutableArray alloc] init] autorelease]; for (NSDictionary *specifier in preferenceSpecifiers) { - if (delegate != nil) { - specifier = [delegate filterPreferenceSpecifier:specifier]; + if (_delegate != nil) { + specifier = [_delegate filterPreferenceSpecifier:specifier]; if (specifier == nil) { // skip continue; @@ -127,7 +127,8 @@ dataSource=_dataSource; - (NSInteger)numberOfRowsForSection:(NSInteger)section { int headingCorrection = [self _sectionHasHeading:section] ? 1 : 0; - return [(NSArray*)[[self dataSource] objectAtIndex:section] count] - headingCorrection; + NSInteger ret= [(NSArray*)[[self dataSource] objectAtIndex:section] count] - headingCorrection; + return ret; } - (IASKSpecifier*)specifierForIndexPath:(NSIndexPath*)indexPath { diff --git a/PhoneMainView.xib b/PhoneMainView.xib index 0052d5e1c..9faf37e10 100644 --- a/PhoneMainView.xib +++ b/PhoneMainView.xib @@ -2,13 +2,13 @@ 784 - 11C74 - 1938 - 1138.23 - 567.00 + 11E53 + 2182 + 1138.47 + 569.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 933 + 1181 YES @@ -67,10 +67,14 @@ IBCocoaTouchFramework NO - - + + + Settings + + NSImage + 20-gear2.png + IBCocoaTouchFramework - 0 @@ -81,7 +85,7 @@ YES IBCocoaTouchFramework NO - + 256 {0, 0} @@ -93,14 +97,12 @@ YES - - Informations - - Information + + + Root View Controller IBCocoaTouchFramework - - MoreViewController + 1 1 @@ -192,14 +194,11 @@ IBCocoaTouchFramework NO - - - Settings - - NSImage - 20-gear2.png - + + + IBCocoaTouchFramework + 0 @@ -210,7 +209,7 @@ YES IBCocoaTouchFramework NO - + 256 {0, 0} @@ -222,12 +221,14 @@ YES - - - Root View Controller + + Informations + + Information IBCocoaTouchFramework - + + MoreViewController 1 1 @@ -237,14 +238,12 @@ - 266 {{0, 431}, {320, 49}} - 3 MCAwAA @@ -541,7 +540,7 @@ 8.IBPluginDependency 9.IBPluginDependency - + YES UIApplication com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -603,6 +602,10 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -617,13 +620,13 @@ dialer-orange.png history-orange.png - + YES {26, 28} {25, 24} {25, 23} - 933 + 1181 diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 81e6e686e..97bdf99e3 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -78,7 +78,6 @@ 2242D91710D66BF300E9963F /* out_call.png in Resources */ = {isa = PBXBuildFile; fileRef = 2242D91510D66BF300E9963F /* out_call.png */; }; 2242D9C910D691F900E9963F /* GenericTabViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2242D9C810D691F900E9963F /* GenericTabViewController.m */; }; 2242E313125235120061DDCE /* oldphone-mono-30s.caf in Resources */ = {isa = PBXBuildFile; fileRef = 2242E312125235120061DDCE /* oldphone-mono-30s.caf */; }; - 2245671D107699F700F10948 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2245671C107699F700F10948 /* Settings.bundle */; }; 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 */; }; @@ -312,7 +311,8 @@ 57282931154AF1460076F540 /* history-orange.png in Resources */ = {isa = PBXBuildFile; fileRef = 34C7646B14CD5585008E9607 /* history-orange.png */; }; 57282933154AF14D0076F540 /* dialer-orange.png in Resources */ = {isa = PBXBuildFile; fileRef = 34C7646A14CD5585008E9607 /* dialer-orange.png */; }; 57D2B457157E4580002EA69B /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3415205B1563ABEB00205A0E /* MessageUI.framework */; }; - 57D2B45B1580FF58002EA69B /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 57D2B45A1580FF58002EA69B /* Settings.bundle */; }; + 57D2B47C1586384E002EA69B /* Inappsettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 57D2B47B15863820002EA69B /* Inappsettings.bundle */; }; + 57D2B47D1586384F002EA69B /* Inappsettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 57D2B47B15863820002EA69B /* Inappsettings.bundle */; }; 70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; }; 7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; }; 70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; }; @@ -518,7 +518,6 @@ 2242D9C710D691F900E9963F /* GenericTabViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericTabViewController.h; sourceTree = ""; }; 2242D9C810D691F900E9963F /* GenericTabViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GenericTabViewController.m; 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 = ""; }; - 2245671C107699F700F10948 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; 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 = ""; }; @@ -736,7 +735,7 @@ 34CA8534148F669900503C01 /* VideoViewController-ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "VideoViewController-ipad.xib"; sourceTree = ""; }; 34CA8537148F692A00503C01 /* MainScreenWithVideoPreview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainScreenWithVideoPreview.h; sourceTree = ""; }; 34CA8538148F692A00503C01 /* MainScreenWithVideoPreview.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainScreenWithVideoPreview.m; sourceTree = ""; }; - 57D2B45A1580FF58002EA69B /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; + 57D2B47B15863820002EA69B /* Inappsettings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Inappsettings.bundle; sourceTree = ""; }; 70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = Resources/rootca.pem; sourceTree = ""; }; 7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = ""; }; 70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; @@ -1213,7 +1212,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - 57D2B45A1580FF58002EA69B /* Settings.bundle */, + 57D2B47A15863820002EA69B /* settings */, 3415205B1563ABEB00205A0E /* MessageUI.framework */, 34151FB61563A8D800205A0E /* InAppSettingsKit */, 340751961506459A00B89C47 /* CoreTelephony.framework */, @@ -1260,7 +1259,6 @@ 2274402E106F335E006EC466 /* AudioToolbox.framework */, 22744043106F33FC006EC466 /* Security.framework */, 22744056106F9BC9006EC466 /* CoreFoundation.framework */, - 2245671C107699F700F10948 /* Settings.bundle */, 224567C1107B968500F10948 /* AVFoundation.framework */, 22F51EF5107FA66500F98953 /* untitled.plist */, 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */, @@ -1427,6 +1425,14 @@ path = Xibs; sourceTree = ""; }; + 57D2B47A15863820002EA69B /* settings */ = { + isa = PBXGroup; + children = ( + 57D2B47B15863820002EA69B /* Inappsettings.bundle */, + ); + path = settings; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -1504,7 +1510,6 @@ 22F2508F107141E100AC9B3F /* PhoneViewController.xib in Resources */, 22F254811073D99800AC9B3F /* ringback.wav in Resources */, 220FAE4B10767A6A0068D98F /* PhoneMainView.xib in Resources */, - 2245671D107699F700F10948 /* Settings.bundle in Resources */, 22F51EF6107FA66500F98953 /* untitled.plist in Resources */, 2237D4091084D7A9001383EE /* oldphone-mono.wav in Resources */, 227BCDC310D4004600FBFD76 /* CallHistoryTableViewController.xib in Resources */, @@ -1573,6 +1578,7 @@ 34151FF31563A8D800205A0E /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */, 34151FF41563A8D800205A0E /* IASKSpecifierValuesView.xib in Resources */, 3415205A1563AA8F00205A0E /* 20-gear2.png in Resources */, + 57D2B47C1586384E002EA69B /* Inappsettings.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1580,7 +1586,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 57D2B45B1580FF58002EA69B /* Settings.bundle in Resources */, 22D8F11F147548E2008C97DB /* linphonerc in Resources */, 22D8F120147548E2008C97DB /* PhoneViewController.xib in Resources */, 22D8F121147548E2008C97DB /* ringback.wav in Resources */, @@ -1647,6 +1652,7 @@ 341520081563A93B00205A0E /* IASKPSTextFieldSpecifierViewCell.xib in Resources */, 341520091563A93B00205A0E /* IASKPSToggleSwitchSpecifierViewCell.xib in Resources */, 3415200A1563A93B00205A0E /* IASKSpecifierValuesView.xib in Resources */, + 57D2B47D1586384F002EA69B /* Inappsettings.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/nogpl-thirdparties/Settings.bundle/Advanced.plist b/nogpl-thirdparties/Settings.bundle/Advanced.plist deleted file mode 100644 index c4d0b1f69..000000000 --- a/nogpl-thirdparties/Settings.bundle/Advanced.plist +++ /dev/null @@ -1,103 +0,0 @@ - - - - - PreferenceSpecifiers - - - Key - stun_preference - Title - Stun server - Type - PSTextFieldSpecifier - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - - - DefaultValue - - Key - debugenable_preference - Title - Debug - Type - PSToggleSwitchSpecifier - - - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - IsSecure - - Key - prefix_preference - KeyboardType - NumberPad - Title - Prefix - Type - PSTextFieldSpecifier - - - DefaultValue - - Key - substitute_+_by_00_preference - Title - Substitue + by 00 - Type - PSToggleSwitchSpecifier - - - DefaultValue - udp - Key - transport_preference - Title - Transport - Titles - - udp - tcp - tls - - Type - PSMultiValueSpecifier - Values - - udp - tcp - tls - - - - DefaultValue - - Key - enable_srtp_preference - Title - Secure rtp - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - backgroundmode_preference - Title - Background mode - Type - PSToggleSwitchSpecifier - - - - diff --git a/nogpl-thirdparties/Settings.bundle/Root.plist b/nogpl-thirdparties/Settings.bundle/Root.plist deleted file mode 100644 index 4b6332f8e..000000000 --- a/nogpl-thirdparties/Settings.bundle/Root.plist +++ /dev/null @@ -1,131 +0,0 @@ - - - - - PreferenceSpecifiers - - - Title - SIP account - Type - PSGroupSpecifier - FooterText - Linphone must be restarted for changes to take effect - - - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - IsSecure - - Key - username_preference - KeyboardType - Alphabet - Title - User name - Type - PSTextFieldSpecifier - - - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - IsSecure - - Key - password_preference - KeyboardType - Alphabet - Title - Password - Type - PSTextFieldSpecifier - - - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - IsSecure - - Key - domain_preference - KeyboardType - URL - Title - Domain - Type - PSTextFieldSpecifier - - - AutocapitalizationType - None - AutocorrectionType - No - DefaultValue - - IsSecure - - Key - proxy_preference - KeyboardType - URL - Title - Proxy - Type - PSTextFieldSpecifier - - - DefaultValue - - Key - outbound_proxy_preference - Title - Outbound proxy - Type - PSToggleSwitchSpecifier - - - Title - - Type - PSGroupSpecifier - - - File - audio - Title - Audio Codecs - Type - PSChildPaneSpecifier - - - File - video - Title - Video - Type - PSChildPaneSpecifier - - - File - Advanced - Title - Advanced - Type - PSChildPaneSpecifier - - - StringsTable - Root - - diff --git a/nogpl-thirdparties/Settings.bundle/audio.plist b/nogpl-thirdparties/Settings.bundle/audio.plist deleted file mode 100644 index 670182e79..000000000 --- a/nogpl-thirdparties/Settings.bundle/audio.plist +++ /dev/null @@ -1,85 +0,0 @@ - - - - - PreferenceSpecifiers - - - Title - Codecs - Type - PSGroupSpecifier - - - DefaultValue - - Key - speex_16k_preference - Title - Speex 16Khz - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - speex_8k_preference - Title - Speex 8Khz - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - g722_preference - Title - G722 - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - gsm_8k_preference - Title - GSM - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - ilbc_preference - Title - ILBC - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - pcmu_preference - Title - PCMU - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - pcma_preference - Title - PCMA - Type - PSToggleSwitchSpecifier - - - - diff --git a/nogpl-thirdparties/Settings.bundle/en.lproj/Root.strings b/nogpl-thirdparties/Settings.bundle/en.lproj/Root.strings deleted file mode 100644 index 8cd87b9d6..000000000 Binary files a/nogpl-thirdparties/Settings.bundle/en.lproj/Root.strings and /dev/null differ diff --git a/nogpl-thirdparties/Settings.bundle/video.plist b/nogpl-thirdparties/Settings.bundle/video.plist deleted file mode 100644 index 976ec6284..000000000 --- a/nogpl-thirdparties/Settings.bundle/video.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - PreferenceSpecifiers - - - Type - PSToggleSwitchSpecifier - Title - Enable video - Key - enable_video_preference - DefaultValue - - - - Type - PSToggleSwitchSpecifier - Title - Automatically start video - Key - start_video_preference - DefaultValue - - - - Title - Codecs - Type - PSGroupSpecifier - - - DefaultValue - - Key - vp8_preference - Title - VP8 - Type - PSToggleSwitchSpecifier - - - - diff --git a/Settings.bundle/Advanced.plist b/settings/Inappsettings.bundle/Advanced.plist similarity index 100% rename from Settings.bundle/Advanced.plist rename to settings/Inappsettings.bundle/Advanced.plist diff --git a/Settings.bundle/Root.plist b/settings/Inappsettings.bundle/Root.plist similarity index 100% rename from Settings.bundle/Root.plist rename to settings/Inappsettings.bundle/Root.plist diff --git a/Settings.bundle/audio.plist b/settings/Inappsettings.bundle/audio.plist similarity index 100% rename from Settings.bundle/audio.plist rename to settings/Inappsettings.bundle/audio.plist diff --git a/Settings.bundle/en.lproj/Root.strings b/settings/Inappsettings.bundle/en.lproj/Root.strings similarity index 100% rename from Settings.bundle/en.lproj/Root.strings rename to settings/Inappsettings.bundle/en.lproj/Root.strings diff --git a/Settings.bundle/video.plist b/settings/Inappsettings.bundle/video.plist similarity index 100% rename from Settings.bundle/video.plist rename to settings/Inappsettings.bundle/video.plist diff --git a/submodules/libilbc-rfc3951 b/submodules/libilbc-rfc3951 index af32518af..a70714c2e 160000 --- a/submodules/libilbc-rfc3951 +++ b/submodules/libilbc-rfc3951 @@ -1 +1 @@ -Subproject commit af32518af41f97caee07070234a3475409b9a27d +Subproject commit a70714c2e8a1f6f9958450cb612e3dc9895981e7