Revert "Do not allow user to start/answer a SIP call when a GSM call is active"

This reverts commit 2ab0771646.
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2011-12-01 16:03:44 +01:00
parent 2ab0771646
commit 710076633f
7 changed files with 11 additions and 37 deletions

View file

@ -22,7 +22,7 @@
#import "linphonecore.h"
#include "LinphoneManager.h"
#include "private.h"
#import "ContactPickerDelegate.h"
#import "ContactPickerDelegate.h"Òß
@implementation IncallViewController

View file

@ -42,10 +42,6 @@
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[LinphoneManager instance] becomeActive];
if (myPhoneViewController != nil) {
[myPhoneViewController updateCallAndBackButtons];
}
}
- (void) loadDefaultSettings {

View file

@ -48,7 +48,6 @@ typedef enum _Connectivity {
}
+(LinphoneManager*) instance;
+(LinphoneCore*) getLc;
+(BOOL) audioSessionInterrupted;
-(void) registerLogView:(id<LogView>) view;

View file

@ -30,7 +30,6 @@
static LinphoneCore* theLinphoneCore=nil;
static LinphoneManager* theLinphoneManager=nil;
static BOOL audioSessionInterrupted = NO;
extern void libmsilbc_init();
#ifdef HAVE_AMR
@ -836,8 +835,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
-(void) beginInterruption {
audioSessionInterrupted = YES;
LinphoneCall* c = linphone_core_get_current_call(theLinphoneCore);
ms_message("Sound interruption detected!");
if (c) {
@ -853,12 +850,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
ms_message("Auto resuming call");
linphone_core_resume_call(theLinphoneCore, (LinphoneCall*) c->data);
}
audioSessionInterrupted = NO;
}
+(BOOL) audioSessionInterrupted {
return audioSessionInterrupted;
}

View file

@ -64,8 +64,6 @@
IncallViewController* mIncallViewController;
}
-(void) updateCallAndBackButtons;
@property (nonatomic, retain) IBOutlet UIView* dialerView;
@property (nonatomic, retain) IBOutlet UITextField* address;

View file

@ -164,12 +164,6 @@
[exc.name cStringUsingEncoding:[NSString defaultCStringEncoding]],
[exc.reason cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
/* if audio session is unavailable -> disable call buttons */
if ([LinphoneManager audioSessionInterrupted]) {
[callShort setEnabled:NO];
[callLarge setEnabled:NO];
}
}
-(void)viewWillAppear:(BOOL)animated {
@ -218,13 +212,7 @@
-(void) displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName {
if ([LinphoneManager audioSessionInterrupted]) {
// TODO: should we notify the user and let him cancel the call (without letting him accept it) ?
ms_message("Call refused: audio session is not available");
linphone_core_terminate_call([LinphoneManager getLc], call);
return;
}
if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
// Create a new notification
@ -245,16 +233,17 @@
cd.delegate = self;
cd.call = call;
mIncomingCallActionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username]
delegate:cd
cancelButtonTitle:NSLocalizedString(@"Decline",nil)
mIncomingCallActionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username]
delegate:cd
cancelButtonTitle:NSLocalizedString(@"Decline",nil)
destructiveButtonTitle:NSLocalizedString(@"Answer",nil)
otherButtonTitles:nil];
otherButtonTitles:nil];
mIncomingCallActionSheet.actionSheetStyle = UIActionSheetStyleDefault;
[mIncomingCallActionSheet showInView:self.parentViewController.view];
[mIncomingCallActionSheet release];
}
}
-(void) backToCallViewPressed {
@ -303,7 +292,7 @@
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas{
LinphoneCall* call = (LinphoneCall*)datas;
if (buttonIndex == actionSheet.destructiveButtonIndex ) {
if (buttonIndex == 0 ) {
linphone_core_accept_call([LinphoneManager getLc],call);
} else {
linphone_core_terminate_call ([LinphoneManager getLc], call);

@ -1 +1 @@
Subproject commit f288044136b3e60baf6c0805e8cf87e5cdbc7890
Subproject commit c3da0303519ad3120355cb85baee9cf6d0e4d1c2