diff --git a/Classes/CallHistoryTableViewController.xib b/Classes/CallHistoryTableViewController.xib index fea5a5b11..816d687b2 100644 --- a/Classes/CallHistoryTableViewController.xib +++ b/Classes/CallHistoryTableViewController.xib @@ -79,7 +79,7 @@ 292 - {{238, 0}, {72, 37}} + {{238, 4}, {72, 37}} NO NO diff --git a/Classes/ContactPickerDelegate.m b/Classes/ContactPickerDelegate.m index b66a5db09..d8de36897 100644 --- a/Classes/ContactPickerDelegate.m +++ b/Classes/ContactPickerDelegate.m @@ -38,7 +38,7 @@ CFTypeRef multiValue = ABRecordCopyValue(person, property); CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue,identifier); NSString *phoneNumber = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, valueIdx); - [phoneControllerDelegate setPhoneNumber:phoneNumber]; + [phoneControllerDelegate setPhoneNumber:phoneNumber withDisplayName:(NSString*)ABRecordCopyCompositeName(person)]; [linphoneDelegate selectDialerTab]; return false; diff --git a/Classes/FavoriteTableViewController.h b/Classes/FavoriteTableViewController.h deleted file mode 100644 index 768d6b662..000000000 --- a/Classes/FavoriteTableViewController.h +++ /dev/null @@ -1,36 +0,0 @@ -/* FavoriteTableViewController.h - * - * Copyright (C) 2009 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - - -#import -#import "GenericTabViewController.h" - -@interface FavoriteTableViewController : GenericTabViewController { - UIButton* add; - UIButton* edit; - - -} -- (IBAction)doAddFavorite:(id)sender; -- (IBAction)doEditFavorite:(id)sender; - -@property (nonatomic, retain) IBOutlet UIButton* add; -@property (nonatomic, retain) IBOutlet UIButton* edit; -@end - diff --git a/Classes/FavoriteTableViewController.m b/Classes/FavoriteTableViewController.m deleted file mode 100644 index 0cb53a688..000000000 --- a/Classes/FavoriteTableViewController.m +++ /dev/null @@ -1,242 +0,0 @@ -/* FavoriteTableViewController.h - * - * Copyright (C) 2009 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#import "FavoriteTableViewController.h" - - - -@implementation FavoriteTableViewController -@synthesize add; -@synthesize edit; -/* -- (id)initWithStyle:(UITableViewStyle)style { - // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - if (self = [super initWithStyle:style]) { - } - return self; -} -*/ - -/* -- (void)viewDidLoad { - [super viewDidLoad]; - - // Uncomment the following line to display an Edit button in the navigation bar for this view controller. - // self.navigationItem.rightBarButtonItem = self.editButtonItem; -} -*/ - -/* -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; -} -*/ -/* -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; -} -*/ -/* -- (void)viewWillDisappear:(BOOL)animated { - [super viewWillDisappear:animated]; -} -*/ -/* -- (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; -} -*/ - -/* -// Override to allow orientations other than the default portrait orientation. -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return (interfaceOrientation == UIInterfaceOrientationPortrait); -} -*/ - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; -} - - -- (IBAction)doAddFavorite:(id)sender { - ABPeoplePickerNavigationController* peoplePickerController = [[[ABPeoplePickerNavigationController alloc] init] autorelease]; - [peoplePickerController setPeoplePickerDelegate:self]; - - [self presentModalViewController: peoplePickerController animated:true]; -} -- (IBAction)doEditFavorite:(id)sender { - if ([ self tableView:self.tableView numberOfRowsInSection:0] <= 0) { - return; - } - if (self.tableView.editing) { - [self.tableView setEditing:false animated:true]; - [self.edit setTitle:@"Edit" forState: UIControlStateNormal]; - } else { - [self.tableView setEditing:true animated:true]; - [self.edit setTitle:@"Ok" forState: UIControlStateNormal]; - } -} -#pragma mark Table view methods - -- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; -} - - -// Customize the number of rows in the table view. -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - const MSList * friends =linphone_core_get_friend_list(myLinphoneCore); - return ms_list_size(friends); -} - - -// Customize the appearance of table view cells. -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - - static NSString *CellIdentifier = @"Cell"; - - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; - if (cell == nil) { - cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; - } - LinphoneFriend* friend = ms_list_nth_data(linphone_core_get_friend_list(myLinphoneCore), indexPath.row); - const char* name = linphone_address_get_username(linphone_friend_get_uri(friend)); - - [cell.textLabel setText:[[NSString alloc] initWithCString:name encoding:[NSString defaultCStringEncoding]]]; - cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; - - return cell; -} -/* -- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { - if (isEditing) { - } else { - [super tableView:tableView accessoryButtonTappedForRowWithIndexPath:indexPath]; - } - -} -*/ -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - // Navigation logic may go here. Create and push another view controller. - // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; - // [self.navigationController pushViewController:anotherViewController]; - // [anotherViewController release]; - LinphoneFriend* friend = ms_list_nth_data(linphone_core_get_friend_list(myLinphoneCore), indexPath.row); - const char* name = linphone_address_get_username(linphone_friend_get_uri(friend)); - [phoneControllerDelegate setPhoneNumber:[[NSString alloc] initWithCString:name encoding:[NSString defaultCStringEncoding]]]; - [linphoneDelegate selectDialerTab]; - - -} - - -/* -// Override to support conditional editing of the table view. -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the specified item to be editable. - return YES; -} -*/ - - - -// Override to support editing the table view. -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { - - if (editingStyle == UITableViewCellEditingStyleDelete) { - LinphoneFriend* friend = ms_list_nth_data(linphone_core_get_friend_list(myLinphoneCore), indexPath.row); - linphone_core_remove_friend(myLinphoneCore, friend); - // Delete the row from the data source - [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; - if ([ self tableView:self.tableView numberOfRowsInSection:0] <= 0) { - [self.tableView setEditing:false animated:true]; - [self.edit setTitle:@"Edit" forState: UIControlStateNormal]; - } - } - else if (editingStyle == UITableViewCellEditingStyleInsert) { - // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view - } -} - - - -/* -// Override to support rearranging the table view. -- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath { -} -*/ - - -/* -// Override to support conditional rearranging of the table view. -- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath { - // Return NO if you do not want the item to be re-orderable. - return YES; -} -*/ - - -- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker - shouldContinueAfterSelectingPerson:(ABRecordRef)person { - return true; - -} - -- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker - shouldContinueAfterSelectingPerson:(ABRecordRef)person - property:(ABPropertyID)property - identifier:(ABMultiValueIdentifier)identifier { - - CFTypeRef multiValue = ABRecordCopyValue(person, property); - CFIndex valueIdx = ABMultiValueGetIndexForIdentifier(multiValue,identifier); - NSString *phone = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, valueIdx); - NSString *phoneUri = [NSString stringWithFormat:@"sip:%s@dummy.net",[phone cStringUsingEncoding:[NSString defaultCStringEncoding]]]; - NSString* compositeName = ABRecordCopyCompositeName(person); - - LinphoneFriend * newFriend = linphone_friend_new_with_addr([phoneUri cStringUsingEncoding:[NSString defaultCStringEncoding]]); - - linphone_friend_set_name(newFriend,[compositeName cStringUsingEncoding:[NSString defaultCStringEncoding]]); - linphone_friend_send_subscribe(newFriend, false); - //linphone_friend_set_sip_addr(newFriend, const char *uri); - linphone_core_add_friend(myLinphoneCore, newFriend); - [self dismissModalViewControllerAnimated:true]; - return false; -} - -- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker { - [self dismissModalViewControllerAnimated:true]; -} - -- (void)dealloc { - [super dealloc]; -} - - -@end - diff --git a/Classes/FavoriteTableViewController.xib b/Classes/FavoriteTableViewController.xib deleted file mode 100644 index d24219858..000000000 --- a/Classes/FavoriteTableViewController.xib +++ /dev/null @@ -1,382 +0,0 @@ - - - - 784 - 9L31a - 680 - 949.54 - 353.00 - - YES - - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - 292 - {320, 460} - - - 3 - MQA - - NO - YES - NO - - NO - 1 - 0 - YES - 4.400000e+01 - 2.200000e+01 - 2.200000e+01 - - - - 292 - - YES - - - 292 - {320, 44} - - NO - YES - NO - Favorites - - 1 - MCAwIDAAA - - - - 3 - MCAwLjAwOTk5OTk5OTgAA - - 1 - 1.000000e+01 - 1 - - - - 292 - {{264, 3}, {44, 37}} - - NO - NO - 0 - 0 - - Helvetica-Bold - 1.500000e+01 - 16 - - 1 - + - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MC41AA - - - - - 292 - {{6, 3}, {61, 37}} - - NO - NO - 0 - 0 - - 1 - Edit - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - {320, 44} - - - 3 - MC42OTcwODAzMSAwLjk5MDAwMDAxAA - - NO - - - - - YES - - - view - - - - 5 - - - - dataSource - - - - 6 - - - - delegate - - - - 7 - - - - header - - - - 12 - - - - add - - - - 13 - - - - doAddFavorite: - - - 7 - - 14 - - - - edit - - - - 15 - - - - doEditFavorite: - - - 7 - - 16 - - - - - YES - - 0 - - YES - - - - - - -1 - - - RmlsZSdzIE93bmVyA - - - -2 - - - - - 4 - - - - - 8 - - - YES - - - - - - header - - - 9 - - - - - 10 - - - add - - - 11 - - - edit - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 10.IBPluginDependency - 11.IBPluginDependency - 4.IBEditorWindowLastContentRect - 4.IBPluginDependency - 8.IBEditorWindowLastContentRect - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - FavoriteTableViewController - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{441, 269}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{312, 742}, {320, 44}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 16 - - - - YES - - FavoriteTableViewController - GenericTabViewController - - YES - - YES - doAddFavorite: - doEditFavorite: - - - YES - id - id - - - - YES - - YES - add - edit - - - YES - UIButton - UIButton - - - - IBProjectSource - Classes/FavoriteTableViewController.h - - - - GenericTabViewController - UITableViewController - - YES - - YES - header - linphoneDelegate - phoneControllerDelegate - - - YES - UIView - id - id - - - - IBProjectSource - Classes/GenericTabViewController.h - - - - - 0 - ../linphone.xcodeproj - 3 - 3.1 - - diff --git a/Classes/IncallViewController.h b/Classes/IncallViewController.h deleted file mode 100644 index 9a5771276..000000000 --- a/Classes/IncallViewController.h +++ /dev/null @@ -1,102 +0,0 @@ -/* IncallViewController.h - * - * Copyright (C) 2009 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#import -#import "linphonecore.h" -#import "PhoneViewController.h" -#import - - -@interface IncallViewController : UIViewController { - LinphoneCore* myLinphoneCore; - id phoneviewDelegate; - NSTimer *durationRefreasher; - - - UIView* controlSubView; - UIView* padSubView; - - UILabel* peerName; - UILabel* peerNumber; - UILabel* callDuration; - UILabel* status; - UIButton* end; - UIButton* dialer; - UIButton* mute; - UIButton* speaker; - UIButton* contacts; - - //key pad - UIButton* one; - UIButton* two; - UIButton* three; - UIButton* four; - UIButton* five; - UIButton* six; - UIButton* seven; - UIButton* eight; - UIButton* nine; - UIButton* star; - UIButton* zero; - UIButton* hash; - - UIButton* close; - - bool isMuted; - bool isSpeaker; - - ABPeoplePickerNavigationController* myPeoplePickerController; -} - --(void) setLinphoneCore:(LinphoneCore*) lc; --(void) startCall; - --(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 UIButton* end; -@property (nonatomic, retain) IBOutlet UIButton* dialer; -@property (nonatomic, retain) IBOutlet UIButton* mute; -@property (nonatomic, retain) IBOutlet UIButton* speaker; -@property (nonatomic, retain) IBOutlet UIButton* contacts; - - -@property (nonatomic, retain) IBOutlet UIButton* one; -@property (nonatomic, retain) IBOutlet UIButton* two; -@property (nonatomic, retain) IBOutlet UIButton* three; -@property (nonatomic, retain) IBOutlet UIButton* four; -@property (nonatomic, retain) IBOutlet UIButton* five; -@property (nonatomic, retain) IBOutlet UIButton* six; -@property (nonatomic, retain) IBOutlet UIButton* seven; -@property (nonatomic, retain) IBOutlet UIButton* eight; -@property (nonatomic, retain) IBOutlet UIButton* nine; -@property (nonatomic, retain) IBOutlet UIButton* star; -@property (nonatomic, retain) IBOutlet UIButton* zero; -@property (nonatomic, retain) IBOutlet UIButton* hash; -@property (nonatomic, retain) IBOutlet UIButton* close; - -@property (nonatomic, retain) id phoneviewDelegate; -@end diff --git a/Classes/IncallViewController.m b/Classes/IncallViewController.m deleted file mode 100644 index 73493fca2..000000000 --- a/Classes/IncallViewController.m +++ /dev/null @@ -1,243 +0,0 @@ -/* IncallViewController.h - * - * Copyright (C) 2009 Belledonne Comunications, Grenoble, France - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ -#import "IncallViewController.h" -#import -#import "linphonecore.h" - - - -@implementation IncallViewController -@synthesize phoneviewDelegate; - -@synthesize controlSubView; -@synthesize padSubView; - -@synthesize peerName; -@synthesize peerNumber; -@synthesize callDuration; -@synthesize status; -@synthesize end; -@synthesize close; -@synthesize mute; -@synthesize dialer; -@synthesize speaker; -@synthesize contacts; - -@synthesize one; -@synthesize two; -@synthesize three; -@synthesize four; -@synthesize five; -@synthesize six; -@synthesize seven; -@synthesize eight; -@synthesize nine; -@synthesize star; -@synthesize zero; -@synthesize hash; - - -/* -// 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]) { - // Custom initialization - - } - return self; -} -*/ - - -// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. -- (void)viewDidLoad { - [super viewDidLoad]; - isMuted = false; - isSpeaker = false; - -} - - -/* - // Override to allow orientations other than the default portrait orientation. - - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - // Return YES for supported orientations - return (interfaceOrientation == UIInterfaceOrientationPortrait); - } - */ - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)viewDidUnload { - // Release any retained subviews of the main view. - // e.g. self.myOutlet = nil; - if (durationRefreasher != nil) { - [ durationRefreasher invalidate]; - } - -} - --(void) setLinphoneCore:(LinphoneCore*) lc { - myLinphoneCore = lc; -} - --(void)displayStatus:(NSString*) message { - [status setText:message]; -} - --(void) startCall { - const LinphoneAddress* address = linphone_core_get_remote_uri(myLinphoneCore); - const char* displayName = linphone_address_get_display_name(address)?linphone_address_get_display_name(address):""; - [peerName setText:[NSString stringWithCString:displayName length:strlen(displayName)]]; - - const char* username = linphone_address_get_username(address)!=0?linphone_address_get_username(address):""; - [peerNumber setText:[NSString stringWithCString:username length:strlen(username)]]; - // start scheduler - durationRefreasher = [NSTimer scheduledTimerWithTimeInterval:1 - target:self - selector:@selector(updateCallDuration) - userInfo:nil - repeats:YES]; - -} - --(void)updateCallDuration { - int lDuration = linphone_core_get_current_call_duration(myLinphoneCore); - if (lDuration < 60) { - [callDuration setText:[NSString stringWithFormat: @"%i s", lDuration]]; - } else { - [callDuration setText:[NSString stringWithFormat: @"%i:%i", lDuration/60,lDuration - 60 *(lDuration/60)]]; - } -} - -- (IBAction)doAction:(id)sender { - - if (linphone_core_in_call(myLinphoneCore)) { - //incall behavior - if (sender == one) { - linphone_core_send_dtmf(myLinphoneCore,'1'); - } else if (sender == two) { - linphone_core_send_dtmf(myLinphoneCore,'2'); - } else if (sender == three) { - linphone_core_send_dtmf(myLinphoneCore,'3'); - } else if (sender == four) { - linphone_core_send_dtmf(myLinphoneCore,'4'); - } else if (sender == five) { - linphone_core_send_dtmf(myLinphoneCore,'5'); - } else if (sender == six) { - linphone_core_send_dtmf(myLinphoneCore,'6'); - } else if (sender == seven) { - linphone_core_send_dtmf(myLinphoneCore,'7'); - } else if (sender == eight) { - linphone_core_send_dtmf(myLinphoneCore,'8'); - } else if (sender == nine) { - linphone_core_send_dtmf(myLinphoneCore,'9'); - } else if (sender == star) { - linphone_core_send_dtmf(myLinphoneCore,'*'); - } else if (sender == zero) { - linphone_core_send_dtmf(myLinphoneCore,'0'); - } else if (sender == hash) { - linphone_core_send_dtmf(myLinphoneCore,'#'); - } - } - - - if (sender == end) { - linphone_core_terminate_call(myLinphoneCore,NULL); - } else if (sender == dialer) { - [controlSubView setHidden:true]; - [padSubView setHidden:false]; - - } else if (sender == contacts) { - // start people picker - myPeoplePickerController = [[[ABPeoplePickerNavigationController alloc] init] autorelease]; - [myPeoplePickerController setPeoplePickerDelegate:self]; - - [self presentModalViewController: myPeoplePickerController animated:true]; - } else if (sender == close) { - [controlSubView setHidden:false]; - [padSubView setHidden:true]; - } else if (sender == mute) { - isMuted = isMuted?false:true; - linphone_core_mute_mic(myLinphoneCore,isMuted); - // swithc buttun state - UIImage * tmpImage = [mute backgroundImageForState: UIControlStateNormal]; - [mute setBackgroundImage:[mute backgroundImageForState: UIControlStateHighlighted] forState:UIControlStateNormal]; - [mute setBackgroundImage:tmpImage forState:UIControlStateHighlighted]; - - } else if (sender == speaker) { - isSpeaker = isSpeaker?false:true; - if (isSpeaker) { - //redirect audio to speaker - UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; - AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute - , sizeof (audioRouteOverride) - , &audioRouteOverride); - } else { - //Cancel audio route redirection - UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_None; - AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute - , sizeof (audioRouteOverride) - , &audioRouteOverride); - } - // switch button state - UIImage * tmpImage = [speaker backgroundImageForState: UIControlStateNormal]; - [speaker setBackgroundImage:[speaker backgroundImageForState: UIControlStateHighlighted] forState:UIControlStateNormal]; - [speaker setBackgroundImage:tmpImage forState:UIControlStateHighlighted]; - - }else { - NSLog(@"unknown event from incall view"); - } - -} - -// handle people picker behavior - -- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker - shouldContinueAfterSelectingPerson:(ABRecordRef)person { - return true; - -} - -- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker - shouldContinueAfterSelectingPerson:(ABRecordRef)person - property:(ABPropertyID)property - identifier:(ABMultiValueIdentifier)identifier { - - return false; -} - -- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker { - [self dismissModalViewControllerAnimated:true]; -} - - - - -- (void)dealloc { - [super dealloc]; -} - - -@end diff --git a/Classes/IncallViewController.xib b/Classes/IncallViewController.xib deleted file mode 100644 index ea7013b59..000000000 --- a/Classes/IncallViewController.xib +++ /dev/null @@ -1,1315 +0,0 @@ - - - - 784 - 9L31a - 680 - 949.54 - 353.00 - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - - - IBFirstResponder - - - - - 274 - - YES - - - 292 - {{150, 220}, {20, 20}} - - NO - NO - NO - NO - 2 - - - - 292 - {320, 55} - - NO - YES - NO - Caller - - 1 - MCAwIDAAA - - - 1 - 1.700000e+01 - 1 - - - - 292 - {{31, 63}, {61, 21}} - - NO - YES - NO - Number - - - 1 - 1.000000e+01 - - - - 292 - {{239, 63}, {65, 21}} - - NO - YES - NO - Duration - - - 1 - 1.000000e+01 - - - - 292 - {{31, 347}, {258, 21}} - - NO - YES - NO - status - - - 1 - 1.000000e+01 - - - - 292 - - YES - - - 292 - {{0, 61}, {82, 52}} - - NO - NO - 0 - 0 - - Helvetica-Bold - 1.500000e+01 - 16 - - - 3 - MQA - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - 3 - MC41AA - - - NSImage - mic_active.png - - - NSImage - mic_muted.png - - - - - - - 292 - {{6, 261}, {258, 52}} - - NO - NO - 0 - 0 - - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - red.png - - - - - 292 - {{92, 121}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - Contacts - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{93, 61}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - Dialer - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{181, 61}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - Spk - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - {{25, 110}, {270, 317}} - - - 3 - MSAwAA - - 2 - - - NO - NO - - - - -2147483356 - - YES - - - 292 - {{30, 258}, {80, 65}} - - NO - NO - 0 - 0 - - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - - 292 - {{170, 266}, {72, 37}} - - NO - NO - 0 - 0 - - 1 - close - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{90, 184}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{0, 9}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{90, 9}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 2 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{180, 9}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 3 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{0, 69}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 4 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{90, 69}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 5 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{180, 69}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 6 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{0, 124}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 7 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{90, 124}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 8 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{180, 124}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - 9 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{0, 184}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - * - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{180, 184}, {82, 52}} - - NO - NO - 0 - 0 - - 1 - # - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - {{25, 110}, {270, 317}} - - - 3 - MSAwAA - - - NO - NO - - - {320, 460} - - - 1 - MCAwLjUwMTk2MDgxIDEAA - - NO - - - - - - - YES - - - doAction: - - - 7 - - 20 - - - - view - - - - 23 - - - - doAction: - - - 7 - - 42 - - - - controlSubView - - - - 44 - - - - padSubView - - - - 45 - - - - doAction: - - - 7 - - 47 - - - - dialer - - - - 49 - - - - doAction: - - - 7 - - 50 - - - - close - - - - 51 - - - - end - - - - 53 - - - - one - - - - 54 - - - - zero - - - - 55 - - - - star - - - - 56 - - - - hash - - - - 57 - - - - nine - - - - 58 - - - - two - - - - 59 - - - - three - - - - 60 - - - - doAction: - - - 1 - - 61 - - - - doAction: - - - 1 - - 62 - - - - doAction: - - - 1 - - 63 - - - - doAction: - - - 1 - - 64 - - - - doAction: - - - 1 - - 65 - - - - doAction: - - - 1 - - 66 - - - - four - - - - 67 - - - - doAction: - - - 1 - - 68 - - - - five - - - - 69 - - - - doAction: - - - 1 - - 70 - - - - six - - - - 71 - - - - doAction: - - - 1 - - 72 - - - - seven - - - - 73 - - - - doAction: - - - 1 - - 74 - - - - eight - - - - 75 - - - - doAction: - - - 1 - - 76 - - - - doAction: - - - 1 - - 77 - - - - mute - - - - 80 - - - - doAction: - - - 7 - - 81 - - - - speaker - - - - 82 - - - - doAction: - - - 7 - - 83 - - - - contacts - - - - 84 - - - - doAction: - - - 7 - - 85 - - - - peerName - - - - 89 - - - - peerNumber - - - - 90 - - - - callDuration - - - - 91 - - - - status - - - - 94 - - - - - YES - - 0 - - YES - - - - - - -1 - - - RmlsZSdzIE93bmVyA - - - -2 - - - - - 2 - - - YES - - - - - - 9 - - - YES - - - - - - - - - - - - 10 - - - peerName - - - 11 - - - peerNumber - - - 12 - - - duration - - - 26 - - - YES - - - - - - - - controls - - - 13 - - - speaker - - - 17 - - - dialer - - - 18 - - - end - - - 16 - - - mute - - - 15 - - - contacts - - - 27 - - - YES - - - - - - - - - - - - - - - - - pad - - - 28 - - - end - - - 29 - - - close - - - 30 - - - 1 - - - 31 - - - start - - - 32 - - - 9 - - - 33 - - - 8 - - - 34 - - - 7 - - - 35 - - - 4 - - - 36 - - - 5 - - - 37 - - - 6 - - - 38 - - - 3 - - - 39 - - - 2 - - - 40 - - - hash - - - 41 - - - 0 - - - 92 - - - - - 93 - - - status - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 10.IBPluginDependency - 11.IBPluginDependency - 12.IBPluginDependency - 13.IBPluginDependency - 15.IBPluginDependency - 16.IBPluginDependency - 17.IBPluginDependency - 18.IBPluginDependency - 2.IBEditorWindowLastContentRect - 2.IBPluginDependency - 26.IBPluginDependency - 27.IBPluginDependency - 28.IBPluginDependency - 29.IBPluginDependency - 30.IBPluginDependency - 31.IBPluginDependency - 32.IBPluginDependency - 33.IBPluginDependency - 34.IBPluginDependency - 35.IBPluginDependency - 36.IBPluginDependency - 37.IBPluginDependency - 38.IBPluginDependency - 39.IBPluginDependency - 40.IBPluginDependency - 41.IBPluginDependency - 9.IBPluginDependency - 92.IBPluginDependency - 93.IBPluginDependency - - - YES - IncallViewController - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{528, 218}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - YES - - - YES - - - - - YES - - YES - - - YES - - - - 94 - - - - YES - - IncallViewController - UIViewController - - doAction: - id - - - YES - - YES - callDuration - close - contacts - controlSubView - dialer - eight - end - five - four - hash - mute - nine - one - padSubView - peerName - peerNumber - phoneviewDelegate - seven - six - speaker - star - status - three - two - zero - - - YES - UILabel - UIButton - UIButton - UIView - UIButton - UIButton - UIButton - UIButton - UIButton - UIButton - UIButton - UIButton - UIButton - UIView - UILabel - UILabel - id - UIButton - UIButton - UIButton - UIButton - UILabel - UIButton - UIButton - UIButton - - - - IBProjectSource - Classes/IncallViewController.h - - - - - 0 - ../linphone.xcodeproj - 3 - 3.1 - - diff --git a/Classes/PhoneViewController.h b/Classes/PhoneViewController.h index 9b75bd394..33bf386da 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -23,6 +23,7 @@ @protocol PhoneViewControllerDelegate -(void)setPhoneNumber:(NSString*)number; +-(void)setPhoneNumber:(NSString*)number withDisplayName:(NSString*) name; -(void)dismissIncallView; -(void)displayStatus:(NSString*) message; @end @@ -33,6 +34,15 @@ @private //UI definition UITextField* address; + NSString* displayName; + + UIView* incallView; + UILabel* callDuration; + UIButton* mute; + UIButton* speaker; + UILabel* peerLabel; + NSTimer *durationRefreasher; + UIButton* call; UIButton* hangup; @@ -53,6 +63,10 @@ UIButton* hash; UIButton* back; + + bool isMuted; + bool isSpeaker; + /* * lib linphone main context */ @@ -65,6 +79,13 @@ @property (nonatomic, retain) IBOutlet UIButton* hangup; @property (nonatomic, retain) IBOutlet UILabel* status; +@property (nonatomic, retain) IBOutlet UIView* incallView; +@property (nonatomic, retain) IBOutlet UILabel* callDuration; +@property (nonatomic, retain) IBOutlet UIButton* mute; +@property (nonatomic, retain) IBOutlet UIButton* speaker; +@property (nonatomic, retain) IBOutlet UILabel* peerLabel; + + @property (nonatomic, retain) IBOutlet UIButton* one; @property (nonatomic, retain) IBOutlet UIButton* two; @property (nonatomic, retain) IBOutlet UIButton* three; @@ -102,7 +123,11 @@ - (IBAction)doKeyPadUp:(id)sender; +-(void) muteAction:(bool) value; +-(void) speakerAction:(bool) value; + -(void) dismissAlertDialog:(UIAlertView*)alertView; + @end diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 82221e25a..faee724f2 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -31,6 +31,12 @@ @synthesize hangup; @synthesize status; +@synthesize incallView; +@synthesize callDuration; +@synthesize mute; +@synthesize speaker; +@synthesize peerLabel; + @synthesize one; @synthesize two; @synthesize three; @@ -48,6 +54,14 @@ -(void)setPhoneNumber:(NSString*)number { [address setText:number]; + if (displayName) { + [displayName release]; + displayName=nil; + } +} +-(void)setPhoneNumber:(NSString*)number withDisplayName:(NSString*) name { + [self setPhoneNumber:number]; + displayName = name; } -(void)dismissIncallView { @@ -59,25 +73,42 @@ if (sender == call) { if (!linphone_core_in_call(mCore)) { - const char* lCallee = [[address text] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - linphone_core_invite(mCore,lCallee) ; - } - if (linphone_core_inc_invite_pending(mCore)) { - linphone_core_accept_call(mCore,NULL); + if ([address.text length] == 0) return; //just return + if ([address.text hasPrefix:@"sip:"]) { + linphone_core_invite(mCore, [address.text cStringUsingEncoding:[NSString defaultCStringEncoding]]); + } else { + char normalizedUserName[256]; + LinphoneProxyConfig* proxyCfg; + //get default proxy + linphone_core_get_default_proxy(mCore,&proxyCfg); + NSString* toUserName = [NSString stringWithString:[address text]]; + linphone_proxy_config_normalize_number(proxyCfg,[toUserName cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName)); + LinphoneAddress* tmpAddress = linphone_address_new(linphone_core_get_identity(mCore)); + linphone_address_set_username(tmpAddress,normalizedUserName); + linphone_address_set_display_name(tmpAddress,displayName?[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]:nil); + linphone_core_invite(mCore,linphone_address_as_string(tmpAddress)) ; + linphone_address_destroy(tmpAddress); + } + } else if (linphone_core_inc_invite_pending(mCore)) { + linphone_core_accept_call(mCore,NULL); + UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_None; + AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute + , sizeof (audioRouteOverride) + , &audioRouteOverride); + } //Cancel audio route redirection - UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_None; - AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute - , sizeof (audioRouteOverride) - , &audioRouteOverride); - - } else if (sender == hangup) { - linphone_core_terminate_call(mCore,NULL); - } + linphone_core_terminate_call(mCore,NULL); + } else if (sender == mute) { + [self muteAction:!isMuted]; + + } else if (sender == speaker) { + [self speakerAction:!isSpeaker]; + } } - + //implements keypad behavior -(IBAction) doKeyPad:(id)sender { if (!linphone_core_in_call(mCore)) { @@ -200,14 +231,6 @@ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; - if (myIncallViewController == nil) { - myIncallViewController = [[IncallViewController alloc] initWithNibName:@"IncallViewController" bundle:[NSBundle mainBundle]]; - [myIncallViewController setPhoneviewDelegate:self]; - - } - - - } @@ -245,6 +268,17 @@ [alertView dismissWithClickedButtonIndex:0 animated:TRUE]; } + +-(void)updateCallDuration { + int lDuration = linphone_core_get_current_call_duration(mCore); + if (lDuration < 60) { + [callDuration setText:[NSString stringWithFormat: @"%i s", lDuration]]; + } else { + [callDuration setText:[NSString stringWithFormat: @"%i:%i", lDuration/60,lDuration - 60 *(lDuration/60)]]; + } +} + + - (void)dealloc { [address dealloc]; [call dealloc]; @@ -295,10 +329,43 @@ break; case GSTATE_CALL_IN_CONNECTED: case GSTATE_CALL_OUT_CONNECTED: { + [self muteAction:false]; + [self speakerAction:false]; + + const LinphoneAddress* callAddress = linphone_core_get_remote_uri(mCore); + const char* callDisplayName = linphone_address_get_display_name(callAddress)?linphone_address_get_display_name(callAddress):""; + if (callDisplayName && callDisplayName[0] != '\000') { + + [peerLabel setText:[NSString stringWithCString:callDisplayName length:strlen(callDisplayName)]]; + } else { + const char* username = linphone_address_get_username(callAddress)!=0?linphone_address_get_username(callAddress):""; + [peerLabel setText:[NSString stringWithCString:username length:strlen(username)]]; + } + // start scheduler + durationRefreasher = [NSTimer scheduledTimerWithTimeInterval:1 + target:self + selector:@selector(updateCallDuration) + userInfo:nil + repeats:YES]; + [address setHidden:true]; + [incallView setHidden:false]; + [call setEnabled:false]; + break; } case GSTATE_CALL_END: { + [address setHidden:false]; + [incallView setHidden:true]; + [call setEnabled:true]; + + if (durationRefreasher != nil) { + [ durationRefreasher invalidate]; + durationRefreasher=nil; + } + [peerLabel setText:@""]; + [callDuration setText:@""]; + break; } default: @@ -307,5 +374,35 @@ } +-(void) muteAction:(bool) value { + linphone_core_mute_mic(mCore,value); + if (value) { + [mute setImage:[UIImage imageNamed:@"mic_muted.png"] forState:UIControlStateNormal]; + } else { + [mute setImage:[UIImage imageNamed:@"mic_active.png"] forState:UIControlStateNormal]; + } + isMuted=value; + // swithc buttun state +}; + +-(void) speakerAction:(bool) value { + if (value) { + //redirect audio to speaker + UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; + AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute + , sizeof (audioRouteOverride) + , &audioRouteOverride); + [speaker setImage:[UIImage imageNamed:@"Speaker-32-on.png"] forState:UIControlStateNormal]; + } else { + //Cancel audio route redirection + UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_None; + AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute + , sizeof (audioRouteOverride) + , &audioRouteOverride); + [speaker setImage:[UIImage imageNamed:@"Speaker-32-off.png"] forState:UIControlStateNormal]; + } + isSpeaker=value; + +}; @end diff --git a/Classes/PhoneViewController.xib b/Classes/PhoneViewController.xib index 0f0bcb483..3812cea78 100644 --- a/Classes/PhoneViewController.xib +++ b/Classes/PhoneViewController.xib @@ -8,7 +8,7 @@ 353.00 YES - + YES @@ -37,19 +37,103 @@ 292 YES - + - 292 - {{18, -6}, {282, 49}} - - - 3 - MSAwAA - - 2 + -2147483356 + + YES + + + 292 + {320, 40} + + NO + YES + NO + who + + 1 + MCAwIDAAA + + + 1 + 1.000000e+01 + 1 + + + + 292 + {{98, 46}, {124, 21}} + + NO + YES + NO + how long + + + 1 + 1.000000e+01 + 1 + + + + 292 + {{241, 38}, {72, 37}} + + NO + NO + 0 + 0 + + Helvetica-Bold + 1.500000e+01 + 16 + + + 3 + MQA + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + 3 + MC41AA + + + NSImage + Speaker-32-off.png + + + + + 292 + {{0, 38}, {72, 37}} + + NO + NO + 0 + 0 + + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + NSImage + mic_active.png + - NO + {320, 90} + + + 1 + MC45MDE5NjA3OSAwLjkwMTk2MDc5IDAuOTAxOTYwNzkAA + NO @@ -61,24 +145,14 @@ NO 0 0 - - Helvetica-Bold - 1.500000e+01 - 16 - + 1 - - 3 - MQA - + 1 MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - 3 - MC41AA - + NSImage green.png @@ -93,10 +167,7 @@ YES NO status - - 1 - MCAwIDAAA - + 1 1.000000e+01 @@ -104,7 +175,7 @@ 292 - {{213, 89}, {107, 60}} + {{213, 90}, {107, 60}} NO NO @@ -123,7 +194,7 @@ 292 - {{0, 149}, {107, 60}} + {{0, 150}, {107, 60}} NO NO @@ -142,7 +213,7 @@ 292 - {{107, 149}, {106, 60}} + {{107, 150}, {106, 60}} NO NO @@ -161,7 +232,7 @@ 292 - {{213, 149}, {107, 60}} + {{213, 150}, {107, 60}} NO NO @@ -180,7 +251,7 @@ 292 - {{0, 209}, {107, 60}} + {{0, 210}, {107, 60}} NO NO @@ -199,7 +270,7 @@ 292 - {{213, 209}, {107, 60}} + {{213, 210}, {107, 60}} NO NO @@ -218,7 +289,7 @@ 292 - {{107, 89}, {106, 60}} + {{107, 90}, {106, 60}} NO NO @@ -237,7 +308,7 @@ 292 - {{0, 89}, {107, 60}} + {{0, 90}, {107, 60}} 1 @@ -260,7 +331,7 @@ 292 - {{0, 269}, {107, 60}} + {{0, 270}, {107, 60}} NO NO @@ -279,7 +350,7 @@ 292 - {{107, 269}, {106, 60}} + {{107, 270}, {106, 60}} NO NO @@ -298,7 +369,7 @@ 292 - {{213, 269}, {107, 60}} + {{213, 270}, {107, 60}} NO NO @@ -317,7 +388,7 @@ 292 - {{107, 209}, {106, 60}} + {{107, 210}, {106, 60}} NO NO @@ -336,7 +407,7 @@ 292 - {{160, 333}, {160, 60}} + {{160, 331}, {160, 60}} NO NO @@ -369,7 +440,9 @@ 3 MAA - + + 2 + Helvetica @@ -675,6 +748,64 @@ 110 + + + incallView + + + + 119 + + + + peerLabel + + + + 120 + + + + callDuration + + + + 121 + + + + speaker + + + + 123 + + + + doAction: + + + 7 + + 124 + + + + mute + + + + 125 + + + + doAction: + + + 7 + + 126 + @@ -712,7 +843,6 @@ YES - @@ -729,6 +859,7 @@ + @@ -798,15 +929,6 @@ Call - - 104 - - - YES - - - AddressView - 35 @@ -823,6 +945,43 @@ Address + + 114 + + + YES + + + + + + + inCall + + + 117 + + + speaker + + + 118 + + + mute + + + 116 + + + duration + + + 115 + + + display + @@ -834,8 +993,14 @@ 1.IBEditorWindowLastContentRect 1.IBPluginDependency 1.IBUserGuides - 104.IBPluginDependency 107.IBPluginDependency + 114.IBEditorWindowLastContentRect + 114.IBPluginDependency + 114.IBUserGuides + 115.IBPluginDependency + 116.IBPluginDependency + 117.IBPluginDependency + 118.IBPluginDependency 29.IBPluginDependency 30.IBPluginDependency 31.IBPluginDependency @@ -867,6 +1032,22 @@ 4.100000e+02 1 + + + 9.000000e+01 + 1 + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{32, 282}, {320, 90}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + YES + + + 9.000000e+01 + 1 + com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -885,7 +1066,9 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{204, 440}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{41, 282}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -909,7 +1092,7 @@ - 113 + 126 @@ -939,15 +1122,20 @@ address back call + callDuration eight five four hangup hash + incallView + mute nine one + peerLabel seven six + speaker star status three @@ -959,14 +1147,19 @@ UITextField UIButton UIButton + UILabel UIButton UIButton UIButton UIButton UIButton + UIView UIButton UIButton UIButton + UILabel + UIButton + UIButton UIButton UIButton UILabel diff --git a/Classes/linphoneAppDelegate.m b/Classes/linphoneAppDelegate.m index 38d26fa03..7dfa67470 100644 --- a/Classes/linphoneAppDelegate.m +++ b/Classes/linphoneAppDelegate.m @@ -20,12 +20,10 @@ #import "PhoneViewController.h" #import "linphoneAppDelegate.h" #import "ContactPickerDelegate.h" -#import "IncallViewController.h" #import "AddressBook/ABPerson.h" #import #import #import "osip2/osip.h" -#import "FavoriteTableViewController.h" extern void ms_au_register_card(); //generic log handler for debug version void linphone_iphone_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){ @@ -48,8 +46,9 @@ void linphone_iphone_show(struct _LinphoneCore * lc) { //nop } void linphone_iphone_call_received(LinphoneCore *lc, const char *from){ - [((linphoneAppDelegate*) linphone_core_get_user_data(lc)) newIncomingCall:[[NSString alloc] initWithCString:from encoding:[NSString defaultCStringEncoding]]]; - + LinphoneAddress* fromAddr = linphone_address_new(from); + [((linphoneAppDelegate*) linphone_core_get_user_data(lc)) newIncomingCall:[[NSString alloc] initWithCString:linphone_address_get_username(fromAddr) encoding:[NSString defaultCStringEncoding]]]; + linphone_address_destroy(fromAddr); }; void linphone_iphone_general_state(LinphoneCore *lc, LinphoneGeneralState *gstate) { diff --git a/PhoneMainView.xib b/PhoneMainView.xib index c133e9bbf..7f9a4bd9a 100644 --- a/PhoneMainView.xib +++ b/PhoneMainView.xib @@ -48,32 +48,28 @@ - - - Dialer - - NSImage - linphone2.png - + + History + + History - PhoneViewController + CallHistoryTableViewController YES - - History - - history + + + + Dialer - CallHistoryTableViewController + PhoneViewController - @@ -83,8 +79,8 @@ + About - 0 @@ -326,6 +322,14 @@ CallHistoryTableViewController GenericTabViewController + + doAction: + id + + + clear + UIButton + IBProjectSource Classes/CallHistoryTableViewController.h @@ -379,15 +383,20 @@ address back call + callDuration eight five four hangup hash + incallView + mute nine one + peerLabel seven six + speaker star status three @@ -399,14 +408,19 @@ UITextField UIButton UIButton + UILabel UIButton UIButton UIButton UIButton UIButton + UIView UIButton UIButton UIButton + UILabel + UIButton + UIButton UIButton UIButton UILabel diff --git a/Resources/Speaker-32-off.png b/Resources/Speaker-32-off.png new file mode 100644 index 000000000..e93ae232f Binary files /dev/null and b/Resources/Speaker-32-off.png differ diff --git a/Resources/Speaker-32-on.png b/Resources/Speaker-32-on.png new file mode 100644 index 000000000..de8d4460e Binary files /dev/null and b/Resources/Speaker-32-on.png differ diff --git a/in_call.png b/Resources/in_call.png similarity index 100% rename from in_call.png rename to Resources/in_call.png diff --git a/out_call.png b/Resources/out_call.png similarity index 100% rename from out_call.png rename to Resources/out_call.png diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 081ef258a..4dd4b9267 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -26,8 +26,6 @@ 2242D91710D66BF300E9963F /* out_call.png in Resources */ = {isa = PBXBuildFile; fileRef = 2242D91510D66BF300E9963F /* out_call.png */; }; 2242D91A10D66C2100E9963F /* mic_active.png in Resources */ = {isa = PBXBuildFile; fileRef = 2242D91810D66C2100E9963F /* mic_active.png */; }; 2242D91B10D66C2100E9963F /* mic_muted.png in Resources */ = {isa = PBXBuildFile; fileRef = 2242D91910D66C2100E9963F /* mic_muted.png */; }; - 2242D9C310D68DFD00E9963F /* FavoriteTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2242D9C110D68DFD00E9963F /* FavoriteTableViewController.m */; }; - 2242D9C410D68DFD00E9963F /* FavoriteTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2242D9C210D68DFD00E9963F /* FavoriteTableViewController.xib */; }; 2242D9C910D691F900E9963F /* GenericTabViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2242D9C810D691F900E9963F /* GenericTabViewController.m */; }; 2245667810768B7300F10948 /* linphone2.png in Resources */ = {isa = PBXBuildFile; fileRef = 2245667710768B7300F10948 /* linphone2.png */; }; 2245667A10768B9000F10948 /* linphone.png in Resources */ = {isa = PBXBuildFile; fileRef = 2245667910768B9000F10948 /* linphone.png */; }; @@ -43,8 +41,8 @@ 22B5EFA310CE50BD00777D97 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */; }; 22B5EFE510CE5E5800777D97 /* ContactPickerDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */; }; 22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5F03410CE6B2F00777D97 /* AddressBook.framework */; }; - 22B5F1E110CFA3C700777D97 /* IncallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22B5F1E010CFA3C700777D97 /* IncallViewController.xib */; }; - 22B5F1EA10CFD55A00777D97 /* IncallViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22B5F1E810CFD55A00777D97 /* IncallViewController.m */; }; + 22E0A785111C1BA800B04932 /* Speaker-32-on.png in Resources */ = {isa = PBXBuildFile; fileRef = 22E0A783111C1BA800B04932 /* Speaker-32-on.png */; }; + 22E0A786111C1BA800B04932 /* Speaker-32-off.png in Resources */ = {isa = PBXBuildFile; fileRef = 22E0A784111C1BA800B04932 /* Speaker-32-off.png */; }; 22F2508E107141E100AC9B3F /* PhoneViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 22F2508C107141E100AC9B3F /* PhoneViewController.m */; }; 22F2508F107141E100AC9B3F /* PhoneViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22F2508D107141E100AC9B3F /* PhoneViewController.xib */; }; 22F254811073D99800AC9B3F /* ringback.wav in Resources */ = {isa = PBXBuildFile; fileRef = 22F254801073D99800AC9B3F /* ringback.wav */; }; @@ -188,13 +186,10 @@ 220FAD3010765B400068D98F /* libspeexdsp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libspeexdsp.a; path = "../liblinphone-sdk/armv6-apple-darwin/lib/libspeexdsp.a"; sourceTree = SOURCE_ROOT; }; 220FAE4A10767A6A0068D98F /* PhoneMainView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PhoneMainView.xib; sourceTree = ""; }; 2237D4081084D7A9001383EE /* oldphone-mono.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = "oldphone-mono.wav"; path = "rings/oldphone-mono.wav"; sourceTree = ""; }; - 2242D91410D66BF300E9963F /* in_call.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = in_call.png; sourceTree = ""; }; - 2242D91510D66BF300E9963F /* out_call.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = out_call.png; sourceTree = ""; }; + 2242D91410D66BF300E9963F /* in_call.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = in_call.png; path = Resources/in_call.png; sourceTree = ""; }; + 2242D91510D66BF300E9963F /* out_call.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = out_call.png; path = Resources/out_call.png; sourceTree = ""; }; 2242D91810D66C2100E9963F /* mic_active.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mic_active.png; path = ../linphone/pixmaps/mic_active.png; sourceTree = SOURCE_ROOT; }; 2242D91910D66C2100E9963F /* mic_muted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mic_muted.png; path = ../linphone/pixmaps/mic_muted.png; sourceTree = SOURCE_ROOT; }; - 2242D9C010D68DFD00E9963F /* FavoriteTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FavoriteTableViewController.h; sourceTree = ""; }; - 2242D9C110D68DFD00E9963F /* FavoriteTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FavoriteTableViewController.m; sourceTree = ""; }; - 2242D9C210D68DFD00E9963F /* FavoriteTableViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FavoriteTableViewController.xib; sourceTree = ""; }; 2242D9C710D691F900E9963F /* GenericTabViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenericTabViewController.h; sourceTree = ""; }; 2242D9C810D691F900E9963F /* GenericTabViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GenericTabViewController.m; sourceTree = ""; }; 2245667710768B7300F10948 /* linphone2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone2.png; path = ../linphone/pixmaps/linphone2.png; sourceTree = SOURCE_ROOT; }; @@ -215,9 +210,8 @@ 22B5EFE310CE5E5800777D97 /* ContactPickerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContactPickerDelegate.h; sourceTree = ""; }; 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContactPickerDelegate.m; sourceTree = ""; }; 22B5F03410CE6B2F00777D97 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; - 22B5F1E010CFA3C700777D97 /* IncallViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = IncallViewController.xib; sourceTree = ""; }; - 22B5F1E710CFD55A00777D97 /* IncallViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IncallViewController.h; sourceTree = ""; }; - 22B5F1E810CFD55A00777D97 /* IncallViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IncallViewController.m; sourceTree = ""; }; + 22E0A783111C1BA800B04932 /* Speaker-32-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Speaker-32-on.png"; path = "Resources/Speaker-32-on.png"; sourceTree = ""; }; + 22E0A784111C1BA800B04932 /* Speaker-32-off.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Speaker-32-off.png"; path = "Resources/Speaker-32-off.png"; sourceTree = ""; }; 22F2508B107141E100AC9B3F /* PhoneViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PhoneViewController.h; sourceTree = ""; }; 22F2508C107141E100AC9B3F /* PhoneViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhoneViewController.m; sourceTree = ""; }; 22F2508D107141E100AC9B3F /* PhoneViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PhoneViewController.xib; sourceTree = ""; }; @@ -270,15 +264,9 @@ 22F2508D107141E100AC9B3F /* PhoneViewController.xib */, 22B5EFE310CE5E5800777D97 /* ContactPickerDelegate.h */, 22B5EFE410CE5E5800777D97 /* ContactPickerDelegate.m */, - 22B5F1E710CFD55A00777D97 /* IncallViewController.h */, - 22B5F1E810CFD55A00777D97 /* IncallViewController.m */, - 22B5F1E010CFA3C700777D97 /* IncallViewController.xib */, 227BCDBF10D4004600FBFD76 /* CallHistoryTableViewController.h */, 227BCDC010D4004600FBFD76 /* CallHistoryTableViewController.m */, 227BCDC110D4004600FBFD76 /* CallHistoryTableViewController.xib */, - 2242D9C010D68DFD00E9963F /* FavoriteTableViewController.h */, - 2242D9C110D68DFD00E9963F /* FavoriteTableViewController.m */, - 2242D9C210D68DFD00E9963F /* FavoriteTableViewController.xib */, 2242D9C710D691F900E9963F /* GenericTabViewController.h */, 2242D9C810D691F900E9963F /* GenericTabViewController.m */, ); @@ -544,6 +532,8 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 22E0A783111C1BA800B04932 /* Speaker-32-on.png */, + 22E0A784111C1BA800B04932 /* Speaker-32-off.png */, 2242D91810D66C2100E9963F /* mic_active.png */, 2242D91910D66C2100E9963F /* mic_muted.png */, 2242D91410D66BF300E9963F /* in_call.png */, @@ -625,13 +615,13 @@ 22F51EF6107FA66500F98953 /* untitled.plist in Resources */, 2237D4091084D7A9001383EE /* oldphone-mono.wav in Resources */, 2273798810A48EF000526073 /* oldphone.wav in Resources */, - 22B5F1E110CFA3C700777D97 /* IncallViewController.xib in Resources */, 227BCDC310D4004600FBFD76 /* CallHistoryTableViewController.xib in Resources */, 2242D91610D66BF300E9963F /* in_call.png in Resources */, 2242D91710D66BF300E9963F /* out_call.png in Resources */, 2242D91A10D66C2100E9963F /* mic_active.png in Resources */, 2242D91B10D66C2100E9963F /* mic_muted.png in Resources */, - 2242D9C410D68DFD00E9963F /* FavoriteTableViewController.xib in Resources */, + 22E0A785111C1BA800B04932 /* Speaker-32-on.png in Resources */, + 22E0A786111C1BA800B04932 /* Speaker-32-off.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -646,9 +636,7 @@ 1D3623260D0F684500981E51 /* linphoneAppDelegate.m in Sources */, 22F2508E107141E100AC9B3F /* PhoneViewController.m in Sources */, 22B5EFE510CE5E5800777D97 /* ContactPickerDelegate.m in Sources */, - 22B5F1EA10CFD55A00777D97 /* IncallViewController.m in Sources */, 227BCDC210D4004600FBFD76 /* CallHistoryTableViewController.m in Sources */, - 2242D9C310D68DFD00E9963F /* FavoriteTableViewController.m in Sources */, 2242D9C910D691F900E9963F /* GenericTabViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0;