diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index d34d8a0b8..e255c1e53 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -98,7 +98,7 @@ typedef struct _LinphoneManagerSounds { BOOL stopWaitingRegisters; UIBackgroundTaskIdentifier pausedCallBgTask; UIBackgroundTaskIdentifier incallBgTask; - CTCallCenter* callCenter; + CTCallCenter* mCallCenter; /* MODIFICATION: Add NSUSerdefault settings */ NSDictionary *currentSettings; diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 718311f9c..e8c8c9616 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -412,19 +412,19 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char } - if (state == LinphoneCallIncomingReceived - &&[[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)] - && [UIApplication sharedApplication].applicationState != UIApplicationStateActive) { + if (state == LinphoneCallIncomingReceived) { /*first step is to re-enable ctcall center*/ - [self setupGSMInteraction]; + CTCallCenter* lCTCallCenter = [[CTCallCenter alloc] init]; /*should we reject this call ?*/ - if ([callCenter currentCalls]!=nil) { + if ([lCTCallCenter currentCalls]!=nil) { [LinphoneLogger logc:LinphoneLoggerLog format:"Mobile call ongoing... rejecting call from [%s]",linphone_address_get_username(linphone_call_get_call_log(call)->from)]; linphone_core_decline_call([LinphoneManager getLc], call,LinphoneReasonBusy); + [lCTCallCenter release]; return; } + [lCTCallCenter release]; LinphoneCallLog* callLog=linphone_call_get_call_log(call); @@ -479,8 +479,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char [LinphoneLogger log:LinphoneLoggerWarning format:@"Call cannot ring any more, too late"]; }]; } - - } + } } } @@ -495,8 +494,10 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char // Disable speaker when no more call if ((state == LinphoneCallEnd || state == LinphoneCallError)) { - if(linphone_core_get_calls_nb([LinphoneManager getLc]) == 0) + if(linphone_core_get_calls_nb([LinphoneManager getLc]) == 0) { [self setSpeakerEnabled:FALSE]; + [self removeCTCallCenterCb]; + } if (incallBgTask) { [[UIApplication sharedApplication] endBackgroundTask:incallBgTask]; incallBgTask=0; @@ -512,7 +513,10 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char [self setSpeakerEnabled:TRUE]; } } - + if (state == LinphoneCallConnected && !mCallCenter) { + /*only register CT call center CB for connected call*/ + [self setupGSMInteraction]; + } // Post event NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSValue valueWithPointer:call], @"call", @@ -787,7 +791,6 @@ static LinphoneCoreVTable linphonec_vtable = { #if HAVE_G729 libmsbcg729_init(); // load g729 plugin #endif - [self setupGSMInteraction]; /* Initialize linphone core*/ /*to make sure we don't loose debug trace*/ @@ -795,6 +798,8 @@ static LinphoneCoreVTable linphonec_vtable = { linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler); } [LinphoneLogger logc:LinphoneLoggerLog format:"Create linphonecore"]; + linphone_core_set_user_agent([@"LinphoneIPhone" UTF8String], + [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey] UTF8String]); theLinphoneCore = linphone_core_new (&linphonec_vtable , [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]] , [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]] @@ -896,13 +901,8 @@ static LinphoneCoreVTable linphonec_vtable = { - (void)destroyLibLinphone { [mIterateTimer invalidate]; - // destroying eventHandler if app cannot go in background. - // Otherwise if a GSM call happen and Linphone is resumed, - // the handler will be called before LinphoneCore is built. - // Then handler will be restored in appDidBecomeActive cb - callCenter.callEventHandler = nil; - [callCenter release]; - callCenter = nil; + //just in case + [self removeCTCallCenterCb]; AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setDelegate:nil]; @@ -993,6 +993,13 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param) return linphone_call_get_state(call) != LinphoneCallPaused; } +- (void) startCallPausedLongRunningTask { + pausedCallBgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler: ^{ + [LinphoneLogger log:LinphoneLoggerWarning format:@"Call cannot be paused any more, too late"]; + }]; + [LinphoneLogger log:LinphoneLoggerLog format:@"Long running task started, remaining [%g s] because at least one call is paused" + ,[[UIApplication sharedApplication] backgroundTimeRemaining]]; +} - (BOOL)enterBackgroundMode { LinphoneProxyConfig* proxyCfg; linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg); @@ -1020,13 +1027,6 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param) return; } //kick up network cnx, just in case - [LinphoneManager kickOffNetworkConnection]; - - [self setupGSMInteraction]; - //to make sure presence status is correct - if ([callCenter currentCalls]==nil) - linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusAltService); - [self refreshRegisters]; linphone_core_iterate(theLinphoneCore); } @@ -1042,13 +1042,8 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param) if (!currentCall //no active call && callList // at least one call in a non active state && ms_list_find_custom((MSList*)callList, (MSCompareFunc) comp_call_state_paused, NULL)) { - pausedCallBgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler: ^{ - [LinphoneLogger log:LinphoneLoggerWarning format:@"Call cannot be paused any more, too late"]; - }]; - [LinphoneLogger log:LinphoneLoggerLog format:@"Long running task started, remaining [%fs] because at least one call is paused" - ,[[UIApplication sharedApplication] backgroundTimeRemaining]]; + [self startCallPausedLongRunningTask]; } - return YES; } else { @@ -1076,14 +1071,6 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param) /*IOS specific*/ linphone_core_start_dtmf_stream(theLinphoneCore); - - //call center is unrelialable on the long run, so we change it each time the application is resumed. To avoid zombie GSM call - [self setupGSMInteraction]; - - //to make sure presence status is correct - if ([callCenter currentCalls]==nil) - linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusAltService); - } @@ -1171,7 +1158,7 @@ static void audioRouteChangeListenerCallback ( return; } - + CTCallCenter* callCenter = [[CTCallCenter alloc] init]; if ([callCenter currentCalls]!=nil) { [LinphoneLogger logc:LinphoneLoggerError format:"GSM call in progress, cancelling outgoing SIP call request"]; UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil) @@ -1181,9 +1168,11 @@ static void audioRouteChangeListenerCallback ( otherButtonTitles:nil]; [error show]; [error release]; + [callCenter release]; return; } - + [callCenter release]; + LinphoneProxyConfig* proxyCfg; //get default proxy linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg); @@ -1664,18 +1653,24 @@ static void audioRouteChangeListenerCallback ( #pragma GSM management +-(void) removeCTCallCenterCb { + if (mCallCenter != nil) { + [LinphoneLogger log:LinphoneLoggerLog format:@"Removing CT call center listener [%p]",mCallCenter]; + mCallCenter.callEventHandler=NULL; + [mCallCenter release]; + } + mCallCenter=nil; +} - (void)setupGSMInteraction { - if (callCenter != nil) { - callCenter.callEventHandler=NULL; - [callCenter release]; - } - callCenter = [[CTCallCenter alloc] init]; - callCenter.callEventHandler = ^(CTCall* call) { + [self removeCTCallCenterCb]; + mCallCenter = [[CTCallCenter alloc] init]; + [LinphoneLogger log:LinphoneLoggerLog format:@"Adding CT call center listener [%p]",mCallCenter]; + mCallCenter.callEventHandler = ^(CTCall* call) { // post on main thread [self performSelectorOnMainThread:@selector(handleGSMCallInteration:) - withObject:callCenter + withObject:mCallCenter waitUntilDone:YES]; }; @@ -1686,12 +1681,15 @@ static void audioRouteChangeListenerCallback ( /* pause current call, if any */ LinphoneCall* call = linphone_core_get_current_call(theLinphoneCore); if ([ct currentCalls]!=nil) { - if (call) {[LinphoneLogger logc:LinphoneLoggerLog format:"Pausing SIP call"]; + if (call) { + [LinphoneLogger log:LinphoneLoggerLog format:@"Pausing SIP call because GSM call"]; linphone_core_pause_call(theLinphoneCore, call); + [self startCallPausedLongRunningTask]; + } else if (linphone_core_is_in_conference(theLinphoneCore)) { + [LinphoneLogger log:LinphoneLoggerLog format:@"Leaving conference call because GSM call"]; + linphone_core_leave_conference(theLinphoneCore); + [self startCallPausedLongRunningTask]; } - //set current status to busy - linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusBusy); - } else - linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusAltService); + } //else nop, keep call in paused state } @end diff --git a/Classes/LinphoneUI/UIDigitButton.m b/Classes/LinphoneUI/UIDigitButton.m index 96f410d41..d8f0a01e1 100644 --- a/Classes/LinphoneUI/UIDigitButton.m +++ b/Classes/LinphoneUI/UIDigitButton.m @@ -65,8 +65,8 @@ } - (void)dealloc { - [super dealloc]; [addressField release]; + [super dealloc]; } diff --git a/Resources/callbar_left_padding.png b/Resources/callbar_left_padding.png new file mode 100644 index 000000000..c54a13b3c Binary files /dev/null and b/Resources/callbar_left_padding.png differ diff --git a/Resources/callbar_right_padding.png b/Resources/callbar_right_padding.png new file mode 100644 index 000000000..fc859f667 Binary files /dev/null and b/Resources/callbar_right_padding.png differ diff --git a/Settings.bundle/Advanced.plist b/Settings.bundle/Advanced.plist index b3d2465e0..f7e8325e8 100644 --- a/Settings.bundle/Advanced.plist +++ b/Settings.bundle/Advanced.plist @@ -70,7 +70,7 @@ Key audio_port_preference Title - Audio Port + Audio Port(s) Type PSTextFieldSpecifier AutocapitalizationType @@ -78,7 +78,7 @@ AutocorrectionType No KeyboardType - NumberPad + NumbersAndPunctuation DefaultValue 7076 @@ -86,7 +86,7 @@ Key video_port_preference Title - Video Port + Video Port(s) Type PSTextFieldSpecifier AutocapitalizationType @@ -94,7 +94,7 @@ AutocorrectionType No KeyboardType - NumberPad + NumbersAndPunctuation DefaultValue 9078 diff --git a/Settings/InAppSettings.bundle/en.lproj/Network.strings b/Settings/InAppSettings.bundle/en.lproj/Network.strings index 0af66238b..a2aa822d3 100644 --- a/Settings/InAppSettings.bundle/en.lproj/Network.strings +++ b/Settings/InAppSettings.bundle/en.lproj/Network.strings @@ -13,11 +13,11 @@ /* Port */ "Port" = "Port"; -/* Audio Port */ -"Audio Port" = "Audio Port"; +/* Audio Port(s) */ +"Audio Port(s)" = "Audio Port(s)"; -/* Video Port */ -"Video Port" = "Video Port"; +/* Video Port(s) */ +"Video Port(s)" = "Video Port(s)"; /* Transport */ "Transport" = "Transport"; diff --git a/Settings/InAppSettings.bundle/fr.lproj/Network.strings b/Settings/InAppSettings.bundle/fr.lproj/Network.strings index 8235ab319..105b01f75 100644 --- a/Settings/InAppSettings.bundle/fr.lproj/Network.strings +++ b/Settings/InAppSettings.bundle/fr.lproj/Network.strings @@ -13,11 +13,11 @@ /* Port */ "Port" = "Port"; -/* Audio Port */ -"Audio Port" = "Port Audio"; +/* Audio Port(s) */ +"Audio Port(s)" = "Port(s) Audio"; -/* Video Port */ -"Video Port" = "Port Vidéo"; +/* Video Port(s) */ +"Video Port(s)" = "Port(s) Vidéo"; /* Transport */ "Transport" = "Transport"; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index e9553469d..04a681bc6 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -1618,6 +1618,8 @@ D32EDDA91600C8FC009A84C7 /* ringtone_04_1600_loop.wav in Resources */, D32EDDAB1600C8FC009A84C7 /* ringtone_05_1600_loop.wav in Resources */, D30B942316358C7F00D53C46 /* BuschJaegerManualSettingsView.xib in Resources */, + D33E1F08164CF35100CFA363 /* callbar_left_padding.png in Resources */, + D33E1F0A164CF35100CFA363 /* callbar_right_padding.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1678,6 +1680,8 @@ D32EDDAA1600C8FC009A84C7 /* ringtone_04_1600_loop.wav in Resources */, D32EDDAC1600C8FC009A84C7 /* ringtone_05_1600_loop.wav in Resources */, D30B942416358C7F00D53C46 /* BuschJaegerManualSettingsView.xib in Resources */, + D33E1F09164CF35100CFA363 /* callbar_left_padding.png in Resources */, + D33E1F0B164CF35100CFA363 /* callbar_right_padding.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/submodules/build/builders.d/x264.mk b/submodules/build/builders.d/x264.mk index fbe943686..203ffe351 100644 --- a/submodules/build/builders.d/x264.mk +++ b/submodules/build/builders.d/x264.mk @@ -43,12 +43,12 @@ ifneq (,$(findstring armv7,$(host))) endif x264_dir?=externals/x264 -$(BUILDER_SRC_DIR)/$(x264_dir)/patched : - cd $(BUILDER_SRC_DIR)/$(x264_dir) \ - && git apply $(BUILDER_SRC_DIR)/build/builders.d/x264.patch \ - && touch $(BUILDER_SRC_DIR)/$(x264_dir)/patched +#$(BUILDER_SRC_DIR)/$(x264_dir)/patched : +# cd $(BUILDER_SRC_DIR)/$(x264_dir) \ +# && git apply $(BUILDER_SRC_DIR)/build/builders.d/x264.patch \ +# && touch $(BUILDER_SRC_DIR)/$(x264_dir)/patched -$(BUILDER_BUILD_DIR)/$(x264_dir)/configure: $(BUILDER_SRC_DIR)/$(x264_dir)/patched +$(BUILDER_BUILD_DIR)/$(x264_dir)/configure: mkdir -p $(BUILDER_BUILD_DIR)/$(x264_dir) cd $(BUILDER_BUILD_DIR)/$(x264_dir)/ \ && rsync -av --exclude ".git" $(BUILDER_SRC_DIR)/$(x264_dir)/* . @@ -66,6 +66,9 @@ clean-x264: veryclean-x264: -cd $(BUILDER_BUILD_DIR)/$(x264_dir) && make distclean + cd $(BUILDER_SRC_DIR)/$(x264_dir)/ \ + && git checkout common/arm/asm.S \ + && rm -f patched rm -rf $(BUILDER_BUILD_DIR)/$(x264_dir) clean-makefile-x264: diff --git a/submodules/externals/x264 b/submodules/externals/x264 index 926a03a9c..f6a8615ab 160000 --- a/submodules/externals/x264 +++ b/submodules/externals/x264 @@ -1 +1 @@ -Subproject commit 926a03a9c1f48d0fbd54b0e802d740774c100a78 +Subproject commit f6a8615ab0c922ac2cb5c82c9824f6f4742b1725