diff --git a/Classes/AdvancedPhoneViewController.m b/Classes/AdvancedPhoneViewController.m index d4b3a0392..1328e5ad3 100644 --- a/Classes/AdvancedPhoneViewController.m +++ b/Classes/AdvancedPhoneViewController.m @@ -18,7 +18,7 @@ */ #import "AdvancedPhoneViewController.h" - +#import "IncallViewController.h" @implementation AdvancedPhoneViewController @@ -38,29 +38,29 @@ 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 (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]; 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..9635700c1 100644 --- a/Classes/IncallViewController.h +++ b/Classes/IncallViewController.h @@ -23,7 +23,7 @@ #include "UILinphone.h" -@interface IncallViewController : UIViewController { +@interface IncallViewController : UIViewController { UIView* controlSubView; @@ -38,6 +38,7 @@ UIPauseResumeButton* pause; UISpeakerButton* speaker; UIButton* contacts; + UITableView* callTableView; //key pad @@ -57,6 +58,10 @@ UIDigitButton* hash; UIHangUpButton* endPad; UIButton* close; + + bool dismissed; + + NSTimer *durationRefreasher; ABPeoplePickerNavigationController* myPeoplePickerController; } @@ -78,6 +83,7 @@ @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* one; diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m index c3a7464e9..5af0c2f89 100644 --- a/Classes/IncallViewController.m +++ b/Classes/IncallViewController.m @@ -19,8 +19,8 @@ #import "IncallViewController.h" #import #import "linphonecore.h" - - +#include "LinphoneManager.h" +#include "private.h" @implementation IncallViewController @@ -39,6 +39,7 @@ @synthesize dialer; @synthesize speaker; @synthesize contacts; +@synthesize callTableView; @synthesize one; @synthesize two; @@ -71,7 +72,9 @@ [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"] ]; + UIImage* rc = [UIImage imageNamed:@"resumecall.png"]; + UIImage* pc = [UIImage imageNamed:@"pausecall.png"]; + [pause initWithOnImage:rc offImage:pc ]; [speaker initWithOnImage:[UIImage imageNamed:@"Speaker-32-on.png"] offImage:[UIImage imageNamed:@"Speaker-32-off.png"] ]; @@ -92,8 +95,29 @@ } +-(void)updateCallsDurations { + [callTableView reloadData]; +} +-(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]; + } +} +- (void) viewDidDisappear:(BOOL)animated { + if (durationRefreasher != nil) { + [durationRefreasher invalidate]; + durationRefreasher=nil; + } +} - (void)viewDidUnload { @@ -102,13 +126,15 @@ -(void) displayStatus:(NSString*) message; { [status setText:message]; + + [callTableView reloadData]; } -(void) displayPad:(bool) 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]; @@ -120,18 +146,31 @@ [peerNumber setText:@""]; } [callDuration setText:@"Calling"]; + dismissed = false; + + [callTableView reloadData]; } --(void) displayIncallFromUI:(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 { [callDuration start]; + dismissed = false; + [callTableView reloadData]; } -(void) displayDialerFromUI:(UIViewController*) viewCtrl forUser:(NSString*) username withDisplayName:(NSString*) displayName { [callDuration stop]; [self dismissModalViewControllerAnimated:true]; + dismissed = true; + [callTableView reloadData]; } -(void) updateUIFromLinphoneState:(UIViewController *)viewCtrl { [mute reset]; [pause reset]; + + [callTableView reloadData]; } - (IBAction)doAction:(id)sender { @@ -177,5 +216,152 @@ [super dealloc]; } +bool isInConference(LinphoneCall* call) { + 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; +} + +-(LinphoneCall*) retrieveCallAtIndex: (NSInteger) index inConference:(bool) conf{ + const MSList* calls = linphone_core_get_calls([LinphoneManager getLc]); + + while (calls != 0 && index > 0) { + if (isInConference((LinphoneCall*)calls->data) == conf) { + 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) updateCell:(UITableViewCell*)cell withCall:(LinphoneCall*) call conferenceActive:(bool)confActive{ + if (call == NULL) { + ms_error("UpdateCell called with null call"); + [cell.textLabel setText:@"BUG IN APP - call is null"]; + 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.accessoryType = UITableViewCellAccessoryCheckmark; + else if (confActive && isInConference(call)) + cell.accessoryType = UITableViewCellAccessoryCheckmark; + else + cell.accessoryType = UITableViewCellAccessoryNone; +} + + +// 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; + } + + ms_message("pouet"); + + LinphoneCore* lc = [LinphoneManager getLc]; + if (indexPath.section == 0 && linphone_core_get_conference_size(lc) > 0) + [self updateCell:cell withCall: [self retrieveCallAtIndex:indexPath.row inConference:true] conferenceActive:linphone_core_is_in_conference(lc)]; + else + [self updateCell:cell withCall: [self retrieveCallAtIndex:indexPath.row inConference:false] + conferenceActive:linphone_core_is_in_conference(lc)]; + + + /*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]; + + 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 { + 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 +{ + if (section == 0 && linphone_core_get_conference_size([LinphoneManager getLc]) > 0) + return @"CONF"; + else + return @"CALLS"; +} + +// UITableViewDataSource +- (NSString*) tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section +{ + return nil; +} + @end diff --git a/Classes/IncallViewController.xib b/Classes/IncallViewController.xib index a2b4e804e..b1930ec64 100644 --- a/Classes/IncallViewController.xib +++ b/Classes/IncallViewController.xib @@ -12,6 +12,7 @@ YES + IBUITableView IBUIViewController IBUIButton IBUIView @@ -42,9 +43,89 @@ 274 YES + + + 274 + {320, 182} + + + _NS:418 + + 10 + + 549453824 + {512, 1} + + YES + + YES + + + + TU0AKgAACAjFzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ +xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ +y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ +xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ +y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ +xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ +y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ +xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/ +y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/ +y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/ +xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/ +xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/ +xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/xczS/8vS2P/L0tj/xczU/8XM1P/FzNT/ +xczU/8XM0v/L0tj/y9LY/8XM1P/FzNT/xczU/8XM1P/FzNL/y9LY/8vS2P/FzNT/xczU/8XM1P/FzNT/ +xczS/8vS2P/L0tj/xczU/wANAQAAAwAAAAECAAAAAQEAAwAAAAEAAQAAAQIAAwAAAAQAAAiqAQMAAwAA +AAEAAQAAAQYAAwAAAAEAAgAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEABAAAARYAAwAA +AAEAAQAAARcABAAAAAEAAAgAARwAAwAAAAEAAQAAAVIAAwAAAAEAAQAAAVMAAwAAAAQAAAiyAAAAAAAI +AAgACAAIAAEAAQABAAE + + + + + + 3 + MCAwAA + + + groupTableViewBackgroundColor + + YES + IBCocoaTouchFramework + YES + NO + 1 + 2 + 0 + YES + 44 + 10 + 10 + - 292 + -2147483356 {320, 55} @@ -74,7 +155,7 @@ - 292 + -2147483356 {{31, 63}, {61, 21}} @@ -93,11 +174,11 @@ - 292 + -2147483356 {{239, 63}, {65, 21}} - + NO YES NO @@ -112,7 +193,7 @@ - 292 + -2147483356 {{31, 347}, {258, 21}} @@ -180,7 +261,7 @@ {{170, 266}, {72, 37}} - + NO NO IBCocoaTouchFramework @@ -531,7 +612,7 @@ {{0, 121}, {82, 52}} - + NO NO IBCocoaTouchFramework @@ -559,7 +640,7 @@ {{6, 261}, {258, 52}} - + NO NO IBCocoaTouchFramework @@ -582,7 +663,7 @@ {{90, 115}, {82, 52}} - + NO NO IBCocoaTouchFramework @@ -632,7 +713,7 @@ {{181, 61}, {82, 52}} - + NO NO IBCocoaTouchFramework @@ -905,6 +986,14 @@ 105 + + + callTableView + + + + 109 + doAction: @@ -932,6 +1021,22 @@ 101 + + + dataSource + + + + 107 + + + + delegate + + + + 108 + @@ -975,6 +1080,7 @@ + @@ -1160,6 +1266,11 @@ pauseresume + + 106 + + + @@ -1173,6 +1284,7 @@ 10.IBPluginDependency 104.CustomClassName 104.IBPluginDependency + 106.IBPluginDependency 11.IBPluginDependency 12.CustomClassName 12.IBPluginDependency @@ -1227,6 +1339,7 @@ UIPauseResumeButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin UIDuration com.apple.InterfaceBuilder.IBCocoaTouchPlugin UISpeakerButton @@ -1283,7 +1396,7 @@ - 105 + 109 @@ -1307,6 +1420,7 @@ YES callDuration + callTableView close contacts controlSubView @@ -1336,6 +1450,7 @@ YES UILabel + UITableView UIButton UIButton UIView @@ -1368,6 +1483,7 @@ YES callDuration + callTableView close contacts controlSubView @@ -1400,6 +1516,10 @@ callDuration UILabel + + callTableView + UITableView + close UIButton diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 5344f5f50..736d06e16 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" diff --git a/Classes/LinphoneUI/LinphoneManager.m b/Classes/LinphoneUI/LinphoneManager.m index fed0660d9..0b02bf203 100644 --- a/Classes/LinphoneUI/LinphoneManager.m +++ b/Classes/LinphoneUI/LinphoneManager.m @@ -113,31 +113,36 @@ 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)); +-(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] initWithCString: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)); + const char* lDisplayNameChars = linphone_address_get_display_name(linphone_call_get_remote_address(call)); NSString* lDisplayName = lDisplayNameChars?[[NSString alloc] initWithCString:lDisplayNameChars]:@""; + + bool canHideInCallView = (linphone_core_get_calls([LinphoneManager getLc]) == NULL); switch (new_state) { 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; @@ -170,15 +175,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; @@ -437,7 +446,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] ; diff --git a/Classes/LinphoneUI/LinphoneUIDelegates.h b/Classes/LinphoneUI/LinphoneUIDelegates.h index 081139167..a6ced61e7 100644 --- a/Classes/LinphoneUI/LinphoneUIDelegates.h +++ b/Classes/LinphoneUI/LinphoneUIDelegates.h @@ -17,14 +17,14 @@ * 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) 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) updateUIFromLinphoneState:(UIViewController*) viewCtrl; //status reporting -(void) displayStatus:(NSString*) message; diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index 886df2a97..07df3c9b5 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -20,12 +20,13 @@ #import #import "linphonecore.h" #import "UILinphone.h" +#import "CallDelegate.h" @class IncallViewController; @class FirstLoginViewController; -@interface PhoneViewController : UIViewController { +@interface PhoneViewController : UIViewController { @private //UI definition @@ -41,7 +42,7 @@ UILabel* peerLabel; - UICallButton* call; + UICallButton* __call; UIHangUpButton* hangup; UILabel* status; @@ -70,7 +71,7 @@ } @property (nonatomic, retain) IBOutlet UIView* dialerView; @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; diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 6b49a18f0..f460f34db 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -22,13 +22,14 @@ #import #import #import "LinphoneManager.h" +#include "FirstLoginViewController.h" @implementation PhoneViewController @synthesize dialerView ; @synthesize address ; -@synthesize call; +@synthesize __call; @synthesize hangup; @synthesize status; @synthesize erase; @@ -69,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]; @@ -117,7 +103,7 @@ [nine initWithNumber:'9' addressField:address ]; [star initWithNumber:'*' addressField:address ]; [hash initWithNumber:'#' addressField:address ]; - [call initWithAddress:address withDisplayName:mDisplayName]; + [__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]; @@ -178,7 +164,7 @@ [incallView setHidden:true]; [dialerView setHidden:false]; - [call setEnabled:true]; + [__call setEnabled:true]; [hangup setEnabled:false]; [callDuration stop]; @@ -194,7 +180,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) { @@ -211,20 +197,20 @@ [incallView setHidden:false]; [dialerView setHidden:true]; } --(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 } --(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; } @@ -239,7 +225,7 @@ } --(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 == UIApplicationStateBackground) { @@ -255,22 +241,28 @@ [[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; } @@ -284,7 +276,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..9e854ae94 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 @@ -53,6 +53,7 @@ 292 {320, 40} + NO YES NO @@ -66,12 +67,22 @@ 1 10 1 + + 1 + 17 + + + Helvetica + 17 + 16 + 292 {{98, 38}, {124, 21}} + NO YES NO @@ -82,22 +93,20 @@ 1 10 1 + + 292 {{239, 14}, {72, 37}} + NO NO IBCocoaTouchFramework 0 0 - - Helvetica-Bold - 15 - 16 - 3 MQA @@ -114,18 +123,29 @@ NSImage Speaker-32-off.png + + Helvetica-Bold + Helvetica + 2 + 15 + + + Helvetica-Bold + 15 + 16 + 292 {{0, 14}, {72, 37}} + NO NO IBCocoaTouchFramework 0 0 - 1 @@ -136,10 +156,13 @@ NSImage mic_active.png + + {320, 65} + 1 MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA @@ -157,11 +180,11 @@ 292 {{254, 0}, {66, 65}} + NO IBCocoaTouchFramework 0 0 - <- @@ -173,12 +196,15 @@ NSImage clavier-01-106px.png + + 292 {{5, 0}, {255, 66}} + NO NO IBCocoaTouchFramework @@ -192,11 +218,6 @@ 2 - - Helvetica - 36 - 16 - YES 15 @@ -205,10 +226,22 @@ IBCocoaTouchFramework 1 + + Helvetica + Helvetica + 0 + 36 + + + Helvetica + 36 + 16 + {320, 65} + 1 MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA @@ -220,12 +253,12 @@ 292 {{0, 328}, {160, 66}} + NO NO IBCocoaTouchFramework 0 0 - 1 @@ -240,12 +273,15 @@ NSImage clavier-01-160px.png + + 292 {{9, 390}, {304, 21}} + NO YES NO @@ -255,18 +291,20 @@ 1 10 + + 292 {{213, 64}, {107, 66}} + NO NO IBCocoaTouchFramework 0 0 - 3 @@ -275,18 +313,20 @@ + + 292 {{0, 130}, {107, 66}} + NO NO IBCocoaTouchFramework 0 0 - 4 @@ -295,18 +335,20 @@ + + 292 {{107, 130}, {106, 66}} + NO NO IBCocoaTouchFramework 0 0 - 5 @@ -318,18 +360,20 @@ NSImage clavier-01-108px.png + + 292 {{213, 130}, {107, 66}} + NO NO IBCocoaTouchFramework 0 0 - 6 @@ -338,18 +382,20 @@ + + 292 {{0, 196}, {107, 66}} + NO NO IBCocoaTouchFramework 0 0 - 7 @@ -358,18 +404,20 @@ + + 292 {{213, 196}, {107, 66}} + NO NO IBCocoaTouchFramework 0 0 - 9 @@ -378,18 +426,20 @@ + + 292 {{107, 64}, {106, 66}} + NO NO IBCocoaTouchFramework 0 0 - 2 @@ -398,12 +448,15 @@ + + 292 {{0, 64}, {107, 66}} + 1 MC40MDAwMDAwMSAxIDEgMAA @@ -413,7 +466,6 @@ IBCocoaTouchFramework 0 0 - 1 @@ -422,18 +474,20 @@ + + 292 {{0, 262}, {107, 66}} + NO NO IBCocoaTouchFramework 0 0 - * @@ -442,18 +496,20 @@ + + 292 {{107, 262}, {106, 66}} + NO NO IBCocoaTouchFramework 0 0 - 0+ @@ -462,18 +518,20 @@ + + 292 {{213, 262}, {107, 66}} + NO NO IBCocoaTouchFramework 0 0 - # @@ -482,18 +540,20 @@ + + 292 {{107, 196}, {106, 66}} + NO NO IBCocoaTouchFramework 0 0 - 8 @@ -502,19 +562,21 @@ + + 292 {{160, 328}, {160, 66}} + NO NO IBCocoaTouchFramework NO 0 0 - 1 @@ -526,10 +588,13 @@ stopcall-red.png + + - {320, 460} + {{0, 20}, {320, 460}} + 1 MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA @@ -539,6 +604,7 @@ + 1 1 IBCocoaTouchFramework @@ -556,14 +622,6 @@ 12 - - - call - - - - 13 - status @@ -572,14 +630,6 @@ 15 - - - delegate - - - - 19 - view @@ -684,15 +734,6 @@ 54 - - - doKeyPad: - - - 1 - - 92 - hangup @@ -757,13 +798,40 @@ 158 + + + __call + + + + 159 + + + + delegate + + + + 19 + + + + doKeyPad: + + + 1 + + 92 + YES 0 - + + YES + @@ -956,33 +1024,27 @@ 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 29.CustomClassName 29.IBPluginDependency - 29.IBViewBoundsToFrameTransform 30.CustomClassName 30.IBPluginDependency 31.CustomClassName @@ -997,14 +1059,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 +1071,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 +1095,6 @@ UIHangUpButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{32, 282}, {320, 90}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES @@ -1046,34 +1104,18 @@ 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 +1130,11 @@ 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 +1142,22 @@ UICallButton com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{60, 553}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES - - YES - + YES - - YES - + - 158 + 159 @@ -1150,9 +1180,9 @@ YES YES + __call address back - call callDuration dialerView eight @@ -1178,8 +1208,8 @@ YES - UITextField UIButton + UITextField UIButton UILabel UIView @@ -1209,9 +1239,9 @@ YES YES + __call address back - call callDuration dialerView eight @@ -1237,6 +1267,10 @@ YES + + __call + UIButton + address UITextField @@ -1245,10 +1279,6 @@ back UIButton - - call - UIButton - callDuration UILabel @@ -1341,15 +1371,7 @@ IBProjectSource - Classes/PhoneViewController.h - - - - PhoneViewController - UIViewController - - IBUserSource - + ./Classes/PhoneViewController.h @@ -1357,7 +1379,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UICallButton.h + ./Classes/UICallButton.h @@ -1365,7 +1387,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UIDigitButton.h + ./Classes/UIDigitButton.h @@ -1373,7 +1395,7 @@ UILabel IBProjectSource - Classes/LinphoneUI/UIDuration.h + ./Classes/UIDuration.h @@ -1381,7 +1403,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UIEraseButton.h + ./Classes/UIEraseButton.h @@ -1389,7 +1411,7 @@ UIButton IBProjectSource - Classes/LinphoneUI/UIHangUpButton.h + ./Classes/UIHangUpButton.h @@ -1397,7 +1419,7 @@ UIToggleButton IBProjectSource - Classes/LinphoneUI/UIMuteButton.h + ./Classes/UIMuteButton.h @@ -1405,233 +1427,15 @@ UIToggleButton IBProjectSource - Classes/LinphoneUI/UISpeakerButton.h + ./Classes/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/UIToggleButton.h @@ -1644,14 +1448,13 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES - ../linphone.xcodeproj 3 YES @@ -1671,11 +1474,11 @@ {106, 60} {108, 60} {160, 60} - {32, 32} + {20, 20} {60, 52} {62, 54} - 132 + 933 diff --git a/PhoneMainView.xib b/PhoneMainView.xib index dadf43e09..27580eb6f 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,12 @@ IBCocoaTouchFramework - + 1316 {320, 480} + + 1 MSAxIDEAA @@ -58,24 +61,25 @@ + 1 1 IBCocoaTouchFramework NO - - History - - History + + + Dialer NSImage - history-orange.png + dialer-orange.png IBCocoaTouchFramework - + PhoneViewController + 1 1 IBCocoaTouchFramework @@ -83,34 +87,34 @@ YES - - - - Dialer + + History + + History NSImage - dialer-orange.png + history-orange.png IBCocoaTouchFramework - - PhoneViewController + 1 1 IBCocoaTouchFramework NO + IBCocoaTouchFramework - 5 + 1 1 IBCocoaTouchFramework @@ -120,12 +124,12 @@ IBCocoaTouchFramework - 0 + 1 1 IBCocoaTouchFramework @@ -133,9 +137,11 @@ - + 266 - {{129, 330}, {163, 49}} + {{0, 431}, {320, 49}} + + 3 MCAwAA @@ -178,7 +184,9 @@ YES 0 - + + YES + @@ -289,52 +297,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 +350,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 +370,13 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 YES - linphone.xcodeproj 3 YES @@ -856,6 +391,6 @@ {25, 23} - 87 + 933 diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index a61d67707..e7cd1110c 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -83,8 +83,13 @@ 22F254811073D99800AC9B3F /* ringback.wav in Resources */ = {isa = PBXBuildFile; fileRef = 22F254801073D99800AC9B3F /* ringback.wav */; }; 22F51EF6107FA66500F98953 /* untitled.plist in Resources */ = {isa = PBXBuildFile; fileRef = 22F51EF5107FA66500F98953 /* untitled.plist */; }; 288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; }; + 346A75C714619F1D005C9D07 /* AdvancedPhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 346A75C614619F1D005C9D07 /* AdvancedPhoneViewController.m */; }; + 346A75C814619F73005C9D07 /* IncallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 222A483212F7176F0075F07F /* IncallViewController.m */; }; + 346A75CB14628DC6005C9D07 /* pausecall.png in Resources */ = {isa = PBXBuildFile; fileRef = 346A75C914628DC6005C9D07 /* pausecall.png */; }; + 346A75CC14628DC6005C9D07 /* resumecall.png in Resources */ = {isa = PBXBuildFile; fileRef = 346A75CA14628DC6005C9D07 /* resumecall.png */; }; + 346A75CF14628F02005C9D07 /* UIPauseResumeButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 346A75CE14628F02005C9D07 /* UIPauseResumeButton.m */; }; + 346A75D21462A786005C9D07 /* CallDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 346A75D11462A786005C9D07 /* CallDelegate.m */; }; 70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; }; - F0A486D91404FE53009EC0BE /* libsrtp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F0A486D71404FE53009EC0BE /* libsrtp.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -403,9 +408,16 @@ 288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* linphone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = linphone_Prefix.pch; sourceTree = ""; }; + 346A75C514619F1D005C9D07 /* AdvancedPhoneViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdvancedPhoneViewController.h; sourceTree = ""; }; + 346A75C614619F1D005C9D07 /* AdvancedPhoneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdvancedPhoneViewController.m; sourceTree = ""; }; + 346A75C914628DC6005C9D07 /* pausecall.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = pausecall.png; path = submodules/linphone/pixmaps/pausecall.png; sourceTree = ""; }; + 346A75CA14628DC6005C9D07 /* resumecall.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = resumecall.png; path = submodules/linphone/pixmaps/resumecall.png; sourceTree = ""; }; + 346A75CD14628F02005C9D07 /* UIPauseResumeButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIPauseResumeButton.h; sourceTree = ""; }; + 346A75CE14628F02005C9D07 /* UIPauseResumeButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIPauseResumeButton.m; sourceTree = ""; }; + 346A75D01462A786005C9D07 /* CallDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallDelegate.h; sourceTree = ""; }; + 346A75D11462A786005C9D07 /* CallDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallDelegate.m; sourceTree = ""; }; 70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = Resources/rootca.pem; sourceTree = ""; }; 8D1107310486CEB800E47090 /* linphone-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "linphone-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; - F0A486D71404FE53009EC0BE /* libsrtp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libsrtp.a; path = "liblinphone-sdk/apple-darwin/lib/libsrtp.a"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -437,7 +449,6 @@ 22D1B68112A3E0BE001AE361 /* libresolv.dylib in Frameworks */, 226F2ED71344B0EF00F6EF27 /* libopencore-amrnb.a in Frameworks */, 226F2ED81344B0EF00F6EF27 /* libmsamr.a in Frameworks */, - F0A486D91404FE53009EC0BE /* libsrtp.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -447,8 +458,8 @@ 080E96DDFE201D6D7F000001 /* Classes */ = { isa = PBXGroup; children = ( - 22F9D6B51463EBDC00C6FEAF /* AdvancedPhoneViewController.m */, - 22F9D6B61463EBDC00C6FEAF /* AdvancedPhoneViewController.h */, + 346A75C514619F1D005C9D07 /* AdvancedPhoneViewController.h */, + 346A75C614619F1D005C9D07 /* AdvancedPhoneViewController.m */, 2214EB7012F84668002A5394 /* LinphoneUI */, 2218A92212FBE1340088A667 /* FirstLoginViewController.h */, 2218A92312FBE1340088A667 /* FirstLoginViewController.m */, @@ -474,6 +485,8 @@ 227BCDC110D4004600FBFD76 /* CallHistoryTableViewController.xib */, 2242D9C710D691F900E9963F /* GenericTabViewController.h */, 2242D9C810D691F900E9963F /* GenericTabViewController.m */, + 346A75D01462A786005C9D07 /* CallDelegate.h */, + 346A75D11462A786005C9D07 /* CallDelegate.m */, ); path = Classes; sourceTree = ""; @@ -677,6 +690,8 @@ 2214EB7012F84668002A5394 /* LinphoneUI */ = { isa = PBXGroup; children = ( + 346A75CD14628F02005C9D07 /* UIPauseResumeButton.h */, + 346A75CE14628F02005C9D07 /* UIPauseResumeButton.m */, 2248E90C12F7E4CF00220D9C /* UIDigitButton.h */, 2248E90D12F7E4CF00220D9C /* UIDigitButton.m */, 2248E99D12F801C200220D9C /* LinphoneManager.h */, @@ -847,6 +862,8 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 346A75C914628DC6005C9D07 /* pausecall.png */, + 346A75CA14628DC6005C9D07 /* resumecall.png */, 70571E1913FABCB000CDD3C2 /* rootca.pem */, 22E19E47138A67A000FBFE87 /* missed_call.png */, 228B19AE130290C500F154D3 /* iTunesArtwork */, @@ -996,6 +1013,8 @@ 2214783D1386A2030020F8B8 /* Localizable.strings in Resources */, 22E19E48138A67A000FBFE87 /* missed_call.png in Resources */, 70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */, + 346A75CB14628DC6005C9D07 /* pausecall.png in Resources */, + 346A75CC14628DC6005C9D07 /* resumecall.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1026,6 +1045,10 @@ 22C755601317E59C007BC101 /* UIBluetoothButton.m in Sources */, 22BB1A69132FF16A005CD7AA /* UIEraseButton.m in Sources */, 223963171393CFAF001DE689 /* FastAddressBook.m in Sources */, + 346A75C714619F1D005C9D07 /* AdvancedPhoneViewController.m in Sources */, + 346A75C814619F73005C9D07 /* IncallViewController.m in Sources */, + 346A75CF14628F02005C9D07 /* UIPauseResumeButton.m in Sources */, + 346A75D21462A786005C9D07 /* CallDelegate.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/linphonerc b/linphonerc index 6f894b055..d5fc9446b 100644 --- a/linphonerc +++ b/linphonerc @@ -31,4 +31,4 @@ echocancellation=0 [misc] history_max_size=30 -max_calls=1 +max_calls=10