diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index 7a66c02f6..188ce8d9c 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -19,7 +19,7 @@ #import "LinphoneManager.h" -#include "linphonecore.h" +#include "linphonecore_utils.h" #include #include #include @@ -468,6 +468,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach LinphoneProxyConfig* proxyCfg; LinphoneAddress *addr; linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg); + linphone_core_stop_dtmf_stream(theLinphoneCore); if (isbackgroundModeEnabled && proxyCfg) { //For registration register @@ -486,6 +487,10 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach if ([[UIApplication sharedApplication] setKeepAliveTimeout:600/*(NSTimeInterval)linphone_proxy_config_get_expires(proxyCfg)*/ handler:^{ ms_warning("keepalive handler"); + if (theLinphoneCore == nil) { + ms_warning("It seam that Linphone BG mode was deacticated, just skipping"); + return; + } //kick up network cnx, just in case linphone_core_set_network_reachable(theLinphoneCore,false); linphone_core_iterate(theLinphoneCore); @@ -614,7 +619,8 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach otherButtonTitles:nil ,nil]; [error show]; } - + /*IOS specific*/ + linphone_core_start_dtmf_stream(theLinphoneCore); } @@ -625,6 +631,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } else { ms_message("becomming active, make sure we are registered"); + linphone_core_start_dtmf_stream(theLinphoneCore); [self doRegister]; } diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index 77c9a7f01..ce3f08f49 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -64,7 +64,6 @@ UIActionSheet *mIncomingCallActionSheet; FirstLoginViewController* myFirstLoginViewController; - NSTimer *dtmf_warmup; } @property (nonatomic, retain) IBOutlet UITextField* address; diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 837ba5986..0aa8df5cd 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -81,14 +81,6 @@ */ -- (void)dtmfWarmup{ - @try { - linphone_core_play_dtmf([LinphoneManager getLc], ' ', 50); - } @catch (NSException *e) { - //nop - } -} - - (void)viewDidAppear:(BOOL)animated { [[UIApplication sharedApplication] setIdleTimerDisabled:true]; [mute reset]; @@ -98,27 +90,10 @@ [[LinphoneManager instance] setRegistrationDelegate:myFirstLoginViewController]; [self presentModalViewController:myFirstLoginViewController animated:true]; }; - /* - BIG HACK !! - The audio unit takes a lot of time to start, especially on iphone 3G - To prevent a one second delay while playing the first digit, we need to activate - the linphonecore graph responsible to play the dtmfs - */ - //[self dtmfWarmup]; - NSDate *soon=[NSDate dateWithTimeIntervalSince1970:(time(NULL)+1)]; - dtmf_warmup = [[NSTimer alloc] initWithFireDate:soon - interval:4 - target:self - selector:@selector(dtmfWarmup) - userInfo:nil - repeats:YES]; - [[NSRunLoop currentRunLoop] addTimer:dtmf_warmup - forMode:NSDefaultRunLoopMode]; } - (void)viewDidDisappear:(BOOL)animated { [[UIApplication sharedApplication] setIdleTimerDisabled:false]; - [dtmf_warmup invalidate]; } @@ -211,32 +186,33 @@ [myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; } --(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +-(void) displayIncalViewforUser:(NSString*) username withDisplayName:(NSString*) displayName { [hangup setEnabled:true]; if (displayName && [displayName length]>0) { [peerLabel setText:displayName]; } else { [peerLabel setText:username?username:@""]; } - if (linphone_call_get_state(linphone_core_get_current_call([LinphoneManager getLc])) == LinphoneCallConnected) { - [callDuration start]; - [callDuration setHidden:false]; - } else { - [callDuration setText:@"Calling..."]; - } - [address setHidden:true]; [incallView setHidden:false]; - if (linphone_call_get_dir(linphone_core_get_current_call([LinphoneManager getLc])) == LinphoneCallOutgoing) { - [call setEnabled:false]; - } - +} +-(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + [self displayIncalViewforUser:username + withDisplayName:displayName]; + [call setEnabled:false]; + [callDuration setText:@"Calling..."]; + [speaker reset]; } -(void) displayIncallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [self displayCallInProgressFromUI:viewCtrl - forUser:username + [callDuration start]; + [callDuration setHidden:false]; + + if (linphone_call_get_dir(linphone_core_get_current_call([LinphoneManager getLc])) == LinphoneCallIncoming) { + [self displayIncalViewforUser:username withDisplayName:displayName]; + [speaker reset]; + } } //status reporting -(void) displayStatus:(NSString*) message { diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index befec876c..d12246de2 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -275,7 +275,7 @@ 227BCDC010D4004600FBFD76 /* CallHistoryTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallHistoryTableViewController.m; sourceTree = ""; }; 227BCDC110D4004600FBFD76 /* CallHistoryTableViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CallHistoryTableViewController.xib; sourceTree = ""; }; 228697C311AC29B800E9E0CA /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; }; - 228B19AE130290C500F154D3 /* iTunesArtwork */ = {isa = PBXFileReference; lastKnownFileType = file; name = iTunesArtwork; path = Resources/iTunesArtwork; sourceTree = ""; }; + 228B19AE130290C500F154D3 /* iTunesArtwork */ = {isa = PBXFileReference; lastKnownFileType = text; name = iTunesArtwork; path = Resources/iTunesArtwork; sourceTree = ""; }; 22968A5D12F875C600588287 /* UISpeakerButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UISpeakerButton.h; sourceTree = ""; }; 22968A5E12F875C600588287 /* UISpeakerButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UISpeakerButton.m; sourceTree = ""; }; 22968A8612F87C2000588287 /* UIDuration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDuration.h; sourceTree = ""; }; @@ -859,47 +859,6 @@ }; name = Debug; }; - 1D6058950D05DD3E006BFB54 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = ""; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = linphone_Prefix.pch; - GCC_PREPROCESSOR_DEFINITIONS = IN_LINPHONE; - HEADER_SEARCH_PATHS = ( - submodules/linphone/coreapi, - submodules/linphone/mediastreamer2/include, - submodules/linphone/mediastreamer2/include, - submodules/linphone/oRTP/include, - submodules/externals/gsm/, - submodules/externals/osip/include, - submodules/externals/exosip/include, - submodules/externals/speex/include, - ); - INFOPLIST_FILE = "linphone-Info.plist"; - LIBRARY_SEARCH_PATHS = ( - "\"$(SRCROOT)/liblinphone-sdk/apple-darwin/lib\"", - "\"$(SRCROOT)/liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins\"", - ); - "LIBRARY_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = ( - "\"$(SRCROOT)/submodules/build/$(CONFIGURATION)-iphoneos\"", - "$(inherited)", - ); - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=*]" = ( - "\"$(SRCROOT)/submodules/build/$(CONFIGURATION)-iphonesimulator\"", - "$(inherited)", - ); - OTHER_LDFLAGS = ( - "-l", - linphone, - ); - PRODUCT_NAME = linphone; - SDKROOT = iphoneos; - }; - name = Release; - }; 228B19A61302902F00F154D3 /* Distribution adhoc */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1047,20 +1006,6 @@ }; name = Debug; }; - C01FCF5008A954540054247B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 3.1; - PREBINDING = NO; - SDKROOT = iphoneos; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1070,10 +1015,9 @@ 1D6058940D05DD3E006BFB54 /* Debug */, 22F51EE8107FA53D00F98953 /* Distribution */, 228B19A71302902F00F154D3 /* Distribution adhoc */, - 1D6058950D05DD3E006BFB54 /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "linphone" */ = { isa = XCConfigurationList; @@ -1081,10 +1025,9 @@ C01FCF4F08A954540054247B /* Debug */, 22F51EE7107FA53D00F98953 /* Distribution */, 228B19A61302902F00F154D3 /* Distribution adhoc */, - C01FCF5008A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; + defaultConfigurationName = Debug; }; /* End XCConfigurationList section */ }; diff --git a/submodules/externals/exosip b/submodules/externals/exosip index dce0ae082..3a19126bb 160000 --- a/submodules/externals/exosip +++ b/submodules/externals/exosip @@ -1 +1 @@ -Subproject commit dce0ae082f81a1da6209f21d174f83f808645095 +Subproject commit 3a19126bb96ac5df61ff11bd52b2142eed391a49 diff --git a/submodules/liblinphone.xcodeproj/project.pbxproj b/submodules/liblinphone.xcodeproj/project.pbxproj index bf225895d..06c7f1a2c 100644 --- a/submodules/liblinphone.xcodeproj/project.pbxproj +++ b/submodules/liblinphone.xcodeproj/project.pbxproj @@ -151,6 +151,7 @@ 222CA78611F6CFB100621220 /* sipsetup.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA76411F6CFB100621220 /* sipsetup.h */; }; 2252935B12F6CA4700DD9BFB /* ec-calibrator.c in Sources */ = {isa = PBXBuildFile; fileRef = 2252935A12F6CA4700DD9BFB /* ec-calibrator.c */; }; 225D355A124B1FF60008581C /* linphonecall.c in Sources */ = {isa = PBXBuildFile; fileRef = 225D3559124B1FF60008581C /* linphonecall.c */; }; + 229B9D5913043EAB00EFCD1C /* linphonecore_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 229B9D5813043EAB00EFCD1C /* linphonecore_utils.h */; }; 22A10B5611F84E2D00373793 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B4F11F84E2D00373793 /* config.h */; }; 22A10B5711F84E2D00373793 /* gsm.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B5011F84E2D00373793 /* gsm.h */; }; 22A10B5811F84E2D00373793 /* private.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B5211F84E2D00373793 /* private.h */; }; @@ -333,6 +334,7 @@ 222CA76411F6CFB100621220 /* sipsetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sipsetup.h; sourceTree = ""; }; 2252935A12F6CA4700DD9BFB /* ec-calibrator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "ec-calibrator.c"; path = "linphone/coreapi/ec-calibrator.c"; sourceTree = SOURCE_ROOT; }; 225D3559124B1FF60008581C /* linphonecall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = linphonecall.c; sourceTree = ""; }; + 229B9D5813043EAB00EFCD1C /* linphonecore_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = linphonecore_utils.h; sourceTree = ""; }; 22A10B4F11F84E2D00373793 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = ""; }; 22A10B5011F84E2D00373793 /* gsm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gsm.h; sourceTree = ""; }; 22A10B5111F84E2D00373793 /* gsm.h.orig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gsm.h.orig; sourceTree = ""; }; @@ -608,6 +610,7 @@ 222CA72D11F6CFB100621220 /* coreapi */ = { isa = PBXGroup; children = ( + 229B9D5813043EAB00EFCD1C /* linphonecore_utils.h */, 225D3559124B1FF60008581C /* linphonecall.c */, 22A10EE711F8920F00373793 /* mswebcam.c */, 222CA72E11F6CFB100621220 /* .gitignore */, @@ -772,6 +775,7 @@ 22A10B5911F84E2D00373793 /* proto.h in Headers */, 22A10B5A11F84E2D00373793 /* toast.h in Headers */, 22A10B5B11F84E2D00373793 /* unproto.h in Headers */, + 229B9D5913043EAB00EFCD1C /* linphonecore_utils.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/submodules/linphone b/submodules/linphone index 6cd830fda..7818dee64 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 6cd830fda4252457082f5b5be6909b573e11fd91 +Subproject commit 7818dee64bbdcb448d213d1bada84072488d4d4e