From cdc7c80a6ae6c696048c0e69b414c49edd81f7b3 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Tue, 6 Mar 2012 14:20:32 +0100 Subject: [PATCH] User cannot start a SIP call if a GSM call exists --- Classes/LinphoneUI/UICallButton.m | 15 +++++++++++++++ linphone.xcodeproj/project.pbxproj | 6 ++++++ 2 files changed, 21 insertions(+) diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index 58ddac124..8ab033b6d 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -19,6 +19,7 @@ #import "UICallButton.h" #import "LinphoneManager.h" +#import "CoreTelephony/CTCallCenter.h" @implementation UICallButton @@ -33,6 +34,20 @@ [error release]; return; } + + CTCallCenter* ct = [[CTCallCenter alloc] init]; + if ([ct.currentCalls count] > 0) { + ms_error("GSM call in progress, cancelling outgoing SIP call request"); + UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil) + message:NSLocalizedString(@"Please terminate GSM call",nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil]; + [error show]; + [error release]; + return; + } + if (TRUE /*!linphone_core_in_call([LinphoneManager getLc])*/) { LinphoneProxyConfig* proxyCfg; //get default proxy diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 248799e19..43720f891 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -216,6 +216,8 @@ 22F254811073D99800AC9B3F /* ringback.wav in Resources */ = {isa = PBXBuildFile; fileRef = 22F254801073D99800AC9B3F /* ringback.wav */; }; 22F51EF6107FA66500F98953 /* untitled.plist in Resources */ = {isa = PBXBuildFile; fileRef = 22F51EF5107FA66500F98953 /* untitled.plist */; }; 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; + 340751971506459A00B89C47 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 340751961506459A00B89C47 /* CoreTelephony.framework */; }; + 34075199150645A300B89C47 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 340751961506459A00B89C47 /* CoreTelephony.framework */; }; 340A75B014C0670B006AA708 /* ConferenceCallDetailView-ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 340A75AF14C0670A006AA708 /* ConferenceCallDetailView-ipad.xib */; }; 340A75B114C0670B006AA708 /* ConferenceCallDetailView-ipad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 340A75AF14C0670A006AA708 /* ConferenceCallDetailView-ipad.xib */; }; 3418843714C58BB100EA48C7 /* nowebcamCIF.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3418843614C58BB100EA48C7 /* nowebcamCIF.jpg */; }; @@ -611,6 +613,7 @@ 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* linphone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = linphone_Prefix.pch; sourceTree = ""; }; + 340751961506459A00B89C47 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; 340A75AF14C0670A006AA708 /* ConferenceCallDetailView-ipad.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = "ConferenceCallDetailView-ipad.xib"; sourceTree = ""; }; 3418843614C58BB100EA48C7 /* nowebcamCIF.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = nowebcamCIF.jpg; path = submodules/linphone/mediastreamer2/src/nowebcamCIF.jpg; sourceTree = ""; }; 3418844514C6CAD300EA48C7 /* StatusSubViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusSubViewController.h; sourceTree = ""; }; @@ -653,6 +656,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 340751971506459A00B89C47 /* CoreTelephony.framework in Frameworks */, 226CDADF14E2D0B800513B67 /* libbcg729.a in Frameworks */, 226CDAE014E2D0B800513B67 /* libmsbcg729.a in Frameworks */, 344ABDF114850AE9007420B6 /* libc++.1.dylib in Frameworks */, @@ -705,6 +709,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 34075199150645A300B89C47 /* CoreTelephony.framework in Frameworks */, 22D8F15B147548E2008C97DB /* libvpx.a in Frameworks */, 22D8F15C147548E2008C97DB /* QuartzCore.framework in Frameworks */, 22D8F15D147548E2008C97DB /* OpenGLES.framework in Frameworks */, @@ -1116,6 +1121,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + 340751961506459A00B89C47 /* CoreTelephony.framework */, 226CDADD14E2D0B800513B67 /* libbcg729.a */, 226CDADE14E2D0B800513B67 /* libmsbcg729.a */, 344ABDEF14850AE9007420B6 /* libc++.1.dylib */,