diff --git a/Classes/AdvancedPhoneViewController.m b/Classes/AdvancedPhoneViewController.m index d4b3a0392..6cc2a0eb6 100644 --- a/Classes/AdvancedPhoneViewController.m +++ b/Classes/AdvancedPhoneViewController.m @@ -18,7 +18,7 @@ */ #import "AdvancedPhoneViewController.h" - +#import "IncallViewController.h" @implementation AdvancedPhoneViewController @@ -38,29 +38,30 @@ withDisplayName:displayName]; } --(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { /*[super displayCallInProgressFromUI:viewCtrl forUser:username withDisplayName:displayName];*/ [self presentModalViewController:mIncallViewController animated:true]; - [mIncallViewController displayCallInProgressFromUI:viewCtrl + [mIncallViewController displayCall:call InProgressFromUI:viewCtrl forUser:username withDisplayName:displayName]; } --(void) displayIncallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - - if (linphone_call_get_dir(currentCall)==LinphoneCallIncoming){ - [self presentModalViewController:mIncallViewController animated:true]; - } - [super displayIncallFromUI:viewCtrl +-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + if (self.presentedViewController != mIncallViewController && (call == 0x0 || + linphone_call_get_dir(call)==LinphoneCallIncoming)){ + [self presentModalViewController:mIncallViewController animated:true]; + } + + [super displayInCall:call FromUI:viewCtrl forUser:username withDisplayName:displayName]; - [mIncallViewController displayIncallFromUI:viewCtrl + [mIncallViewController displayInCall:call FromUI:viewCtrl forUser:username withDisplayName:displayName]; @@ -76,6 +77,11 @@ [mIncallViewController updateUIFromLinphoneState:viewCtrl]; } +-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + [mIncallViewController displayVideoCall:call FromUI:viewCtrl + forUser:username + withDisplayName:displayName]; +} - (void)dealloc { [mIncallViewController release]; [super dealloc]; diff --git a/Classes/CallDelegate.h b/Classes/CallDelegate.h new file mode 100644 index 000000000..02b69b026 --- /dev/null +++ b/Classes/CallDelegate.h @@ -0,0 +1,27 @@ +// +// CallDelegate.h +// linphone +// +// Created by Pierre-Eric Pelloux-Prayer on 03/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import +#include "linphonecore.h" + + +@protocol UIActionSheetCustomDelegate +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void*) datas; +@end + + +@interface CallDelegate : NSObject { + + LinphoneCall* call; + id delegate; +} + +@property (nonatomic) LinphoneCall* call; +@property (nonatomic, retain) id delegate; + +@end diff --git a/Classes/CallDelegate.m b/Classes/CallDelegate.m new file mode 100644 index 000000000..6ae87a25c --- /dev/null +++ b/Classes/CallDelegate.m @@ -0,0 +1,20 @@ +// +// CallDelegate.m +// linphone +// +// Created by Pierre-Eric Pelloux-Prayer on 03/11/11. +// Copyright (c) 2011 __MyCompanyName__. All rights reserved. +// + +#import "CallDelegate.h" + +@implementation CallDelegate + +@synthesize call; +@synthesize delegate; + +-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { + [delegate actionSheet:actionSheet clickedButtonAtIndex:buttonIndex withUserDatas:call]; +} + +@end diff --git a/Classes/IncallViewController.h b/Classes/IncallViewController.h index fd783733e..071b37419 100644 --- a/Classes/IncallViewController.h +++ b/Classes/IncallViewController.h @@ -21,23 +21,21 @@ #import "PhoneViewController.h" #import #include "UILinphone.h" +@class VideoViewController; - -@interface IncallViewController : UIViewController { +@interface IncallViewController : UIViewController { - UIView* controlSubView; + UIView* controlSubView, *callControlSubView, *hangUpView; - UILabel* peerName; - UILabel* peerNumber; - UIDuration* callDuration; - UILabel* status; - UIHangUpButton* endCtrl; + UIButton* endCtrl; UIButton* dialer; UIMuteButton* mute; - UIPauseResumeButton* pause; + UIButton* pause; UISpeakerButton* speaker; UIButton* contacts; + UITableView* callTableView; + UIButton* addCall, *mergeCalls, *addToConf; //key pad @@ -55,30 +53,46 @@ UIDigitButton* star; UIDigitButton* zero; UIDigitButton* hash; - UIHangUpButton* endPad; UIButton* close; + + bool dismissed; + + NSTimer *durationRefreasher; + NSTimer * glowingTimer; + + float glow; + NSIndexPath* activePath; ABPeoplePickerNavigationController* myPeoplePickerController; + + LinphoneCall* selectedCall; + VideoViewController* mVideoViewController; + BOOL mVideoShown; + BOOL mVideoIsPending; + BOOL mIncallViewIsReady; } -(void)displayStatus:(NSString*) message; - (IBAction)doAction:(id)sender; -@property (nonatomic, retain) IBOutlet UIView* controlSubView; -@property (nonatomic, retain) IBOutlet UIView* padSubView; -@property (nonatomic, retain) IBOutlet UILabel* peerName; -@property (nonatomic, retain) IBOutlet UILabel* peerNumber; -@property (nonatomic, retain) IBOutlet UILabel* callDuration; -@property (nonatomic, retain) IBOutlet UILabel* status; +@property (nonatomic, retain) IBOutlet UIView* controlSubView; +@property (nonatomic, retain) IBOutlet UIView* callControlSubView; +@property (nonatomic, retain) IBOutlet UIView* padSubView; +@property (nonatomic, retain) IBOutlet UIView* hangUpView; + + @property (nonatomic, retain) IBOutlet UIButton* endCtrl; @property (nonatomic, retain) IBOutlet UIButton* dialer; @property (nonatomic, retain) IBOutlet UIButton* mute; @property (nonatomic, retain) IBOutlet UIButton* pause; @property (nonatomic, retain) IBOutlet UIButton* speaker; @property (nonatomic, retain) IBOutlet UIButton* contacts; - +@property (nonatomic, retain) IBOutlet UITableView* callTableView; +@property (nonatomic, retain) IBOutlet UIButton* addCall; +@property (nonatomic, retain) IBOutlet UIButton* mergeCalls; +@property (nonatomic, retain) IBOutlet UIButton* addToConf; @property (nonatomic, retain) IBOutlet UIButton* one; @property (nonatomic, retain) IBOutlet UIButton* two; @@ -93,5 +107,5 @@ @property (nonatomic, retain) IBOutlet UIButton* zero; @property (nonatomic, retain) IBOutlet UIButton* hash; @property (nonatomic, retain) IBOutlet UIButton* close; -@property (nonatomic, retain) IBOutlet UIButton* endPad; +@property (nonatomic, retain) IBOutlet VideoViewController* videoViewController; @end diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m index c3a7464e9..c19019980 100644 --- a/Classes/IncallViewController.m +++ b/Classes/IncallViewController.m @@ -19,19 +19,18 @@ #import "IncallViewController.h" #import #import "linphonecore.h" - - +#include "LinphoneManager.h" +#include "private.h" @implementation IncallViewController @synthesize controlSubView; +@synthesize callControlSubView; @synthesize padSubView; +@synthesize hangUpView; -@synthesize peerName; -@synthesize peerNumber; -@synthesize callDuration; -@synthesize status; +@synthesize addToConf; @synthesize endCtrl; @synthesize close; @synthesize mute; @@ -39,6 +38,9 @@ @synthesize dialer; @synthesize speaker; @synthesize contacts; +@synthesize callTableView; +@synthesize addCall; +@synthesize mergeCalls; @synthesize one; @synthesize two; @@ -52,7 +54,7 @@ @synthesize star; @synthesize zero; @synthesize hash; -@synthesize endPad; +@synthesize videoViewController; /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. @@ -66,13 +68,31 @@ */ +bool isInConference(LinphoneCall* call) { + if (!call) + return false; + return linphone_call_get_current_params(call)->in_conference; +} + +int callCount(LinphoneCore* lc) { + int count = 0; + const MSList* calls = linphone_core_get_calls(lc); + + while (calls != 0) { + if (!isInConference((LinphoneCall*)calls->data)) { + count++; + } + calls = calls->next; + } + return count; +} + // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; //Controls [mute initWithOnImage:[UIImage imageNamed:@"mic_muted.png"] offImage:[UIImage imageNamed:@"mic_active.png"] ]; - [pause initWithOnImage:[UIImage imageNamed:@"resumecall.png"] offImage:[UIImage imageNamed:@"pausecall.png"] ]; - [speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ]; + [speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ]; //Dialer init @@ -88,50 +108,211 @@ [nine initWithNumber:'9']; [star initWithNumber:'*']; [hash initWithNumber:'#']; - - + + [addCall addTarget:self action:@selector(addCallPressed) forControlEvents:UIControlEventTouchDown]; + [mergeCalls addTarget:self action:@selector(mergeCallsPressed) forControlEvents:UIControlEventTouchDown]; + [endCtrl addTarget:self action:@selector(endCallPressed) forControlEvents:UIControlEventTouchUpInside]; + [addToConf addTarget:self action:@selector(addToConfCallPressed) forControlEvents:UIControlEventTouchUpInside]; + [pause addTarget:self action:@selector(pauseCallPressed) forControlEvents:UIControlEventTouchUpInside]; + [mergeCalls setHidden:YES]; + mVideoViewController = [[VideoViewController alloc] initWithNibName:@"VideoViewController" + bundle:[NSBundle mainBundle]]; + mVideoShown=FALSE; + mIncallViewIsReady=FALSE; + mVideoIsPending=FALSE; + //selectedCall = nil; +} + +-(void) addCallPressed { + [self dismissModalViewControllerAnimated:true]; +} + +-(void) mergeCallsPressed { + LinphoneCore* lc = [LinphoneManager getLc]; + + linphone_core_add_all_to_conference(lc); +} + +-(void) addToConfCallPressed { + if (!selectedCall) + return; + linphone_core_add_to_conference([LinphoneManager getLc], selectedCall); +} + +-(void) pauseCallPressed { + if (!selectedCall) + return; + if (linphone_call_get_state(selectedCall) == LinphoneCallPaused) + linphone_core_resume_call([LinphoneManager getLc], selectedCall); + else + linphone_core_pause_call([LinphoneManager getLc], selectedCall); } +-(void)updateCallsDurations { + [self updateUIFromLinphoneState: nil]; +} +-(void) viewWillAppear:(BOOL)animated { + + +} +-(void)viewDidAppear:(BOOL)animated { + if (dismissed) { + [self dismissModalViewControllerAnimated:true]; + } else { + [self updateCallsDurations]; + durationRefreasher = [NSTimer scheduledTimerWithTimeInterval:1 + target:self + selector:@selector(updateCallsDurations) + userInfo:nil + repeats:YES]; + glowingTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 + target:self + selector:@selector(updateGlow) + userInfo:nil + repeats:YES]; + glow = 0; + mIncallViewIsReady=TRUE; + if (mVideoIsPending) { + mVideoIsPending=FALSE; + [self displayVideoCall:nil FromUI:self + forUser:nil + withDisplayName:nil]; + + } + } +} + +- (void) viewDidDisappear:(BOOL)animated { + if (durationRefreasher != nil) { + [durationRefreasher invalidate]; + durationRefreasher=nil; + [glowingTimer invalidate]; + glowingTimer = nil; + } + if (!mVideoShown) [[UIApplication sharedApplication] setIdleTimerDisabled:false]; +} - (void)viewDidUnload { } + + -(void) displayStatus:(NSString*) message; { - [status setText:message]; + [self updateUIFromLinphoneState: nil]; } -(void) displayPad:(bool) enable { + [callTableView setHidden:enable]; + [hangUpView setHidden:enable]; [controlSubView setHidden:enable]; [padSubView setHidden:!enable]; } --(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +-(void) displayCall:(LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { //restaure view [self displayPad:false]; - - if (displayName && [displayName length]>0) { - [peerName setText:displayName]; - [peerNumber setText:username]; - } else { - [peerName setText:username]; - [peerNumber setText:@""]; - } - [callDuration setText:@"Calling"]; + dismissed = false; + + if (call) + selectedCall = call; + [self updateUIFromLinphoneState: nil]; } --(void) displayIncallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [callDuration start]; +-(void) displayIncomingCall:(LinphoneCall *)call NotificationFromUI:(UIViewController *)viewCtrl forUser:(NSString *)username withDisplayName:(NSString *)displayName { + +} + +-(void) displayInCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + dismissed = false; + if (call) + selectedCall = call; + [self updateUIFromLinphoneState: nil]; } -(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [callDuration stop]; + UIViewController* modalVC = self.modalViewController; + + if (modalVC != nil) { + // clear previous native window ids + if (modalVC == mVideoViewController) { + mVideoShown=FALSE; + linphone_core_set_native_video_window_id([LinphoneManager getLc],0); + linphone_core_set_native_preview_window_id([LinphoneManager getLc],0); + } + [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO]; + [self dismissModalViewControllerAnimated:FALSE];//just in case + } + [self dismissModalViewControllerAnimated:true]; + dismissed = true; + [self updateUIFromLinphoneState: nil]; +} +-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + if (mIncallViewIsReady) { + [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; + mVideoShown=TRUE; + [self presentModalViewController:mVideoViewController animated:true]; + } else { + //postepone presentation + mVideoIsPending=TRUE; + } } -(void) updateUIFromLinphoneState:(UIViewController *)viewCtrl { [mute reset]; - [pause reset]; + + // if ( + // [pause reset]; + + + LinphoneCore* lc; + + @try { + lc = [LinphoneManager getLc]; + + if (callCount([LinphoneManager getLc]) > 1) { + [pause setHidden:YES]; + [mergeCalls setHidden:NO]; + } else { + [pause setHidden:NO]; + [mergeCalls setHidden:YES]; + } + + [callTableView reloadData]; + } @catch (NSException* exc) { + return; + } + + // hide call control subview if no call selected + [callControlSubView setHidden:(selectedCall == NULL)]; + // hide add to conf if no conf exist + if (!callControlSubView.hidden) { + [addToConf setHidden:(linphone_core_get_conference_size(lc) == 0 || + isInConference(selectedCall))]; + } + int callsCount = linphone_core_get_calls_nb(lc); + // hide pause/resume if in conference + if (selectedCall) { + if (linphone_core_is_in_conference(lc)) + [pause setHidden:YES]; + else if (linphone_call_get_state(selectedCall)==LinphoneCallPaused) { + [pause setHidden:NO]; + //[pause setTitle:@"Resume" forState:UIControlStateNormal]; + pause.selected = YES; + pause.highlighted = NO; + } else if (callCount(lc) == callsCount && callsCount == 1) { + [pause setHidden:NO]; + //[pause setTitle:@"Pause" forState:UIControlStateNormal]; + pause.selected = NO; + pause.highlighted = NO; + } else { + [pause setHidden:YES]; + } + } else { + [pause setHidden:callsCount > 0]; + } + [mergeCalls setHidden:!pause.hidden]; } - (IBAction)doAction:(id)sender { @@ -174,8 +355,292 @@ - (void)dealloc { - [super dealloc]; + [super dealloc]; +} + +-(LinphoneCall*) retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf{ + const MSList* calls = linphone_core_get_calls([LinphoneManager getLc]); + + if (!conf && linphone_core_get_conference_size([LinphoneManager getLc])) + index--; + + while (calls != 0) { + if (isInConference((LinphoneCall*)calls->data) == conf) { + if (index == 0) + break; + index--; + } + calls = calls->next; + } + + if (calls == 0) { + ms_error("Cannot find call with index %d (in conf: %d)", index, conf); + return nil; + } else { + return (LinphoneCall*)calls->data; + } +} + +-(void) updateActive:(bool_t)active cell:(UITableViewCell*) cell { + if (!active) { + + cell.backgroundColor = [UIColor colorWithRed:0.2 green:0.2 blue:0.2 alpha:0.2]; + + UIColor* c = [[UIColor blackColor] colorWithAlphaComponent:0.5]; + [cell.textLabel setTextColor:c]; + [cell.detailTextLabel setTextColor:c]; + } else { + cell.backgroundColor = [UIColor colorWithRed:0.4 green:0.4 blue:0.4 alpha:(0.7+sin(2*glow)*0.3)]; + [cell.textLabel setTextColor:[UIColor whiteColor]]; + [cell.detailTextLabel setTextColor:[UIColor whiteColor]]; + } + [cell.textLabel setBackgroundColor:[UIColor clearColor]]; + [cell.detailTextLabel setBackgroundColor:[UIColor clearColor]]; + [cell.accessoryView setHidden:YES]; + //[cell.backgroundView setBackgroundColor:cell.backgroundColor]; +} + +-(void) updateGlow { + glow += 0.1; + + NSIndexPath* path = [callTableView indexPathForSelectedRow]; + if (path) { + UITableViewCell* cell = [callTableView cellForRowAtIndexPath:path]; + [self updateActive:YES cell:cell]; + [cell.backgroundView setNeedsDisplay]; + [cell setNeedsDisplay]; + [callTableView setNeedsDisplay]; + } +} + +-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { + [self updateActive:(cell.accessoryType == UITableViewCellAccessoryCheckmark) cell:cell]; + //cell.accessoryType = UITableViewCellAccessoryNone; +} + +- (void) updateCell:(UITableViewCell*)cell at:(NSIndexPath*) path withCall:(LinphoneCall*) call conferenceActive:(bool)confActive{ + if (call == NULL) { + ms_warning("UpdateCell called with null call"); + [cell.textLabel setText:@""]; + return; + } + const LinphoneAddress* addr = linphone_call_get_remote_address(call); + if (addr) { + NSMutableString* mss = [[NSMutableString alloc] init]; + + const char* n = linphone_address_get_display_name(addr); + if (n) + [mss appendFormat:@"%s", n, nil]; + else + [mss appendFormat:@"%s", linphone_address_get_username(addr), nil]; + [cell.textLabel setText:mss]; + } else + [cell.textLabel setText:@"plop"]; + + NSMutableString* ms = [[NSMutableString alloc] init ]; + if (linphone_call_get_state(call) == LinphoneCallStreamsRunning) { + int duration = linphone_call_get_duration(call); + if (duration >= 60) + [ms appendFormat:@"%02i:%02i", (duration/60), duration - 60*(duration/60), nil]; + else + [ms appendFormat:@"%02i sec", duration, nil]; + } else { + [ms appendFormat:@"%s", linphone_call_state_to_string(linphone_call_get_state(call)), nil]; + } + [cell.detailTextLabel setText:ms]; + + /* + if (linphone_core_get_current_call([LinphoneManager getLc]) == call) { + cell.backgroundColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:1]; + } else if (confActive && isInConference(call)) { + cell.backgroundColor = [UIColor colorWithRed:0 green:0 blue:1 alpha:1]; + } else{ + cell.backgroundColor = [UIColor colorWithRed:1 green:0.5 blue:0 alpha:1]; + }*/ + + + + + if (call == selectedCall) { + [cell setSelected:YES animated:NO]; + [callTableView selectRowAtIndexPath:path animated:NO scrollPosition:UITableViewScrollPositionNone]; + cell.accessoryType = UITableViewCellAccessoryCheckmark; + }else{ + [cell setSelected:NO animated:NO]; + [callTableView deselectRowAtIndexPath:path animated:NO]; + cell.accessoryType = UITableViewCellAccessoryNone; + } } +-(void) updateConferenceCell:(UITableViewCell*) cell at:(NSIndexPath*)indexPath { + [cell.textLabel setText:@"Conference"]; + + LinphoneCore* lc = [LinphoneManager getLc]; + + cell.accessoryType = UITableViewCellAccessoryNone; + [self updateActive:NO cell:cell]; + cell.selected = NO; + [callTableView deselectRowAtIndexPath:indexPath animated:NO]; + + NSMutableString* ms = [[NSMutableString alloc] init ]; + const MSList* calls = linphone_core_get_calls(lc); + while (calls) { + LinphoneCall* call = (LinphoneCall*)calls->data; + if (isInConference(call)) { + const LinphoneAddress* addr = linphone_call_get_remote_address(call); + + const char* n = linphone_address_get_display_name(addr); + if (n) + [ms appendFormat:@"%s ", n, nil]; + else + [ms appendFormat:@"%s ", linphone_address_get_username(addr), nil]; + + //if (call == selectedCall) + // [self updateActive:YES cell:cell]; + if (call == selectedCall) { + [callTableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; + cell.selected = YES; + cell.accessoryType = UITableViewCellAccessoryCheckmark; + + } + } + calls = calls->next; + } + [cell.detailTextLabel setText:ms]; + + /*if (linphone_core_is_in_conference(lc)) + cell.backgroundColor = [UIColor colorWithRed:0 green:1 blue:0 alpha:1]; + else + cell.backgroundColor = [UIColor colorWithRed:1 green:0 blue:0 alpha:1];*/ +} + + +// UITableViewDataSource (required) +- (UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [callTableView dequeueReusableCellWithIdentifier:@"MyIdentifier"]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MyIdentifier"] autorelease]; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + } + + LinphoneCore* lc = [LinphoneManager getLc]; + if (indexPath.row == 0 && linphone_core_get_conference_size(lc) > 0) + [self updateConferenceCell:cell at:indexPath]; + else + [self updateCell:cell at:indexPath withCall: [self retrieveCallAtIndex:indexPath.row inConference:NO] + conferenceActive:linphone_core_is_in_conference(lc)]; + + cell.userInteractionEnabled = YES; + cell.selectionStyle = UITableViewCellSelectionStyleNone; + //cell.selectionStyle = UITableViewCellSelectionStyleBlue; + + + + /*NSString *path = [[NSBundle mainBundle] pathForResource:[item objectForKey:@"imageKey"] ofType:@"png"]; + UIImage *theImage = [UIImage imageWithContentsOfFile:path]; + cell.imageView.image = theImage;*/ + return cell; +} + + +// UITableViewDataSource (required) +- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + LinphoneCore* lc = [LinphoneManager getLc]; + + return callCount(lc) + (int)(linphone_core_get_conference_size(lc) > 0); + + if (section == 0 && linphone_core_get_conference_size(lc) > 0) + return linphone_core_get_conference_size(lc) - linphone_core_is_in_conference(lc); + + return callCount(lc); +} + +// UITableViewDataSource +- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView { + return 1; + LinphoneCore* lc = [LinphoneManager getLc]; + int count = 0; + + if (callCount(lc) > 0) + count++; + + if (linphone_core_get_conference_size([LinphoneManager getLc]) > 0) + count ++; + + return count; +} + +// UITableViewDataSource +//- (NSArray*) sectionIndexTitlesForTableView:(UITableView *)tableView { +// return [NSArray arrayWithObjects:@"Conf", @"Calls", nil ]; +//} + +// UITableViewDataSource +- (NSString*) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return nil; + return @"Calls"; + if (section == 0 && linphone_core_get_conference_size([LinphoneManager getLc]) > 0) + return @"Conference"; + else + return @"Calls"; +} + +// UITableViewDataSource +- (NSString*) tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section +{ + return nil; +} + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:NO]; + + LinphoneCore* lc = [LinphoneManager getLc]; + + [[callTableView cellForRowAtIndexPath:indexPath] setSelected:YES animated:NO]; + + bool inConf = (indexPath.row == 0 && linphone_core_get_conference_size(lc) > 0); + + selectedCall = [self retrieveCallAtIndex:indexPath.row inConference:inConf]; + + if (inConf) { + if (linphone_core_is_in_conference(lc)) + return; + LinphoneCall* current = linphone_core_get_current_call(lc); + if (current) + linphone_core_pause_call(lc, current); + linphone_core_enter_conference([LinphoneManager getLc]); + } else if (selectedCall) { + if (linphone_core_is_in_conference(lc)) { + linphone_core_leave_conference(lc); + } + linphone_core_resume_call([LinphoneManager getLc], selectedCall); + } + + [self updateUIFromLinphoneState: nil]; +} + +-(void) endCallPressed { + if (selectedCall == NULL) { + ms_error("No selected call"); + return; + } + + LinphoneCore* lc = [LinphoneManager getLc]; + if (isInConference(selectedCall)) { + linphone_core_terminate_conference(lc); + /* + linphone_core_remove_from_conference(lc, selectedCall); + if ((linphone_core_get_conference_size(lc) - (int)linphone_core_is_in_conference(lc)) == 0) + linphone_core_terminate_conference(lc); + */ + } else { + linphone_core_terminate_call(lc, selectedCall); + } + selectedCall = NULL; +} + @end diff --git a/Classes/IncallViewController.xib b/Classes/IncallViewController.xib index a2b4e804e..a77415f09 100644 --- a/Classes/IncallViewController.xib +++ b/Classes/IncallViewController.xib @@ -13,9 +13,9 @@ YES IBUIViewController - IBUIButton + IBUITableView IBUIView - IBUILabel + IBUIButton IBProxyObject @@ -42,105 +42,44 @@ 274 YES - + - 292 - {320, 55} - - - - NO - YES - NO - IBCocoaTouchFramework - Caller - - 1 - MCAwIDAAA - - - 1 - 17 - 1 - - 1 - 17 - - - Helvetica - 17 - 16 - - - - - 292 - {{31, 63}, {61, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - Number - - - 1 - 10 - - - - - - 292 - {{239, 63}, {65, 21}} + 274 + {320, 276} - NO + _NS:418 + + 3 + MC42NjY2NjY2NjY3AA + YES - NO IBCocoaTouchFramework - Duration - - - 1 - 10 - - + YES + NO + 0 + YES + 44 + 22 + 22 - + 292 - {{31, 347}, {258, 21}} - - - - NO - YES - NO - IBCocoaTouchFramework - status - - - 1 - 10 - - - - - - -2147483356 YES - - + + 292 - {{30, 258}, {80, 65}} - + {{36, 8}, {248, 52}} + - + + + 1 + MSAwIDAuMDgyMzIwMjU5MDQgMC4xOAA + NO NO IBCocoaTouchFramework @@ -158,7 +97,7 @@ 3 MC41AA - + NSImage stopcall-red.png @@ -168,26 +107,262 @@ 2 15 - + Helvetica-Bold 15 16 - - + + {{0, 392}, {320, 68}} + + + + _NS:196 + + 3 + MC4zMzMzMzMzMzMzAA + + IBCocoaTouchFramework + + + + 292 + + YES + + 292 - {{170, 266}, {72, 37}} - + {{119, 58}, {82, 52}} + - + + NO NO IBCocoaTouchFramework 0 0 - 1 - close + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + conf_merge.png + + + + 2 + 17 + + + Helvetica-Bold + 17 + 16 + + + + + 292 + {{36, 5}, {82, 52}} + + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + mic_active.png + + + 2 + 2 + + + Helvetica-Bold + 18 + 16 + + + + + 292 + {{36, 58}, {82, 52}} + + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + addcall-green.png + + + + + + + 292 + {{202, 58}, {82, 52}} + + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + Cont + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + 1 + MCAwIDAAA + + + NSImage + contact-orange.png + + + + + + + 292 + {{119, 5}, {82, 52}} + + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + NSImage + numpad.png + + + + + + + 292 + {{202, 5}, {82, 52}} + + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + Spk + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + + + + 292 + {{119, 58}, {82, 52}} + + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + NSImage + resumecall.png + + + NSImage + pausecall.png + + + + + + {{0, 276}, {320, 115}} + + + + + NO + NO + IBCocoaTouchFramework + + + + -2147483356 + + YES + + + 292 + {{95, 219}, {82, 52}} + + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + Close 1 @@ -195,21 +370,21 @@ - + 292 - {{90, 184}, {82, 52}} + {{95, 166}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 0 @@ -218,21 +393,21 @@ - + 292 - {{0, 9}, {82, 52}} + {{12, 7}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 1 @@ -241,44 +416,41 @@ - + 292 - {{90, 9}, {82, 52}} + {{95, 7}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 2 - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - + - + 292 - {{180, 9}, {82, 52}} + {{178, 7}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 3 @@ -287,21 +459,21 @@ - + 292 - {{0, 69}, {82, 52}} + {{12, 60}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 4 @@ -310,21 +482,21 @@ - + 292 - {{90, 69}, {82, 52}} + {{95, 60}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 5 @@ -333,21 +505,21 @@ - + 292 - {{180, 69}, {82, 52}} + {{178, 60}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 6 @@ -356,21 +528,21 @@ - + 292 - {{0, 124}, {82, 52}} + {{12, 113}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 7 @@ -379,21 +551,21 @@ - + 292 - {{90, 124}, {82, 52}} + {{95, 113}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 8 @@ -402,21 +574,21 @@ - + 292 - {{180, 124}, {82, 52}} + {{178, 113}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 9 @@ -425,21 +597,21 @@ - + 292 - {{0, 184}, {82, 52}} + {{12, 166}, {82, 52}} + NO NO IBCocoaTouchFramework 0 0 - 1 * @@ -448,21 +620,21 @@ - + 292 - {{180, 184}, {82, 52}} + {{178, 166}, {82, 52}} - + + NO NO IBCocoaTouchFramework 0 0 - 1 # @@ -471,196 +643,14 @@ - + - {{25, 110}, {270, 317}} + {{24, 115}, {272, 279}} - - 3 - MSAwAA - - 2 - - - NO - NO - IBCocoaTouchFramework - - - - 292 - - YES - - - 292 - {{0, 61}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - mic_active.png - - - - NSImage - mic_muted.png - - - - - - - - 292 - {{0, 121}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - NSImage - pausecall.png - - - - - - - - - 292 - {{6, 261}, {258, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - - - 292 - {{90, 115}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - contact-orange.png - - - - - - - 292 - {{93, 61}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - dialer-orange.png - - - - - - - 292 - {{181, 61}, {82, 52}} - - - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - Speaker-32-off.png - - - - - - {{25, 110}, {270, 317}} - - - - - 3 - MSAwAA - - + NO NO IBCocoaTouchFramework @@ -669,7 +659,7 @@ {{0, 20}, {320, 460}} - + 1 MC44MDAwMDAwMTE5IDAuODAwMDAwMDExOSAwLjgwMDAwMDAxMTkAA @@ -697,6 +687,30 @@ 23 + + + callTableView + + + + 109 + + + + endCtrl + + + + 99 + + + + addCall + + + + 112 + controlSubView @@ -707,11 +721,19 @@ - padSubView + mergeCalls - + - 45 + 114 + + + + speaker + + + + 82 @@ -723,11 +745,43 @@ - close + pause - + - 51 + 115 + + + + mute + + + + 80 + + + + contacts + + + + 84 + + + + star + + + + 56 + + + + two + + + + 59 @@ -739,19 +793,11 @@ - zero + four - + - 55 - - - - star - - - - 56 + 67 @@ -771,43 +817,19 @@ - two + padSubView - + - 59 + 45 - three + zero - + - 60 - - - - four - - - - 67 - - - - five - - - - 69 - - - - six - - - - 71 + 55 @@ -817,6 +839,22 @@ 73 + + + three + + + + 60 + + + + close + + + + 51 + eight @@ -827,83 +865,27 @@ - mute + six - + - 80 + 71 - speaker + five - + - 82 + 69 - contacts + hangUpView - + - 84 - - - - peerName - - - - 89 - - - - peerNumber - - - - 90 - - - - callDuration - - - - 91 - - - - status - - - - 94 - - - - endPad - - - - 98 - - - - endCtrl - - - - 99 - - - - pause - - - - 105 + 122 @@ -932,6 +914,22 @@ 101 + + + dataSource + + + + 107 + + + + delegate + + + + 108 + @@ -969,48 +967,55 @@ YES + + - - - - - 10 - + 106 + - peerName - 11 - + 120 + + + YES + + - peerNumber - 12 - - - duration + 18 + + + end 26 YES - - + + + + - controls + + 113 + + + pauseresume + 13 @@ -1024,10 +1029,16 @@ dialer - 18 - + 15 + - end + contacts + + + 111 + + + addcall 16 @@ -1036,52 +1047,33 @@ mute - 15 - + 104 + - contacts + merge 27 YES - - + + + + - - - pad - - 28 - - - end - - - 29 - - - close - - - 30 - - - 1 - 31 @@ -1089,10 +1081,10 @@ star - 32 - + 30 + - 9 + 1 33 @@ -1101,16 +1093,10 @@ 8 - 34 - + 40 + - 7 - - - 35 - - - 4 + hash 36 @@ -1119,16 +1105,10 @@ 5 - 37 - + 29 + - 6 - - - 38 - - - 3 + close 39 @@ -1136,12 +1116,6 @@ 2 - - 40 - - - hash - 41 @@ -1149,16 +1123,34 @@ 0 - 93 - - - status + 38 + + + 3 - 104 - - - pauseresume + 35 + + + 4 + + + 37 + + + 6 + + + 34 + + + 7 + + + 32 + + + 9 @@ -1170,25 +1162,25 @@ -1.IBPluginDependency -2.CustomClassName -2.IBPluginDependency - 10.IBPluginDependency - 104.CustomClassName 104.IBPluginDependency - 11.IBPluginDependency - 12.CustomClassName - 12.IBPluginDependency + 104.IBUIButtonInspectorSelectedStateConfigurationMetadataKey + 106.IBPluginDependency + 111.IBPluginDependency + 111.IBUIButtonInspectorSelectedStateConfigurationMetadataKey + 113.IBPluginDependency + 113.IBUIButtonInspectorSelectedStateConfigurationMetadataKey + 120.IBPluginDependency 13.CustomClassName 13.IBPluginDependency 15.IBPluginDependency 16.CustomClassName 16.IBPluginDependency + 16.IBUIButtonInspectorSelectedStateConfigurationMetadataKey 17.IBPluginDependency - 18.CustomClassName 18.IBPluginDependency 2.IBPluginDependency 26.IBPluginDependency 27.IBPluginDependency - 28.CustomClassName - 28.IBPluginDependency 29.IBPluginDependency 30.CustomClassName 30.IBPluginDependency @@ -1215,7 +1207,6 @@ 41.CustomClassName 41.IBPluginDependency 9.IBPluginDependency - 93.IBPluginDependency YES @@ -1224,23 +1215,23 @@ UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIPauseResumeButton + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIDuration + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UISpeakerButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIMuteButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIHangUpButton + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIHangUpButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton @@ -1268,7 +1259,6 @@ UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1283,7 +1273,7 @@ - 105 + 122 @@ -1306,36 +1296,40 @@ YES YES - callDuration + addCall + addToConf + callControlSubView + callTableView close contacts controlSubView dialer eight endCtrl - endPad five four + hangUpView hash + mergeCalls mute nine one padSubView pause - peerName - peerNumber seven six speaker star - status three two zero YES - UILabel + UIButton + UIButton + UIView + UITableView UIButton UIButton UIView @@ -1344,6 +1338,7 @@ UIButton UIButton UIButton + UIView UIButton UIButton UIButton @@ -1351,13 +1346,10 @@ UIButton UIView UIButton - UILabel - UILabel UIButton UIButton UIButton UIButton - UILabel UIButton UIButton UIButton @@ -1367,29 +1359,30 @@ YES YES - callDuration + addCall + addToConf + callControlSubView + callTableView close contacts controlSubView dialer eight endCtrl - endPad five four + hangUpView hash + mergeCalls mute nine one padSubView pause - peerName - peerNumber seven six speaker star - status three two zero @@ -1397,8 +1390,20 @@ YES - callDuration - UILabel + addCall + UIButton + + + addToConf + UIButton + + + callControlSubView + UIView + + + callTableView + UITableView close @@ -1424,10 +1429,6 @@ endCtrl UIButton - - endPad - UIButton - five UIButton @@ -1436,10 +1437,18 @@ four UIButton + + hangUpView + UIView + hash UIButton + + mergeCalls + UIButton + mute UIButton @@ -1460,14 +1469,6 @@ pause UIButton - - peerName - UILabel - - - peerNumber - UILabel - seven UIButton @@ -1484,10 +1485,6 @@ star UIButton - - status - UILabel - three UIButton @@ -1515,22 +1512,6 @@ ./Classes/UIDigitButton.h - - UIDuration - UILabel - - IBProjectSource - ./Classes/UIDuration.h - - - - UIHangUpButton - UIButton - - IBProjectSource - ./Classes/UIHangUpButton.h - - UIMuteButton UIToggleButton @@ -1539,14 +1520,6 @@ ./Classes/UIMuteButton.h - - UIPauseResumeButton - UIToggleButton - - IBProjectSource - ./Classes/UIPauseResumeButton.h - - UISpeakerButton UIToggleButton @@ -1571,10 +1544,6 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -1585,22 +1554,24 @@ YES YES - Speaker-32-off.png + addcall-green.png + conf_merge.png contact-orange.png - dialer-orange.png mic_active.png - mic_muted.png + numpad.png pausecall.png + resumecall.png stopcall-red.png YES - {32, 32} - {25, 23} - {25, 24} - {20, 20} - {20, 20} + {82, 71} + {82, 75} {25, 23} + {82, 82} + {82, 82} + {82, 75} + {82, 75} {62, 54} diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 725b41cc6..6a5d37412 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -24,6 +24,7 @@ #import "ConsoleViewController.h" #import "MoreViewController.h" +#include "CallHistoryTableViewController.h" #include "LinphoneManager.h" @@ -149,9 +150,14 @@ [super dealloc]; } - - (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification { - linphone_core_accept_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc])); + LinphoneCall* call; + [(NSData*)([notification.userInfo objectForKey:@"call"]) getBytes:&call]; + if (!call) { + ms_warning("Local notification received with nil call"); + return; + } + linphone_core_accept_call([LinphoneManager getLc], call); } diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index fe1609750..7db2ccd9e 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -123,40 +123,45 @@ extern void libmssilk_init(); } return; } --(void) onCall:(LinphoneCall*) currentCall StateChanged: (LinphoneCallState) new_state withMessage: (const char *) message { - const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(currentCall)); - NSString* lUserName = lUserNameChars?[[NSString alloc] initWithCString:lUserNameChars]:NSLocalizedString(@"Unknown",nil); +-(void) onCall:(LinphoneCall*) call StateChanged: (LinphoneCallState) new_state withMessage: (const char *) message { + const char* lUserNameChars=linphone_address_get_username(linphone_call_get_remote_address(call)); + NSString* lUserName = lUserNameChars?[[NSString alloc] initWithUTF8String:lUserNameChars]:NSLocalizedString(@"Unknown",nil); if (new_state == LinphoneCallIncomingReceived) { - [self updateCallWithAddressBookData:currentCall]; // display name is updated + [self updateCallWithAddressBookData:call]; // display name is updated } - const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(currentCall)); - NSString* lDisplayName = lDisplayNameChars?[[NSString alloc] initWithCString:lDisplayNameChars]:@""; + const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call)); + NSString* lDisplayName = lDisplayNameChars?[[NSString alloc] initWithUTF8String:lDisplayNameChars]:@""; + + bool canHideInCallView = (linphone_core_get_calls([LinphoneManager getLc]) == NULL); switch (new_state) { case LinphoneCallStreamsRunning: //check video - if (linphone_call_params_video_enabled(linphone_call_get_current_params(currentCall))) { - [callDelegate displayVideoCallFromUI:mCurrentViewController + if (linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { + [callDelegate displayVideoCall:call FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; } break; case LinphoneCallIncomingReceived: - [callDelegate displayIncomingCallNotigicationFromUI:mCurrentViewController + [callDelegate displayIncomingCall:call + NotificationFromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; break; case LinphoneCallOutgoingInit: - [callDelegate displayCallInProgressFromUI:mCurrentViewController + [callDelegate displayCall:call + InProgressFromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; break; case LinphoneCallConnected: - [callDelegate displayIncallFromUI:mCurrentViewController + [callDelegate displayInCall: call + FromUI:mCurrentViewController forUser:lUserName withDisplayName:lDisplayName]; break; @@ -189,15 +194,19 @@ extern void libmssilk_init(); cancelButtonTitle:NSLocalizedString(@"Dismiss",nil) otherButtonTitles:nil]; [error show]; - [callDelegate displayDialerFromUI:mCurrentViewController + if (canHideInCallView) { + [callDelegate displayDialerFromUI:mCurrentViewController forUser:@"" withDisplayName:@""]; + } break; } - case LinphoneCallEnd: - [callDelegate displayDialerFromUI:mCurrentViewController + case LinphoneCallEnd: + if (canHideInCallView) { + [callDelegate displayDialerFromUI:mCurrentViewController forUser:@"" withDisplayName:@""]; + } break; default: break; @@ -264,9 +273,9 @@ static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, Lin -(void) onRegister:(LinphoneCore *)lc cfg:(LinphoneProxyConfig*) cfg state:(LinphoneRegistrationState) state message:(const char*) message { LinphoneAddress* lAddress = linphone_address_new(linphone_proxy_config_get_identity(cfg)); - NSString* lUserName = linphone_address_get_username(lAddress)? [[NSString alloc] initWithCString:linphone_address_get_username(lAddress) ]:@""; - NSString* lDisplayName = linphone_address_get_display_name(lAddress)? [[NSString alloc] initWithCString:linphone_address_get_display_name(lAddress) ]:@""; - NSString* lDomain = [[NSString alloc] initWithCString:linphone_address_get_domain(lAddress)]; + NSString* lUserName = linphone_address_get_username(lAddress)? [[NSString alloc] initWithUTF8String:linphone_address_get_username(lAddress) ]:@""; + NSString* lDisplayName = linphone_address_get_display_name(lAddress)? [[NSString alloc] initWithUTF8String:linphone_address_get_display_name(lAddress) ]:@""; + NSString* lDomain = [[NSString alloc] initWithUTF8String:linphone_address_get_domain(lAddress)]; linphone_address_destroy(lAddress); if (state == LinphoneRegistrationOk) { @@ -456,7 +465,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach const char* password = [accountPassword cStringUsingEncoding:[NSString defaultCStringEncoding]]; NSString* proxyAddress = [[NSUserDefaults standardUserDefaults] stringForKey:@"proxy_preference"]; - if ((!proxyAddress | [proxyAddress length] <1 ) && domain) { + if ((!proxyAddress || [proxyAddress length] <1 ) && domain) { proxyAddress = [NSString stringWithFormat:@"sip:%@",domain] ; } else { proxyAddress = [NSString stringWithFormat:@"sip:%@",proxyAddress] ; @@ -572,7 +581,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach sysctlbyname("hw.machine", NULL, &size, NULL, 0); char *machine = malloc(size); sysctlbyname("hw.machine", machine, &size, NULL, 0); - NSString *platform = [NSString stringWithCString:machine]; + NSString *platform = [[NSString alloc ] initWithUTF8String:machine]; free(machine); return ![platform isEqualToString:@"iPhone1,2"]; @@ -586,6 +595,8 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } -(void) destroyLibLinphone { [mIterateTimer invalidate]; + AVAudioSession *audioSession = [AVAudioSession sharedInstance]; + [audioSession setDelegate:nil]; if (theLinphoneCore != nil) { //just in case application terminate before linphone core initialization linphone_core_destroy(theLinphoneCore); theLinphoneCore = nil; @@ -599,13 +610,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach //**********************BG mode management*************************/////////// -(void) enterBackgroundMode { - - struct addrinfo hints; - struct addrinfo *res=NULL; - int err; - LinphoneProxyConfig* proxyCfg; - LinphoneAddress *addr; linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg); linphone_core_stop_dtmf_stream(theLinphoneCore); @@ -648,8 +653,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach } else { ms_warning("Entering lite bg mode"); - AVAudioSession *audioSession = [AVAudioSession sharedInstance]; - [audioSession setDelegate:nil]; [self destroyLibLinphone]; } diff --git a/Classes/LinphoneUI/LinphoneUIDelegates.h b/Classes/LinphoneUI/LinphoneUIDelegates.h index 96cdf0775..47e28ebd6 100644 --- a/Classes/LinphoneUI/LinphoneUIDelegates.h +++ b/Classes/LinphoneUI/LinphoneUIDelegates.h @@ -17,15 +17,15 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #import - +#include "linphonecore.h" @protocol LinphoneUICallDelegate // UI changes -(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(void) displayIncomingCallNotigicationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(void) displayIncallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; --(void) displayVideoCallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; +-(void) displayCall: (LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; +-(void) displayIncomingCall: (LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; +-(void) displayInCall: (LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; +-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName; -(void) updateUIFromLinphoneState:(UIViewController*) viewCtrl; //status reporting -(void) displayStatus:(NSString*) message; diff --git a/Classes/LinphoneUI/UIBluetoothButton.m b/Classes/LinphoneUI/UIBluetoothButton.m index 539422c2c..4f3248a39 100644 --- a/Classes/LinphoneUI/UIBluetoothButton.m +++ b/Classes/LinphoneUI/UIBluetoothButton.m @@ -23,14 +23,14 @@ @implementation UIBluetoothButton #define check_auresult(au,method) \ -if (au!=0) ms_error("UIBluetoothButton error for %s: ret=%i",method,au) +if (au!=0) ms_error("UIBluetoothButton error for %s: ret=%ld",method,au) -(void) onOn { //redirect audio to bluetooth UInt32 size = sizeof(CFStringRef); CFStringRef route="HeadsetBT"; - OSStatus result = AudioSessionSetProperty(kAudioSessionProperty_AudioRoute, &size, &route); + OSStatus result = AudioSessionSetProperty(kAudioSessionProperty_AudioRoute, size, &route); check_auresult(result,"set kAudioSessionProperty_AudioRoute HeadsetBT"); int allowBluetoothInput = 1; diff --git a/Classes/LinphoneUI/UICallButton.m b/Classes/LinphoneUI/UICallButton.m index 1a12e3e0e..a63167009 100644 --- a/Classes/LinphoneUI/UICallButton.m +++ b/Classes/LinphoneUI/UICallButton.m @@ -32,7 +32,7 @@ [error show]; return; } - if (!linphone_core_in_call([LinphoneManager getLc])) { + if (TRUE /*!linphone_core_in_call([LinphoneManager getLc])*/) { LinphoneProxyConfig* proxyCfg; //get default proxy linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg); diff --git a/Classes/LinphoneUI/UIDigitButton.h b/Classes/LinphoneUI/UIDigitButton.h index 08b3a813b..70f7aee18 100644 --- a/Classes/LinphoneUI/UIDigitButton.h +++ b/Classes/LinphoneUI/UIDigitButton.h @@ -23,9 +23,14 @@ @private char mDigit; UITextField* mAddress; + + bool_t sendDtmfDuringCall; } -(void) initWithNumber:(char)digit ; --(void) initWithNumber:(char)digit addressField:(UITextField*) address; +-(void) initWithNumber:(char)digit addressField:(UITextField*) address dtmf:(bool_t)send; + + +@property bool_t sendDtmfDuringCall; @end diff --git a/Classes/LinphoneUI/UIDigitButton.m b/Classes/LinphoneUI/UIDigitButton.m index a4660f11a..2a0cad86c 100644 --- a/Classes/LinphoneUI/UIDigitButton.m +++ b/Classes/LinphoneUI/UIDigitButton.m @@ -23,11 +23,12 @@ @implementation UIDigitButton +@synthesize sendDtmfDuringCall; -(void) touchDown:(id) sender { - if (mAddress && !linphone_core_in_call([LinphoneManager getLc])) { + if (mAddress && (!sendDtmfDuringCall || !linphone_core_in_call([LinphoneManager getLc]))) { NSString* newAddress = [NSString stringWithFormat:@"%@%c",mAddress.text,mDigit]; [mAddress setText:newAddress]; linphone_core_play_dtmf([LinphoneManager getLc], mDigit, -1); @@ -60,9 +61,10 @@ } -(void) initWithNumber:(char)digit { - [self initWithNumber:digit addressField:nil]; + [self initWithNumber:digit addressField:nil dtmf:true]; } --(void) initWithNumber:(char)digit addressField:(UITextField*) address{ +-(void) initWithNumber:(char)digit addressField:(UITextField*) address dtmf:(bool_t)sendDtmf{ + sendDtmfDuringCall = sendDtmf; mDigit=digit ; mAddress=address?[address retain]:nil; [self addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown]; diff --git a/Classes/LinphoneUI/UIHangUpButton.m b/Classes/LinphoneUI/UIHangUpButton.m index 879276338..ffb57a87f 100644 --- a/Classes/LinphoneUI/UIHangUpButton.m +++ b/Classes/LinphoneUI/UIHangUpButton.m @@ -23,7 +23,13 @@ @implementation UIHangUpButton -(void) touchUp:(id) sender { - linphone_core_terminate_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc])); + LinphoneCore* lc = [LinphoneManager getLc]; + if (!lc) + return; + LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); + + if (call) + linphone_core_terminate_call(lc,call); } - (id)initWithFrame:(CGRect)frame { diff --git a/Classes/LinphoneUI/UIPauseResumeButton.m b/Classes/LinphoneUI/UIPauseResumeButton.m index 9cd47f8ac..22f7db8b3 100644 --- a/Classes/LinphoneUI/UIPauseResumeButton.m +++ b/Classes/LinphoneUI/UIPauseResumeButton.m @@ -38,13 +38,13 @@ } -(bool) isInitialStateOn { @try { - const MSList* c = linphone_core_get_calls([LinphoneManager getLc]); + LinphoneCall* c = linphone_core_get_current_call([LinphoneManager getLc]); if (c) { - return linphone_call_get_state((LinphoneCall*)c->data) == LinphoneCallPaused; + return linphone_call_get_state(c) == LinphoneCallPaused; } else { - - return false; + /* if current call is paused -> c == null */ + return true; } } @catch(NSException* e) { //not ready yet diff --git a/Classes/LinphoneUI/UISpeakerButton.m b/Classes/LinphoneUI/UISpeakerButton.m index a513d67ce..717025e00 100644 --- a/Classes/LinphoneUI/UISpeakerButton.m +++ b/Classes/LinphoneUI/UISpeakerButton.m @@ -40,7 +40,7 @@ static void audioRouteChangeListenerCallback ( AudioSessionInitialize(NULL, NULL, NULL, NULL); OSStatus lStatus = AudioSessionAddPropertyListener(routeChangeID, audioRouteChangeListenerCallback, self); if (lStatus) { - ms_error ("cannot register route change handler [%i]",lStatus); + ms_error ("cannot register route change handler [%ld]",lStatus); } } diff --git a/Classes/LinphoneUI/UIToggleButton.h b/Classes/LinphoneUI/UIToggleButton.h index bd960cee2..61ba8aba7 100644 --- a/Classes/LinphoneUI/UIToggleButton.h +++ b/Classes/LinphoneUI/UIToggleButton.h @@ -24,6 +24,7 @@ -(void) onOff; -(bool) isInitialStateOn; @end + @interface UIToggleButton : UIButton { @private UIImage* mOnImage; diff --git a/Classes/LinphoneUI/UIToggleButton.m b/Classes/LinphoneUI/UIToggleButton.m index 0f5a81e07..04c0b3721 100644 --- a/Classes/LinphoneUI/UIToggleButton.m +++ b/Classes/LinphoneUI/UIToggleButton.m @@ -47,9 +47,9 @@ } -(void) initWithOnImage:(UIImage*) onImage offImage:(UIImage*) offImage { - mOnImage = [onImage retain]; - mOffImage = [offImage retain]; - mIsOn=false; + mOnImage = [onImage retain]; + mOffImage = [offImage retain]; + mIsOn=false; [self reset]; [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside]; @@ -69,5 +69,19 @@ [mOffImage release]; } +-(void) onOn { + [NSException raise:NSInternalInconsistencyException + format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; +} +-(void) onOff { + [NSException raise:NSInternalInconsistencyException + format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; +} +-(bool) isInitialStateOn { + [NSException raise:NSInternalInconsistencyException + format:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]; + return false; +} + @end diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index d292500d0..a9bd56576 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -20,12 +20,14 @@ #import #import "linphonecore.h" #import "UILinphone.h" +#import "CallDelegate.h" @class IncallViewController; @class FirstLoginViewController; -@class VideoViewController; -@interface PhoneViewController : UIViewController { + + +@interface PhoneViewController : UIViewController { @private //UI definition @@ -35,13 +37,14 @@ UIEraseButton* erase; UIView* incallView; + UIButton* backToCallView; UIDuration* callDuration; UIMuteButton* mute; UISpeakerButton* speaker; UILabel* peerLabel; - UICallButton* call; + UICallButton* __call; UIHangUpButton* hangup; UILabel* status; @@ -66,14 +69,13 @@ UIActionSheet *mIncomingCallActionSheet; FirstLoginViewController* myFirstLoginViewController; - VideoViewController* mVideoViewController; - BOOL mVideoShown; + } @property (nonatomic, retain) IBOutlet UIView* dialerView; -@property (nonatomic, retain) IBOutlet UIViewController* videoViewController; + @property (nonatomic, retain) IBOutlet UITextField* address; -@property (nonatomic, retain) IBOutlet UIButton* call; +@property (nonatomic, retain) IBOutlet UIButton* __call; @property (nonatomic, retain) IBOutlet UIButton* hangup; @property (nonatomic, retain) IBOutlet UILabel* status; @property (nonatomic, retain) IBOutlet UIEraseButton* erase; @@ -84,6 +86,7 @@ @property (nonatomic, retain) IBOutlet UIButton* speaker; @property (nonatomic, retain) IBOutlet UILabel* peerLabel; +@property (nonatomic, retain) IBOutlet UIButton* backToCallView; @property (nonatomic, retain) IBOutlet UIButton* one; @property (nonatomic, retain) IBOutlet UIButton* two; diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 3edfb93af..ba8654af1 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -22,17 +22,17 @@ #import #import #import "LinphoneManager.h" -#import "VideoViewController.h" +#include "FirstLoginViewController.h" @implementation PhoneViewController @synthesize dialerView ; @synthesize address ; -@synthesize call; +@synthesize __call; @synthesize hangup; @synthesize status; @synthesize erase; - +@synthesize backToCallView; @synthesize incallView; @synthesize callDuration; @@ -55,7 +55,7 @@ @synthesize back; @synthesize myTabBarController; -@synthesize videoViewController; + //implements keypad behavior @@ -70,21 +70,6 @@ } - - - - -/* - // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { - if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { - } - - return self; - } - */ - - - (void)viewDidAppear:(BOOL)animated { [[UIApplication sharedApplication] setIdleTimerDisabled:true]; [mute reset]; @@ -97,7 +82,7 @@ } - (void)viewDidDisappear:(BOOL)animated { - if (!mVideoShown) [[UIApplication sharedApplication] setIdleTimerDisabled:false]; + } @@ -106,25 +91,32 @@ [super viewDidLoad]; mDisplayName = [UILabel alloc]; - [zero initWithNumber:'0' addressField:address ]; - [one initWithNumber:'1' addressField:address ]; - [two initWithNumber:'2' addressField:address ]; - [three initWithNumber:'3' addressField:address ]; - [four initWithNumber:'4' addressField:address ]; - [five initWithNumber:'5' addressField:address ]; - [six initWithNumber:'6' addressField:address ]; - [seven initWithNumber:'7' addressField:address ]; - [eight initWithNumber:'8' addressField:address ]; - [nine initWithNumber:'9' addressField:address ]; - [star initWithNumber:'*' addressField:address ]; - [hash initWithNumber:'#' addressField:address ]; - [call initWithAddress:address withDisplayName:mDisplayName]; + [zero initWithNumber:'0' addressField:address dtmf:false]; + [one initWithNumber:'1' addressField:address dtmf:false]; + [two initWithNumber:'2' addressField:address dtmf:false]; + [three initWithNumber:'3' addressField:address dtmf:false]; + [four initWithNumber:'4' addressField:address dtmf:false]; + [five initWithNumber:'5' addressField:address dtmf:false]; + [six initWithNumber:'6' addressField:address dtmf:false]; + [seven initWithNumber:'7' addressField:address dtmf:false]; + [eight initWithNumber:'8' addressField:address dtmf:false]; + [nine initWithNumber:'9' addressField:address dtmf:false]; + [star initWithNumber:'*' addressField:address dtmf:false]; + [hash initWithNumber:'#' addressField:address dtmf:false]; + [__call initWithAddress:address withDisplayName:mDisplayName]; [mute initWithOnImage:[UIImage imageNamed:@"mic_muted.png"] offImage:[UIImage imageNamed:@"mic_active.png"] ]; [speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ]; [erase initWithAddressField:address]; - self.videoViewController = [[VideoViewController alloc] initWithNibName:@"VideoViewController" - bundle:[NSBundle mainBundle]]; - mVideoShown=FALSE; + + [backToCallView addTarget:self action:@selector(backToCallViewPressed) forControlEvents:UIControlEventTouchUpInside]; + +} + +-(void) backToCallViewPressed { + [self displayInCall: nil + FromUI:nil + forUser:nil + withDisplayName:nil]; } @@ -174,18 +166,6 @@ mIncomingCallActionSheet=nil; } } - UIViewController* modalVC = self.modalViewController; - - if (modalVC != nil) { - // clear previous native window ids - if (modalVC == self.videoViewController) { - mVideoShown=FALSE; - linphone_core_set_native_video_window_id([LinphoneManager getLc],0); - linphone_core_set_native_preview_window_id([LinphoneManager getLc],0); - } - [[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO]; - [self dismissModalViewControllerAnimated:FALSE];//just in case - } [address setHidden:false]; if (username) { @@ -196,7 +176,7 @@ [incallView setHidden:true]; [dialerView setHidden:false]; - [call setEnabled:true]; + [__call setEnabled:true]; [hangup setEnabled:false]; [callDuration stop]; @@ -212,7 +192,7 @@ [myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; } --(void) displayIncalViewforUser:(NSString*) username withDisplayName:(NSString*) displayName { +-(void) displayInCall: (LinphoneCall*) call ViewforUser:(NSString*) username withDisplayName:(NSString*) displayName { UIDevice *device = [UIDevice currentDevice]; device.proximityMonitoringEnabled = YES; if (device.proximityMonitoringEnabled == YES) { @@ -225,34 +205,33 @@ } else { [peerLabel setText:username?username:@""]; } - [address setHidden:true]; - [incallView setHidden:false]; - [dialerView setHidden:true]; - + [incallView setHidden:NO]; } --(void) displayCallInProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [self displayIncalViewforUser:username +-(void) displayCall:(LinphoneCall*) call InProgressFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + [self displayInCall: call ViewforUser:username withDisplayName:displayName]; - [call setEnabled:false]; + //[__call setEnabled:false]; [callDuration setText:NSLocalizedString(@"Calling...",nil)]; if ([speaker isOn]) [speaker toggle] ; //preset to off + + [incallView setHidden:NO]; } --(void) displayIncallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { +-(void) displayInCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [callDuration start]; [callDuration setHidden:false]; if (linphone_call_get_dir(linphone_core_get_current_call([LinphoneManager getLc])) == LinphoneCallIncoming) { - [self displayIncalViewforUser:username + [self displayInCall: call ViewforUser:username withDisplayName:displayName]; if ([speaker isOn]) [speaker toggle] ; //preset to off; } + + [incallView setHidden:NO]; } --(void) displayVideoCallFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; - mVideoShown=TRUE; - [self presentModalViewController:self.videoViewController animated:true]; +-(void) displayVideoCall:(LinphoneCall*) call FromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + ms_message("basic phone view does not support video"); } //status reporting -(void) displayStatus:(NSString*) message { @@ -264,8 +243,8 @@ } --(void) displayIncomingCallNotigicationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { - +-(void) displayIncomingCall:(LinphoneCall*) call NotificationFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { + if ([[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)] && [UIApplication sharedApplication].applicationState != UIApplicationStateActive) { // Create a new notification @@ -276,26 +255,34 @@ notif.alertBody =[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username]; notif.alertAction = @"Answer"; notif.soundName = @"oldphone-mono-30s.caf"; + NSData *callData = [NSData dataWithBytes:&call length:sizeof(call)]; + notif.userInfo = [NSDictionary dictionaryWithObject:callData forKey:@"call"]; [[UIApplication sharedApplication] presentLocalNotificationNow:notif]; } } else { + CallDelegate* cd = [[CallDelegate alloc] init]; + cd.delegate = self; + cd.call = call; + mIncomingCallActionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:NSLocalizedString(@" %@ is calling you",nil),[displayName length]>0?displayName:username] - delegate:self + delegate:cd cancelButtonTitle:NSLocalizedString(@"Decline",nil) destructiveButtonTitle:NSLocalizedString(@"Answer",nil) otherButtonTitles:nil]; + mIncomingCallActionSheet.actionSheetStyle = UIActionSheetStyleDefault; [mIncomingCallActionSheet showInView:self.view]; [mIncomingCallActionSheet release]; } } -- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex withUserDatas:(void *)datas{ + LinphoneCall* call = (LinphoneCall*)datas; if (buttonIndex == 0 ) { - linphone_core_accept_call([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc])); + linphone_core_accept_call([LinphoneManager getLc],call); } else { - linphone_core_terminate_call ([LinphoneManager getLc],linphone_core_get_current_call([LinphoneManager getLc])); + linphone_core_terminate_call ([LinphoneManager getLc], call); } mIncomingCallActionSheet = nil; } @@ -309,7 +296,7 @@ [mute dealloc]; [speaker dealloc]; [peerLabel dealloc]; - [call dealloc]; + [__call dealloc]; [hangup dealloc]; [status dealloc]; [one dealloc]; diff --git a/Classes/PhoneViewController.xib b/Classes/PhoneViewController.xib index 2150c0314..385db8b02 100644 --- a/Classes/PhoneViewController.xib +++ b/Classes/PhoneViewController.xib @@ -2,30 +2,30 @@ 784 - 10J567 - 823 - 1038.35 - 462.00 + 11C74 + 1938 + 1138.23 + 567.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 132 + 933 - + YES - + IBUITextField + IBUIViewController + IBUIButton + IBUIView + IBUILabel + IBProxyObject YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -43,110 +43,6 @@ 292 YES - - - -2147483356 - - YES - - - 292 - {320, 40} - - NO - YES - NO - IBCocoaTouchFramework - who - - 1 - MCAwIDAAA - - - 1 - 10 - 1 - - - - 292 - {{98, 38}, {124, 21}} - - NO - YES - NO - IBCocoaTouchFramework - how long - - - 1 - 10 - 1 - - - - 292 - {{239, 14}, {72, 37}} - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - Helvetica-Bold - 15 - 16 - - - 3 - MQA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MC41AA - - - NSImage - Speaker-32-off.png - - - - - 292 - {{0, 14}, {72, 37}} - - NO - NO - IBCocoaTouchFramework - 0 - 0 - - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - mic_active.png - - - - {320, 65} - - - 1 - MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA - - NO - IBCocoaTouchFramework - 292 @@ -157,28 +53,48 @@ 292 {{254, 0}, {66, 65}} + + NO IBCocoaTouchFramework 0 0 - <- - + + 3 + MQA + 1 MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - + + 3 + MC41AA + NSImage clavier-01-106px.png + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 + 292 {{5, 0}, {255, 66}} + + NO NO IBCocoaTouchFramework @@ -192,11 +108,6 @@ 2 - - Helvetica - 36 - 16 - YES 15 @@ -205,10 +116,23 @@ IBCocoaTouchFramework 1 + + Helvetica + Helvetica + 0 + 36 + + + Helvetica + 36 + 16 + {320, 65} + + 1 MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA @@ -220,12 +144,13 @@ 292 {{0, 328}, {160, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 1 @@ -240,33 +165,50 @@ NSImage clavier-01-160px.png + + 292 {{9, 390}, {304, 21}} + + NO YES NO IBCocoaTouchFramework status - + + 1 + MCAwIDAAA + 1 10 + + 1 + 17 + + + Helvetica + 17 + 16 + 292 {{213, 64}, {107, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 3 @@ -275,18 +217,21 @@ + + 292 {{0, 130}, {107, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 4 @@ -295,18 +240,21 @@ + + 292 {{107, 130}, {106, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 5 @@ -318,18 +266,21 @@ NSImage clavier-01-108px.png + + 292 {{213, 130}, {107, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 6 @@ -338,18 +289,21 @@ + + 292 {{0, 196}, {107, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 7 @@ -358,18 +312,21 @@ + + 292 {{213, 196}, {107, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 9 @@ -378,18 +335,21 @@ + + 292 {{107, 64}, {106, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 2 @@ -398,12 +358,16 @@ + + 292 {{0, 64}, {107, 66}} + + 1 MC40MDAwMDAwMSAxIDEgMAA @@ -413,7 +377,6 @@ IBCocoaTouchFramework 0 0 - 1 @@ -422,18 +385,21 @@ + + 292 {{0, 262}, {107, 66}} + + NO NO IBCocoaTouchFramework 0 0 - * @@ -442,18 +408,21 @@ + + 292 {{107, 262}, {106, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 0+ @@ -462,18 +431,21 @@ + + 292 {{213, 262}, {107, 66}} + + NO NO IBCocoaTouchFramework 0 0 - # @@ -482,18 +454,21 @@ + + 292 {{107, 196}, {106, 66}} + + NO NO IBCocoaTouchFramework 0 0 - 8 @@ -502,19 +477,22 @@ + + 292 {{160, 328}, {160, 66}} + + NO NO IBCocoaTouchFramework NO 0 0 - 1 @@ -526,10 +504,62 @@ stopcall-red.png + + + + + + -2147483356 + + YES + + + 292 + {160, 66} + + + + NO + NO + IBCocoaTouchFramework + 0 + 0 + 1 + Back + + + 1 + MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA + + + + + 2 + 2 + + + Helvetica-Bold + 18 + 16 + + + + {{160, 328}, {160, 66}} + + + + + 1 + MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA + + NO + IBCocoaTouchFramework - {320, 460} + {{0, 20}, {320, 460}} + + 1 MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA @@ -539,6 +569,7 @@ + 1 1 IBCocoaTouchFramework @@ -556,14 +587,6 @@ 12 - - - call - - - - 13 - status @@ -572,14 +595,6 @@ 15 - - - delegate - - - - 19 - view @@ -684,15 +699,6 @@ 54 - - - doKeyPad: - - - 1 - - 92 - hangup @@ -709,38 +715,6 @@ 119 - - - peerLabel - - - - 120 - - - - callDuration - - - - 121 - - - - speaker - - - - 123 - - - - mute - - - - 125 - erase @@ -757,13 +731,48 @@ 158 + + + __call + + + + 159 + + + + backToCallView + + + + 161 + + + + delegate + + + + 19 + + + + doKeyPad: + + + 1 + + 92 + YES 0 - + + YES + @@ -795,7 +804,6 @@ - @@ -808,6 +816,7 @@ + @@ -832,38 +841,11 @@ YES - - - - + inCall - - 117 - - - speaker - - - 116 - - - duration - - - 118 - - - mute - - - 115 - - - display - 39 @@ -949,6 +931,12 @@ Address + + 160 + + + back + @@ -956,33 +944,21 @@ YES -1.CustomClassName + -1.IBPluginDependency -2.CustomClassName - 1.IBEditorWindowLastContentRect + -2.IBPluginDependency 1.IBPluginDependency 1.IBUserGuides 107.CustomClassName 107.IBPluginDependency - 114.IBEditorWindowLastContentRect 114.IBPluginDependency 114.IBUserGuides - 114.IBViewBoundsToFrameTransform - 115.IBPluginDependency - 116.CustomClassName - 116.IBPluginDependency - 116.IBViewBoundsToFrameTransform - 117.CustomClassName - 117.IBPluginDependency - 117.IBViewBoundsToFrameTransform - 118.CustomClassName - 118.IBPluginDependency - 118.IBViewBoundsToFrameTransform 150.CustomClassName 150.IBPluginDependency - 150.IBViewBoundsToFrameTransform 157.IBPluginDependency + 160.IBPluginDependency 29.CustomClassName 29.IBPluginDependency - 29.IBViewBoundsToFrameTransform 30.CustomClassName 30.IBPluginDependency 31.CustomClassName @@ -997,14 +973,11 @@ 36.IBPluginDependency 37.CustomClassName 37.IBPluginDependency - 37.IBViewBoundsToFrameTransform 38.CustomClassName 38.IBPluginDependency - 38.IBViewBoundsToFrameTransform 39.CustomClassName 39.IBPluginDependency 4.IBPluginDependency - 4.IBViewBoundsToFrameTransform 40.CustomClassName 40.IBPluginDependency 41.CustomClassName @@ -1012,14 +985,14 @@ 5.CustomClassName 5.IBPluginDependency 7.IBPluginDependency - 80.IBEditorWindowLastContentRect 80.IBPluginDependency YES PhoneViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder - {{581, 299}, {320, 460}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES @@ -1036,7 +1009,6 @@ UIHangUpButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{32, 282}, {320, 90}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES @@ -1046,34 +1018,10 @@ 1 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIDuration - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABCxAAAwoIAAA - - UISpeakerButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDcQAAwpIAAA - - UIMuteButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAwpIAAA - UIEraseButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - AUNxAAAAAAAAA - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABDVQAAwxsAAA - UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton @@ -1088,18 +1036,13 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAABC1gAAwxsAAA - UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - P4AAAL+AAAAAAAAAwxsAAA - + UIDigitButton + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIDigitButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDigitButton @@ -1107,27 +1050,22 @@ UICallButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{60, 553}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES - - YES - + YES - - YES - + - 158 + 161 @@ -1150,9 +1088,10 @@ YES YES + __call address back - call + backToCallView callDuration dialerView eight @@ -1178,6 +1117,7 @@ YES + UIButton UITextField UIButton UIButton @@ -1209,9 +1149,10 @@ YES YES + __call address back - call + backToCallView callDuration dialerView eight @@ -1237,6 +1178,10 @@ YES + + __call + UIButton + address UITextField @@ -1246,7 +1191,7 @@ UIButton - call + backToCallView UIButton @@ -1341,15 +1286,7 @@ IBProjectSource - Classes/PhoneViewController.h - - - - PhoneViewController - UIViewController - - IBUserSource - + ./Classes/PhoneViewController.h @@ -1357,7 +1294,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UICallButton.h + ./Classes/UICallButton.h @@ -1365,15 +1302,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UIDigitButton.h - - - - UIDuration - UILabel - - IBProjectSource - Classes/LinphoneUI/UIDuration.h + ./Classes/UIDigitButton.h @@ -1381,7 +1310,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UIEraseButton.h + ./Classes/UIEraseButton.h @@ -1389,249 +1318,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UIHangUpButton.h - - - - UIMuteButton - UIToggleButton - - IBProjectSource - Classes/LinphoneUI/UIMuteButton.h - - - - UISpeakerButton - UIToggleButton - - IBProjectSource - Classes/LinphoneUI/UISpeakerButton.h - - - - UIToggleButton - UIButton - - mActionHandler - id - - - mActionHandler - - mActionHandler - id - - - - IBProjectSource - Classes/LinphoneUI/UIToggleButton.h - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UITabBarController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UITextField - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIPrintFormatter.h - - - - UIView - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UIPopoverController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UISplitViewController.h - - - - UIViewController - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h + ./Classes/UIHangUpButton.h @@ -1644,38 +1331,33 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES - ../linphone.xcodeproj 3 YES YES - Speaker-32-off.png clavier-01-106px.png clavier-01-108px.png clavier-01-160px.png - mic_active.png startcall-green.png stopcall-red.png YES - {32, 32} {106, 60} {108, 60} {160, 60} - {32, 32} {60, 52} {62, 54} - 132 + 933 diff --git a/Classes/VideoViewController.h b/Classes/VideoViewController.h index d6db828b0..ea65a8f10 100644 --- a/Classes/VideoViewController.h +++ b/Classes/VideoViewController.h @@ -34,6 +34,7 @@ UIHangUpButton* mHangUpLand; UICamSwitch* mCamSwitchLand; BOOL isFirst; + int maxCall; } diff --git a/Classes/VideoViewController.m b/Classes/VideoViewController.m index 888cbd83d..f1764a6af 100644 --- a/Classes/VideoViewController.m +++ b/Classes/VideoViewController.m @@ -109,6 +109,7 @@ -(void) viewDidDisappear:(BOOL)animated{ [super viewDidDisappear:animated]; [[UIApplication sharedApplication] setIdleTimerDisabled:NO]; + linphone_core_set_max_calls([LinphoneManager getLc], maxCall); } -(void) viewWillAppear:(BOOL)animated { @@ -126,6 +127,8 @@ waitUntilDone:YES]; [mMute reset]; [mMuteLand reset]; + maxCall = linphone_core_get_max_calls([LinphoneManager getLc]); + linphone_core_set_max_calls([LinphoneManager getLc], 1); } - (void) viewDidAppear:(BOOL)animated{ diff --git a/PhoneMainView.xib b/PhoneMainView.xib index dadf43e09..1eb8dfbfc 100644 --- a/PhoneMainView.xib +++ b/PhoneMainView.xib @@ -2,30 +2,31 @@ 784 - 10D573 - 762 - 1038.29 - 460.00 + 11C74 + 1938 + 1138.23 + 567.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 87 + 933 - + YES - + IBProxyObject + IBUITabBarItem + IBUIViewController + IBUICustomObject + IBUITabBarController + IBUIWindow + IBUITabBar YES com.apple.InterfaceBuilder.IBCocoaTouchPlugin - YES - - YES - - - YES - + PluginDependencyRecalculationVersion + YES @@ -41,10 +42,11 @@ IBCocoaTouchFramework - + 1316 {320, 480} + 1 MSAxIDEAA @@ -58,24 +60,19 @@ + 1 1 IBCocoaTouchFramework NO - - History - - History - - NSImage - history-orange.png - + + IBCocoaTouchFramework - + 5 - + 1 1 IBCocoaTouchFramework @@ -83,7 +80,25 @@ YES - + + History + + History + + NSImage + history-orange.png + + IBCocoaTouchFramework + + + + + 1 + 1 + + IBCocoaTouchFramework + NO + Dialer @@ -92,40 +107,28 @@ dialer-orange.png IBCocoaTouchFramework - PhoneViewController + 1 1 IBCocoaTouchFramework NO - - - IBCocoaTouchFramework - - 5 - - - - 1 - - IBCocoaTouchFramework - NO - + IBCocoaTouchFramework - 0 + 1 1 IBCocoaTouchFramework @@ -133,9 +136,10 @@ - + 266 - {{129, 330}, {163, 49}} + {{0, 431}, {320, 49}} + 3 MCAwAA @@ -178,7 +182,9 @@ YES 0 - + + YES + @@ -289,52 +295,52 @@ YES -1.CustomClassName + -1.IBPluginDependency -2.CustomClassName + -2.IBPluginDependency 11.IBPluginDependency 12.IBPluginDependency 2.IBAttributePlaceholdersKey - 2.IBEditorWindowLastContentRect 2.IBPluginDependency - 2.UIWindow.visibleAtLaunch 38.CustomClassName - 38.IBEditorWindowLastContentRect 38.IBPluginDependency + 39.IBPluginDependency 4.CustomClassName 4.IBPluginDependency 41.CustomClassName 41.IBPluginDependency + 42.IBPluginDependency 43.CustomClassName 43.IBPluginDependency - 8.IBEditorWindowLastContentRect + 44.IBPluginDependency 8.IBPluginDependency 9.IBPluginDependency YES UIApplication + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIResponder com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES - - YES - + - {{190, 156}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - PhoneViewController - {{343, 544}, {320, 480}} + AdvancedPhoneViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin linphoneAppDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin CallHistoryTableViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin MoreViewController com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{623, 298}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -342,490 +348,18 @@ YES - - YES - + YES - - YES - + 47 - - - YES - - CallHistoryTableViewController - GenericTabViewController - - doAction: - id - - - clear - UIButton - - - IBProjectSource - Classes/CallHistoryTableViewController.h - - - - GenericTabViewController - UITableViewController - - YES - - YES - header - linphoneDelegate - phoneControllerDelegate - - - YES - UIView - id - id - - - - IBProjectSource - Classes/GenericTabViewController.h - - - - MoreViewController - UITableViewController - - YES - - YES - console - credit - creditText - web - - - YES - UITableViewCell - UITableViewCell - UITextView - UITableViewCell - - - - IBProjectSource - Classes/MoreViewController.h - - - - PhoneViewController - UIViewController - - YES - - YES - doAction: - doKeyPad: - doKeyPadUp: - - - YES - id - id - id - - - - YES - - YES - address - back - call - callDuration - eight - five - four - hangup - hash - incallView - mute - nine - one - peerLabel - seven - six - speaker - star - status - three - two - zero - - - YES - UITextField - UIButton - UIButton - UILabel - UIButton - UIButton - UIButton - UIButton - UIButton - UIView - UIButton - UIButton - UIButton - UILabel - UIButton - UIButton - UIButton - UIButton - UILabel - UIButton - UIButton - UIButton - - - - IBProjectSource - Classes/PhoneViewController.h - - - - linphoneAppDelegate - NSObject - - YES - - YES - myPeoplePickerController - myPhoneViewController - myTabBarController - window - - - YES - ABPeoplePickerNavigationController - PhoneViewController - UITabBarController - UIWindow - - - - IBProjectSource - Classes/linphoneAppDelegate.h - - - - - YES - - ABPeoplePickerNavigationController - UINavigationController - - IBFrameworkSource - AddressBookUI.framework/Headers/ABPeoplePickerNavigationController.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIApplication - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIApplication.h - - - - UIBarItem - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIBarItem.h - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UINavigationController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIResponder - NSObject - - - - UIScrollView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIScrollView.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UITabBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITabBar.h - - - - UITabBarController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UITabBarItem - UIBarItem - - IBFrameworkSource - UIKit.framework/Headers/UITabBarItem.h - - - - UITableViewCell - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITableViewCell.h - - - - UITableViewController - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITableViewController.h - - - - UITextField - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UITextView - UIScrollView - - IBFrameworkSource - UIKit.framework/Headers/UITextView.h - - - - UIView - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - - - UIViewController - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWindow - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWindow.h - - - - + 0 IBCocoaTouchFramework @@ -834,14 +368,13 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES - linphone.xcodeproj 3 YES @@ -856,6 +389,6 @@ {25, 23} - 87 + 933 diff --git a/Resources/Speaker-32-off.png b/Resources/Speaker-32-off.png index e93ae232f..3a5b3fd73 100644 Binary files a/Resources/Speaker-32-off.png and b/Resources/Speaker-32-off.png differ diff --git a/Resources/Speaker-32-on.png b/Resources/Speaker-32-on.png index de8d4460e..cd0fbd40d 100644 Binary files a/Resources/Speaker-32-on.png and b/Resources/Speaker-32-on.png differ diff --git a/Resources/addcall-green.png b/Resources/addcall-green.png new file mode 100644 index 000000000..8ccfe2ba1 Binary files /dev/null and b/Resources/addcall-green.png differ diff --git a/Resources/conf_merge.png b/Resources/conf_merge.png new file mode 100644 index 000000000..409609c06 Binary files /dev/null and b/Resources/conf_merge.png differ diff --git a/Resources/contact_orange.png b/Resources/contact_orange.png new file mode 100644 index 000000000..cbdf86df8 Binary files /dev/null and b/Resources/contact_orange.png differ diff --git a/Resources/mic_active.png b/Resources/mic_active.png new file mode 100644 index 000000000..e4b7c6a1b Binary files /dev/null and b/Resources/mic_active.png differ diff --git a/Resources/mic_muted.png b/Resources/mic_muted.png new file mode 100644 index 000000000..6110a04fc Binary files /dev/null and b/Resources/mic_muted.png differ diff --git a/Resources/numpad.png b/Resources/numpad.png new file mode 100644 index 000000000..966b48348 Binary files /dev/null and b/Resources/numpad.png differ diff --git a/Resources/pausecall.png b/Resources/pausecall.png new file mode 100644 index 000000000..ffac25a47 Binary files /dev/null and b/Resources/pausecall.png differ diff --git a/Resources/resumecall.png b/Resources/resumecall.png new file mode 100644 index 000000000..8c9ba5d45 Binary files /dev/null and b/Resources/resumecall.png differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 93147ee6e..ca6ca3362 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -22,6 +22,12 @@ 2211DB90147555C800DEE054 /* libmediastreamer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB8F147555C800DEE054 /* libmediastreamer.a */; }; 2211DB921475562600DEE054 /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2211DB911475562600DEE054 /* liblinphone.a */; }; 2211DB95147564B400DEE054 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2211DB94147564B400DEE054 /* Settings.bundle */; }; + 2211DBBC14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */; }; + 2211DBBD14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */; }; + 2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBB14769C8200DEE054 /* CallDelegate.m */; }; + 2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2211DBBB14769C8200DEE054 /* CallDelegate.m */; }; + 2211DBC014769CB200DEE054 /* IncallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 222A483212F7176F0075F07F /* IncallViewController.m */; }; + 2211DBC114769CB300DEE054 /* IncallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 222A483212F7176F0075F07F /* IncallViewController.m */; }; 2214783D1386A2030020F8B8 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2214783B1386A2030020F8B8 /* Localizable.strings */; }; 2214EB7A12F846B1002A5394 /* UICallButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB7912F846B1002A5394 /* UICallButton.m */; }; 2214EB8912F84EBB002A5394 /* UIHangUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 2214EB8812F84EBB002A5394 /* UIHangUpButton.m */; }; @@ -349,6 +355,8 @@ 2211DB8F147555C800DEE054 /* libmediastreamer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer.a"; sourceTree = ""; }; 2211DB911475562600DEE054 /* liblinphone.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblinphone.a; path = "liblinphone-sdk/apple-darwin/lib/liblinphone.a"; sourceTree = ""; }; 2211DB94147564B400DEE054 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Settings.bundle; path = nogpl/Settings.bundle; sourceTree = ""; }; + 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdvancedPhoneViewController.m; sourceTree = ""; }; + 2211DBBB14769C8200DEE054 /* CallDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallDelegate.m; sourceTree = ""; }; 2214783C1386A2030020F8B8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Resources/en.lproj/Localizable.strings; sourceTree = ""; }; 2214EB7812F846B1002A5394 /* UICallButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICallButton.h; sourceTree = ""; }; 2214EB7912F846B1002A5394 /* UICallButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICallButton.m; sourceTree = ""; }; @@ -637,6 +645,8 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( + 2211DBBA14769C8200DEE054 /* AdvancedPhoneViewController.m */, + 2211DBBB14769C8200DEE054 /* CallDelegate.m */, 2214EB7012F84668002A5394 /* LinphoneUI */, 2218A92212FBE1340088A667 /* FirstLoginViewController.h */, 2218A92312FBE1340088A667 /* FirstLoginViewController.m */, @@ -1278,6 +1288,9 @@ 223963171393CFAF001DE689 /* FastAddressBook.m in Sources */, 22E028B713B4CCBD0068A713 /* VideoViewController.m in Sources */, 22AA8B0113D83F6300B30535 /* UICamSwitch.m in Sources */, + 2211DBBC14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */, + 2211DBBE14769C8300DEE054 /* CallDelegate.m in Sources */, + 2211DBC014769CB200DEE054 /* IncallViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1307,6 +1320,9 @@ 22D8F157147548E2008C97DB /* FastAddressBook.m in Sources */, 22D8F158147548E2008C97DB /* VideoViewController.m in Sources */, 22D8F159147548E2008C97DB /* UICamSwitch.m in Sources */, + 2211DBBD14769C8300DEE054 /* AdvancedPhoneViewController.m in Sources */, + 2211DBBF14769C8300DEE054 /* CallDelegate.m in Sources */, + 2211DBC114769CB300DEE054 /* IncallViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/linphonerc b/linphonerc index 26be7bee4..ebdbde64c 100644 --- a/linphonerc +++ b/linphonerc @@ -31,7 +31,7 @@ echocancellation=0 [misc] history_max_size=30 -max_calls=1 +max_calls=3 [video] display=1 @@ -40,4 +40,3 @@ show_local=0 enabled=1 size=ios-medium -