diff --git a/Classes/CallHistoryTableViewController.h b/Classes/CallHistoryTableViewController.h new file mode 100644 index 000000000..db06fa58e --- /dev/null +++ b/Classes/CallHistoryTableViewController.h @@ -0,0 +1,27 @@ +/* CallHistoryTableViewController.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 CallHistoryTableViewController : GenericTabViewController { + +} + +@end diff --git a/Classes/CallHistoryTableViewController.m b/Classes/CallHistoryTableViewController.m new file mode 100644 index 000000000..d3737b7c8 --- /dev/null +++ b/Classes/CallHistoryTableViewController.m @@ -0,0 +1,198 @@ +/* CallHistoryTableViewController.m + * + * 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 "CallHistoryTableViewController.h" + + +@implementation CallHistoryTableViewController + + + +/* +- (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; +} + + + +#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 * logs = linphone_core_get_call_logs(myLinphoneCore); + return ms_list_size(logs); +} + + +// 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]; + + } + + // Set up the cell... + LinphoneCallLog* callLogs = ms_list_nth_data(linphone_core_get_call_logs(myLinphoneCore), indexPath.row) ; + const char* username = linphone_address_get_username(callLogs->to)!=0?linphone_address_get_username(callLogs->to):""; + + [cell.textLabel setText:[[NSString alloc] initWithCString:username encoding:[NSString defaultCStringEncoding]]]; + + + NSString *path; + + if (callLogs->dir == LinphoneCallIncoming) { + path = [[NSBundle mainBundle] pathForResource:@"in_call" ofType:@"png"]; + + } else { + path = [[NSBundle mainBundle] pathForResource:@"out_call" ofType:@"png"]; + + } + UIImage *image = [UIImage imageWithContentsOfFile:path]; + cell.imageView.image = image; + cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; + return cell; +} + + +- (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]; + [tableView deselectRowAtIndexPath:indexPath animated:NO]; + + LinphoneCallLog* callLogs = ms_list_nth_data(linphone_core_get_call_logs(myLinphoneCore), indexPath.row) ; + const char* username = linphone_address_get_username(callLogs->to)!=0?linphone_address_get_username(callLogs->to):""; + [self.phoneControllerDelegate setPhoneNumber:[[NSString alloc] initWithCString:username encoding:[NSString defaultCStringEncoding]]]; + [self.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) { + // Delete the row from the data source + [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES]; + } + 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; +} +*/ + + +- (void)dealloc { + [super dealloc]; +} + + +@end + diff --git a/Classes/CallHistoryTableViewController.xib b/Classes/CallHistoryTableViewController.xib new file mode 100644 index 000000000..f68b21c32 --- /dev/null +++ b/Classes/CallHistoryTableViewController.xib @@ -0,0 +1,289 @@ + + + + 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 + 4.400000e+01 + 2.200000e+01 + + + + 292 + + YES + + + 292 + {314, 44} + + NO + YES + NO + Rencent Calls + + 1 + MCAwIDAAA + + + 1 + 1.000000e+01 + 1 + + + + 292 + {{238, 0}, {72, 37}} + + NO + NO + 0 + 0 + + Helvetica-Bold + 1.500000e+01 + 16 + + 1 + Clear + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + 3 + MC41AA + + + + {320, 44} + + + 1 + MC40OTgwMzkyMiAwLjQ5ODAzOTIyIDAuNDk4MDM5MjIAA + + NO + + + + + YES + + + view + + + + 5 + + + + dataSource + + + + 6 + + + + delegate + + + + 7 + + + + header + + + + 11 + + + + + YES + + 0 + + YES + + + + + + -1 + + + RmlsZSdzIE93bmVyA + + + -2 + + + + + 4 + + + + + 8 + + + YES + + + + + Header + + + 9 + + + + + 10 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 10.IBPluginDependency + 4.IBEditorWindowLastContentRect + 4.IBPluginDependency + 8.IBEditorWindowLastContentRect + 8.IBPluginDependency + 9.IBPluginDependency + + + YES + CallHistoryTableViewController + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{393, 486}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{520, 620}, {320, 44}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 11 + + + + YES + + CallHistoryTableViewController + GenericTabViewController + + IBProjectSource + Classes/CallHistoryTableViewController.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/ContactPickerDelegate.h b/Classes/ContactPickerDelegate.h new file mode 100644 index 000000000..63708a46b --- /dev/null +++ b/Classes/ContactPickerDelegate.h @@ -0,0 +1,33 @@ +/* ContactPickerDelegate.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 +#import "PhoneViewController.h" +#import "linphoneAppDelegate.h" + + +@interface ContactPickerDelegate : NSObject { + id phoneControllerDelegate; + id linphoneDelegate; +} + +@property (nonatomic, retain) id phoneControllerDelegate; +@property (nonatomic, retain) id linphoneDelegate; + +@end diff --git a/Classes/ContactPickerDelegate.m b/Classes/ContactPickerDelegate.m new file mode 100644 index 000000000..b66a5db09 --- /dev/null +++ b/Classes/ContactPickerDelegate.m @@ -0,0 +1,51 @@ +/* ContactPickerDelegate.m + * + * 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 "ContactPickerDelegate.h" + + +@implementation ContactPickerDelegate +@synthesize phoneControllerDelegate; +@synthesize linphoneDelegate; + + +- (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 *phoneNumber = (NSString *)ABMultiValueCopyValueAtIndex(multiValue, valueIdx); + [phoneControllerDelegate setPhoneNumber:phoneNumber]; + + [linphoneDelegate selectDialerTab]; + return false; +} + +- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker { + [linphoneDelegate selectDialerTab]; +} + +@end diff --git a/Classes/FavoriteTableViewController.h b/Classes/FavoriteTableViewController.h new file mode 100644 index 000000000..768d6b662 --- /dev/null +++ b/Classes/FavoriteTableViewController.h @@ -0,0 +1,36 @@ +/* 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 new file mode 100644 index 000000000..0cb53a688 --- /dev/null +++ b/Classes/FavoriteTableViewController.m @@ -0,0 +1,242 @@ +/* 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 new file mode 100644 index 000000000..d24219858 --- /dev/null +++ b/Classes/FavoriteTableViewController.xib @@ -0,0 +1,382 @@ + + + + 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/GenericTabViewController.h b/Classes/GenericTabViewController.h new file mode 100644 index 000000000..1ce13680a --- /dev/null +++ b/Classes/GenericTabViewController.h @@ -0,0 +1,36 @@ +/* GenericTabViewController.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 +#include "linphonecore.h" +#import "PhoneViewController.h" +#import "linphoneAppDelegate.h" + +@interface GenericTabViewController : UITableViewController { + LinphoneCore* myLinphoneCore; + id phoneControllerDelegate; + id linphoneDelegate; + IBOutlet UIView* header; +} +-(void) setLinphoneCore:(LinphoneCore*) lc; +@property (nonatomic, retain) id phoneControllerDelegate; +@property (nonatomic, retain) id linphoneDelegate; +@property (nonatomic, retain) IBOutlet UIView* header; +@end + diff --git a/Classes/GenericTabViewController.m b/Classes/GenericTabViewController.m new file mode 100644 index 000000000..3aed6191f --- /dev/null +++ b/Classes/GenericTabViewController.m @@ -0,0 +1,49 @@ +/* GenericTabViewController.c + * + * 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 "GenericTabViewController.h" + + +@implementation GenericTabViewController +@synthesize phoneControllerDelegate; +@synthesize linphoneDelegate; +@synthesize header; + + +- (void)viewDidLoad { + [super viewDidLoad]; + self.tableView.tableHeaderView=header; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + [self.tableView reloadData]; +} + +-(void) setLinphoneCore:(LinphoneCore*) lc { + myLinphoneCore = lc; +} + +- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { + + [self tableView:tableView didSelectRowAtIndexPath:indexPath]; +} + +@end + diff --git a/Classes/IncallViewController.h b/Classes/IncallViewController.h new file mode 100644 index 000000000..9a5771276 --- /dev/null +++ b/Classes/IncallViewController.h @@ -0,0 +1,102 @@ +/* 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 new file mode 100644 index 000000000..73493fca2 --- /dev/null +++ b/Classes/IncallViewController.m @@ -0,0 +1,243 @@ +/* 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 new file mode 100644 index 000000000..ea7013b59 --- /dev/null +++ b/Classes/IncallViewController.xib @@ -0,0 +1,1315 @@ + + + + 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 df951dd74..0748788ea 100644 --- a/Classes/PhoneViewController.h +++ b/Classes/PhoneViewController.h @@ -20,15 +20,21 @@ #import #import "linphonecore.h" +@protocol PhoneViewControllerDelegate +-(void)setPhoneNumber:(NSString*)number; +-(void)dismissIncallView; +-(void)displayStatus:(NSString*) message; +@end +@class IncallViewController; -@interface PhoneViewController : UIViewController { +@interface PhoneViewController : UIViewController { @private //UI definition UITextField* address; UIButton* call; - UIButton* cancel; + UILabel* status; //key pad @@ -45,16 +51,16 @@ UIButton* zero; UIButton* hash; + UIButton* back; /* * lib linphone main context */ LinphoneCore* mCore; - int traceLevel; + IncallViewController *myIncallViewController; } @property (nonatomic, retain) IBOutlet UITextField* address; @property (nonatomic, retain) IBOutlet UIButton* call; -@property (nonatomic, retain) IBOutlet UIButton* cancel; @property (nonatomic, retain) IBOutlet UILabel* status; @property (nonatomic, retain) IBOutlet UIButton* one; @@ -70,19 +76,21 @@ @property (nonatomic, retain) IBOutlet UIButton* zero; @property (nonatomic, retain) IBOutlet UIButton* hash; -/********************************** - * liblinphone initialization method - **********************************/ --(void) startlibLinphone; +@property (nonatomic, retain) IBOutlet UIButton* back; + + /* - * liblinphone scheduling method; + * Handle call state change from linphone */ --(void) iterate; +-(void) callStateChange:(LinphoneGeneralState*) state; + +-(void) setLinphoneCore:(LinphoneCore*) lc; /******************** * UI method handlers ********************/ +-(void)doKeyZeroLongPress; //method to handle cal/hangup events - (IBAction)doAction:(id)sender; @@ -90,6 +98,9 @@ // method to handle keypad event - (IBAction)doKeyPad:(id)sender; +- (IBAction)doKeyPadUp:(id)sender; + +-(void) dismissAlertDialog:(UIAlertView*)alertView; + --(PayloadType*) findPayload:(NSString*)type withRate:(int)rate from:(const MSList*)list; @end diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 639685e7f..1caf46a56 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -23,58 +23,11 @@ #import -//generic log handler for debug version -void linphone_iphone_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){ - NSString* format = [[NSString alloc] initWithCString:fmt encoding:[NSString defaultCStringEncoding]]; - NSLogv(format,args); - [format release]; -} - -//Error/warning log handler -void linphone_iphone_log(struct _LinphoneCore * lc, const char * message) { - NSLog([NSString stringWithCString:message length:strlen(message)]); -} -//status -void linphone_iphone_display_status(struct _LinphoneCore * lc, const char * message) { - PhoneViewController* lPhone = linphone_core_get_user_data(lc); - [lPhone.status setText:[NSString stringWithCString:message length:strlen(message)]]; -} - -void linphone_iphone_show(struct _LinphoneCore * lc) { - //nop -} -void linphone_iphone_call_received(LinphoneCore *lc, const char *from){ - //redirect audio to speaker - UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; - - AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute - , sizeof (audioRouteOverride) - , &audioRouteOverride); -}; - -LinphoneCoreVTable linphonec_vtable = { -.show =(ShowInterfaceCb) linphone_iphone_show, -.inv_recv = linphone_iphone_call_received, -.bye_recv = NULL, -.notify_recv = NULL, -.new_unknown_subscriber = NULL, -.auth_info_requested = NULL, -.display_status = linphone_iphone_display_status, -.display_message=linphone_iphone_log, -.display_warning=linphone_iphone_log, -.display_url=NULL, -.display_question=(DisplayQuestionCb)NULL, -.text_received=NULL, -.general_state=NULL, -.dtmf_received=NULL -}; - @implementation PhoneViewController @synthesize address ; @synthesize call; -@synthesize cancel; @synthesize status; @synthesize one; @@ -90,6 +43,15 @@ LinphoneCoreVTable linphonec_vtable = { @synthesize zero; @synthesize hash; +@synthesize back; + +-(void)setPhoneNumber:(NSString*)number { + [address setText:number]; +} + +-(void)dismissIncallView { + [self dismissModalViewControllerAnimated:true]; +} //implements call/cancel button behavior -(IBAction) doAction:(id)sender { @@ -108,44 +70,15 @@ LinphoneCoreVTable linphonec_vtable = { AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute , sizeof (audioRouteOverride) , &audioRouteOverride); - } else if (sender == cancel) { - linphone_core_terminate_call(mCore,NULL); + + } } //implements keypad behavior -(IBAction) doKeyPad:(id)sender { - if (linphone_core_in_call(mCore)) { - //incall behavior - if (sender == one) { - linphone_core_send_dtmf(mCore,'1'); - } else if (sender == two) { - linphone_core_send_dtmf(mCore,'2'); - } else if (sender == three) { - linphone_core_send_dtmf(mCore,'3'); - } else if (sender == four) { - linphone_core_send_dtmf(mCore,'4'); - } else if (sender == five) { - linphone_core_send_dtmf(mCore,'5'); - } else if (sender == six) { - linphone_core_send_dtmf(mCore,'6'); - } else if (sender == seven) { - linphone_core_send_dtmf(mCore,'7'); - } else if (sender == eight) { - linphone_core_send_dtmf(mCore,'8'); - } else if (sender == nine) { - linphone_core_send_dtmf(mCore,'9'); - } else if (sender == star) { - linphone_core_send_dtmf(mCore,'*'); - } else if (sender == zero) { - linphone_core_send_dtmf(mCore,'0'); - } else if (sender == hash) { - linphone_core_send_dtmf(mCore,'#'); - } else { - NSLog(@"unknown event from dial pad"); - } - } else { + if (!linphone_core_in_call(mCore)) { //outcall behavior //remove sip: if first digits if ([address.text isEqualToString:@"sip:"]) { @@ -174,15 +107,52 @@ LinphoneCoreVTable linphonec_vtable = { newAddress = [address.text stringByAppendingString:@"*"]; } else if (sender == zero) { newAddress = [address.text stringByAppendingString:@"0"]; + //start timer for + + [self performSelector:@selector(doKeyZeroLongPress) withObject:nil afterDelay:0.5]; } else if (sender == hash) { newAddress = [address.text stringByAppendingString:@"#"]; + } else if (sender == back) { + if ([address.text length] >0) { + newAddress = [address.text substringToIndex: [address.text length]-1]; + } } else { - NSLog(@"unknown event from diad pad"); + NSLog(@"unknown event from diad pad"); + return; + } + if (newAddress != nil) { + [address setText:newAddress]; } - [address setText:newAddress]; } } +//implements keypad up +-(IBAction) doKeyPadUp:(id)sender { + if (sender == zero) { + //cancel timer for + + [NSObject cancelPreviousPerformRequestsWithTarget:self + selector:@selector(doKeyZeroLongPress) + object:nil]; + } else { + NSLog(@"unknown up event from dial pad"); + } +} + +-(void)doKeyZeroLongPress { + NSString* newAddress = [[address.text substringToIndex: [address.text length]-1] stringByAppendingString:@"+"]; + [address setText:newAddress]; + +} + +-(void) setLinphoneCore:(LinphoneCore*) lc { + mCore = lc; + [myIncallViewController setLinphoneCore:mCore]; +} +-(void)displayStatus:(NSString*) message { + [status setText:message]; + if (myIncallViewController != nil) { + [myIncallViewController displayStatus:message]; + } +} /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. @@ -194,12 +164,20 @@ LinphoneCoreVTable linphonec_vtable = { } */ -/* + // 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]; + + } + + + } -*/ + /* // Override to allow orientations other than the default portrait orientation. @@ -230,186 +208,77 @@ LinphoneCoreVTable linphonec_vtable = { } -/************* - *lib linphone init method - */ --(void)startlibLinphone { - - //init audio session - NSError *setError = nil; - [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: &setError]; //must be call before linphone_core_init - - //get default config from bundle - NSBundle* myBundle = [NSBundle mainBundle]; - NSString* defaultConfigFile = [myBundle pathForResource:@"linphonerc"ofType:nil] ; -#if TARGET_IPHONE_SIMULATOR - NSDictionary *dictionary = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:NSFileImmutable]; - [[NSFileManager defaultManager] setAttributes:dictionary ofItemAtPath:defaultConfigFile error:nil]; -#endif - //log management - traceLevel = 9; - if (traceLevel > 0) { - //redirect all traces to the iphone log framework - linphone_core_enable_logs_with_cb(linphone_iphone_log_handler); - } - else { - linphone_core_disable_logs(); - } - - //register audio queue sound card - ms_au_register_card(); - - /* - * Initialize linphone core - */ - - mCore = linphone_core_new (&linphonec_vtable, [defaultConfigFile cStringUsingEncoding:[NSString defaultCStringEncoding]],self); - - // Set audio assets - const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - linphone_core_set_ring(mCore, lRing ); - const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - linphone_core_set_ringback(mCore, lRingBack); - - - //configure sip account - //get data from Settings bundle - NSString* accountNameUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"account_preference"]; - const char* identity = [accountNameUri cStringUsingEncoding:[NSString defaultCStringEncoding]]; - - NSString* accountPassword = [[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"]; - const char* password = [accountPassword cStringUsingEncoding:[NSString defaultCStringEncoding]]; - - NSString* proxyUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"proxy_preference"]; - const char* proxy = [proxyUri cStringUsingEncoding:[NSString defaultCStringEncoding]]; - - NSString* routeUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"route_preference"]; - const char* route = [routeUri cStringUsingEncoding:[NSString defaultCStringEncoding]]; - - if (([accountNameUri length] + [proxyUri length]) >8 ) { - //possible valid config detected - LinphoneProxyConfig* proxyCfg; - //clear auth info list - linphone_core_clear_all_auth_info(mCore); - //get default proxy - linphone_core_get_default_proxy(mCore,&proxyCfg); - boolean_t addProxy=false; - if (proxyCfg == NULL) { - //create new proxy - proxyCfg = linphone_proxy_config_new(); - addProxy = true; - } else { - linphone_proxy_config_edit(proxyCfg); - } - - // add username password - osip_from_t *from; - LinphoneAuthInfo *info; - osip_from_init(&from); - if (osip_from_parse(from,identity)==0){ - info=linphone_auth_info_new(from->url->username,NULL,password,NULL,NULL); - linphone_core_add_auth_info(mCore,info); - } - osip_from_free(from); - - // configure proxy entries - linphone_proxy_config_set_identity(proxyCfg,identity); - linphone_proxy_config_set_server_addr(proxyCfg,proxy); - if ([routeUri length] > 4) { - linphone_proxy_config_set_route(proxyCfg,route); - } - linphone_proxy_config_enable_register(proxyCfg,TRUE); - if (addProxy) { - linphone_core_add_proxy_config(mCore,proxyCfg); - //set to default proxy - linphone_core_set_default_proxy(mCore,proxyCfg); - } else { - linphone_proxy_config_done(proxyCfg); - } - - } - - //Configure Codecs - - PayloadType *pt; - //get codecs from linphonerc - const MSList *audioCodecs=linphone_core_get_audio_codecs(mCore); - - //read from setting bundle - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"speex_32k_preference"]) { - if(pt = [self findPayload:@"speex"withRate:32000 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"speex_16k_preference"]) { - if(pt = [self findPayload:@"speex"withRate:16000 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"speex_8k_preference"]) { - if(pt = [self findPayload:@"speex"withRate:8000 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"gsm_22k_preference"]) { - if(pt = [self findPayload:@"GSM"withRate:22050 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"gsm_11k_preference"]) { - if(pt = [self findPayload:@"GSM"withRate:11025 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"gsm_8k_preference"]) { - if(pt = [self findPayload:@"GSM"withRate:8000 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"pcmu_preference"]) { - if(pt = [self findPayload:@"PCMU"withRate:8000 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"pcma_preference"]) { - if(pt = [self findPayload:@"PCMA"withRate:8000 from:audioCodecs]) { - payload_type_set_enable(pt,TRUE); - } - } - - - // start scheduler - [NSTimer scheduledTimerWithTimeInterval:0.1 - target:self - selector:@selector(iterate) - userInfo:nil - repeats:YES]; +-(void) dismissAlertDialog:(UIAlertView*) alertView{ + [alertView dismissWithClickedButtonIndex:0 animated:TRUE]; } -//scheduling loop --(void) iterate { - linphone_core_iterate(mCore); -} - - (void)dealloc { [address dealloc]; [call dealloc]; - [cancel dealloc]; [status dealloc]; [super dealloc]; } --(PayloadType*) findPayload:(NSString*)type withRate:(int)rate from:(const MSList*)list { - const MSList *elem; - for(elem=list;elem!=NULL;elem=elem->next){ - PayloadType *pt=(PayloadType*)elem->data; - if ([type isEqualToString:[NSString stringWithCString:payload_type_get_mime(pt) length:strlen(payload_type_get_mime(pt))]] && rate==pt->clock_rate) { - return pt; +-(void) callStateChange:(LinphoneGeneralState*) state { + // /* states for GSTATE_GROUP_POWER */ + // GSTATE_POWER_OFF = 0, /* initial state */ + // GSTATE_POWER_STARTUP, + // GSTATE_POWER_ON, + // GSTATE_POWER_SHUTDOWN, + // /* states for GSTATE_GROUP_REG */ + // GSTATE_REG_NONE = 10, /* initial state */ + // GSTATE_REG_OK, + // GSTATE_REG_FAILED, + // /* states for GSTATE_GROUP_CALL */ + // GSTATE_CALL_IDLE = 20, /* initial state */ + // GSTATE_CALL_OUT_INVITE, + // GSTATE_CALL_OUT_CONNECTED, + // GSTATE_CALL_IN_INVITE, + // GSTATE_CALL_IN_CONNECTED, + // GSTATE_CALL_END, + // GSTATE_CALL_ERROR, + // GSTATE_INVALID + switch (state->new_state) { + case GSTATE_CALL_IN_INVITE: + case GSTATE_CALL_OUT_INVITE: { + //[myIncallViewController startCall]; + [self presentModalViewController: myIncallViewController animated:true]; + break; } + + case GSTATE_CALL_ERROR: { + NSString* lTitle= state->message!=nil?[NSString stringWithCString:state->message length:strlen(state->message)]: @"Error"; + NSString* lMessage=lTitle; + + + UIAlertView* error = [[UIAlertView alloc] initWithTitle:lTitle + message:lMessage + delegate:nil + cancelButtonTitle:nil + otherButtonTitles:nil]; + [error show]; + [self performSelector:@selector(dismissAlertDialog:) withObject:error afterDelay:1]; + [self performSelector:@selector(dismissIncallView) withObject:nil afterDelay:1]; + + } + break; + case GSTATE_CALL_IN_CONNECTED: + case GSTATE_CALL_OUT_CONNECTED: { + [myIncallViewController startCall]; + break; + } + + case GSTATE_CALL_END: { + //end off call, just dismiss Incall view + [self dismissIncallView]; + break; + } + default: + break; } - return nil; } + @end diff --git a/Classes/PhoneViewController.xib b/Classes/PhoneViewController.xib index f564b719f..13a9d9866 100644 --- a/Classes/PhoneViewController.xib +++ b/Classes/PhoneViewController.xib @@ -8,7 +8,7 @@ 353.00 YES - + YES @@ -31,352 +31,369 @@ IBFirstResponder - - - 292 - - YES - - - 292 - {{21, 20}, {280, 31}} - - NO - NO - 0 - sip: - 3 - - 3 - MAA - - 2 + + + + 292 + + YES + + + 292 + + YES + + + 292 + {{0, 20}, {227, 31}} + + NO + NO + 0 + + 3 + sip: + + 3 + MAA + + 2 + + + YES + 1.700000e+01 + + 3 + + + + 292 + {{231, 20}, {51, 32}} + + NO + NO + 0 + 0 + + Helvetica-Bold + 1.500000e+01 + 16 + + 1 + PC0gA + + 3 + MQA + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + 3 + MC41AA + + + + {{18, -6}, {282, 63}} + + + 3 + MSAwAA + + + NO + NO + + + + 292 + {{21, 312}, {72, 59}} + + NO + NO + 0 + 0 + + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + NSImage + green.png - YES - YES - 1.700000e+01 - - 3 - - - - 292 - {{21, 364}, {72, 59}} - - NO - NO - 0 - 0 - - Helvetica-Bold - 1.500000e+01 - 16 + + + 292 + {{0, 379}, {312, 21}} + + NO + YES + NO + status + + 1 + MCAwIDAAA + + + 1 + 1.000000e+01 - - 3 - MQA + + + 292 + {{217, 65}, {83, 51}} + + NO + NO + 0 + 0 + + 1 + 3 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + 292 + {{21, 124}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + 4 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + - - 3 - MC41AA + + + 292 + {{120, 124}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + 5 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + - - NSImage - green.png + + + 292 + {{217, 124}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + 6 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{21, 184}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + 7 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{217, 184}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + 9 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{120, 65}, {83, 51}} + + NO + NO + 0 + 0 + + 1 + 2 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{21, 65}, {83, 51}} + + NO + NO + 0 + 0 + + 1 + 1 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{21, 244}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + * + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{120, 246}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + 0+ + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{217, 244}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + # + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + + + + + 292 + {{120, 306}, {175, 65}} + + NO + NO + NO + + NSImage + linphone.png + + + + + 292 + {{118, 186}, {83, 52}} + + NO + NO + 0 + 0 + + 1 + 8 + + + 1 + MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA + + - - - 292 - {{226, 364}, {74, 59}} - - NO - NO - 0 - 0 - - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - NSImage - red.png - - - - - 292 - {{0, 431}, {312, 21}} - - NO - YES - NO - status - - 1 - MCAwIDAAA - - - 1 - 1.000000e+01 - - - - 292 - {{217, 117}, {83, 51}} - - NO - NO - 0 - 0 - - 1 - 3 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{21, 176}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - 4 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{120, 176}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - 5 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{217, 176}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - 6 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{21, 236}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - 7 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{120, 236}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - 8 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{217, 236}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - 9 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{120, 117}, {83, 51}} - - NO - NO - 0 - 0 - - 1 - 2 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{21, 117}, {83, 51}} - - NO - NO - 0 - 0 - - 1 - 1 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{21, 296}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - * - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{120, 298}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - 0 - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{217, 296}, {83, 52}} - - NO - NO - 0 - 0 - - 1 - # - - - 1 - MC4xOTYwNzg0MyAwLjMwOTgwMzkzIDAuNTIxNTY4NjYAA - - - - - - 292 - {{101, 358}, {117, 65}} - - NO - NO - NO - - NSImage - linphone.png - + {320, 460} + + + 1 + MCAwLjUwMTk2MDgxIDEAA + 5 - {320, 460} - - - 1 - MC4yMDMyNDkxNiAwLjQ2MDg0NzkxIDEAA - - 5 + @@ -398,14 +415,6 @@ 13 - - - cancel - - - - 14 - status @@ -431,15 +440,6 @@ 19 - - - doAction: - - - 7 - - 20 - view @@ -544,113 +544,139 @@ 54 + + + back + + + + 83 + doKeyPad: - 7 + 1 - 67 + 84 doKeyPad: - 7 + 1 - 68 + 85 doKeyPad: - 7 + 1 - 69 + 86 doKeyPad: - 7 + 1 - 70 + 87 doKeyPad: - 7 + 1 - 71 + 88 doKeyPad: - 7 + 1 - 72 + 89 doKeyPad: - 7 + 1 - 73 + 90 doKeyPad: - 7 + 1 - 74 + 91 doKeyPad: - 7 + 1 - 75 + 92 doKeyPad: - 7 + 1 - 76 + 93 doKeyPad: - 7 + 1 - 77 + 94 doKeyPad: + 1 + + 95 + + + + doKeyPadUp: + + 7 - 78 + 98 + + + + doKeyPad: + + + 1 + + 106 @@ -676,103 +702,41 @@ - 1 - + 80 + YES - - - - - - - - - - - - - - - - - + - 7 - - + 1 + + + YES + + + + + + + + + + + + + + + + + + - 4 - - - - - 6 - - - - - 5 - - - - - 29 - - - - - 30 - - - - - 31 - - - - - 33 - - - - - 34 - - - - - 35 - - - - - 36 - - - - - 37 - - - - - 38 - - - - - 39 - - - - - 40 - + 42 + @@ -781,8 +745,92 @@ - 42 - + 40 + + + + + 39 + + + + + 38 + + + + + 37 + + + + + 36 + + + + + 34 + + + + + 33 + + + + + 31 + + + + + 30 + + + + + 29 + + + + + 7 + + + + + 5 + + + Call + + + 104 + + + YES + + + + + AddressView + + + 4 + + + Address + + + 81 + + + back + + + 35 + @@ -795,6 +843,7 @@ -2.CustomClassName 1.IBEditorWindowLastContentRect 1.IBPluginDependency + 104.IBPluginDependency 29.IBPluginDependency 30.IBPluginDependency 31.IBPluginDependency @@ -810,8 +859,10 @@ 41.IBPluginDependency 42.IBPluginDependency 5.IBPluginDependency - 6.IBPluginDependency 7.IBPluginDependency + 80.IBEditorWindowLastContentRect + 80.IBPluginDependency + 81.IBPluginDependency YES @@ -836,6 +887,9 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{353, 469}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -858,7 +912,7 @@ - 79 + 106 @@ -872,11 +926,13 @@ YES doAction: doKeyPad: + doKeyPadUp: YES id id + id @@ -884,8 +940,8 @@ YES address + back call - cancel eight five four diff --git a/Classes/linphoneAppDelegate.h b/Classes/linphoneAppDelegate.h index 8d13d6c24..cf18657e5 100644 --- a/Classes/linphoneAppDelegate.h +++ b/Classes/linphoneAppDelegate.h @@ -17,21 +17,60 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #import - -@class linphone; +#import +#include"linphonecore.h" -@class PhoneViewController; +@protocol LinphoneTabManagerDelegate + +-(void)selectDialerTab; + +@end + +@class ContactPickerDelegate; +@class IncallViewController; +@class PhoneViewController; +@class CallHistoryTableViewController; +@class FavoriteTableViewController; + +@interface linphoneAppDelegate : NSObject { + UIWindow *window; + IBOutlet UITabBarController* myTabBarController; + IBOutlet ABPeoplePickerNavigationController* myPeoplePickerController; + IBOutlet PhoneViewController* myPhoneViewController; + CallHistoryTableViewController* myCallHistoryTableViewController; + FavoriteTableViewController* myFavoriteTableViewController; + + ContactPickerDelegate* myContactPickerDelegate; + + int traceLevel; + LinphoneCore* myLinphoneCore; + + +} +/********************************** + * liblinphone initialization method + **********************************/ +-(void) startlibLinphone; + +/* + * liblinphone scheduling method; + */ +-(void) iterate; + +-(void) newIncomingCall:(NSString*) from; + + +-(PayloadType*) findPayload:(NSString*)type withRate:(int)rate from:(const MSList*)list; + + +@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController; +@property (nonatomic, retain) ABPeoplePickerNavigationController* myPeoplePickerController; +@property (nonatomic, retain) IBOutlet PhoneViewController* myPhoneViewController; -@interface linphoneAppDelegate : NSObject { - UIWindow *window; - PhoneViewController *myViewController; - -} - -@property (nonatomic, retain) IBOutlet UIWindow *window; -@property (nonatomic, retain) IBOutlet PhoneViewController *myViewController; @end diff --git a/Classes/linphoneAppDelegate.m b/Classes/linphoneAppDelegate.m index 833c7ec47..c40247754 100644 --- a/Classes/linphoneAppDelegate.m +++ b/Classes/linphoneAppDelegate.m @@ -19,42 +19,332 @@ #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){ + NSString* format = [[NSString alloc] initWithCString:fmt encoding:[NSString defaultCStringEncoding]]; + NSLogv(format,args); + [format release]; +} + +//Error/warning log handler +void linphone_iphone_log(struct _LinphoneCore * lc, const char * message) { + NSLog([NSString stringWithCString:message length:strlen(message)]); +} +//status +void linphone_iphone_display_status(struct _LinphoneCore * lc, const char * message) { + PhoneViewController* lPhone = ((linphoneAppDelegate*) linphone_core_get_user_data(lc)).myPhoneViewController; + [lPhone displayStatus:[NSString stringWithCString:message length:strlen(message)]]; +} + +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]]]; + + +}; +void linphone_iphone_general_state(LinphoneCore *lc, LinphoneGeneralState *gstate) { + PhoneViewController* lPhone = ((linphoneAppDelegate*) linphone_core_get_user_data(lc)).myPhoneViewController; + [lPhone callStateChange:gstate]; +} + +LinphoneCoreVTable linphonec_vtable = { +.show =(ShowInterfaceCb) linphone_iphone_show, +.inv_recv = linphone_iphone_call_received, +.bye_recv = NULL, +.notify_recv = NULL, +.new_unknown_subscriber = NULL, +.auth_info_requested = NULL, +.display_status = linphone_iphone_display_status, +.display_message=linphone_iphone_log, +.display_warning=linphone_iphone_log, +.display_url=NULL, +.display_question=(DisplayQuestionCb)NULL, +.text_received=NULL, +.general_state=(GeneralStateChange)linphone_iphone_general_state, +.dtmf_received=NULL +}; + @implementation linphoneAppDelegate @synthesize window; -@synthesize myViewController; +@synthesize myTabBarController; +@synthesize myPeoplePickerController; +@synthesize myPhoneViewController; + + - (void)applicationDidFinishLaunching:(UIApplication *)application { - PhoneViewController *aViewController = [[PhoneViewController alloc] - initWithNibName:@"PhoneViewController" bundle:[NSBundle mainBundle]]; + //as defined in PhoneMainView.xib +#define DIALER_TAB_INDEX 2 +#define CONTACTS_TAB_INDEX 3 +#define HISTORY_TAB_INDEX 1 +#define FAVORITE_TAB_INDEX 0 +#define MORE_TAB_INDEX 4 - [self setMyViewController:aViewController]; - [aViewController release]; - - //offset the status bar - CGRect rect = myViewController.view.frame; - rect = CGRectOffset(rect, 0.0, 20.0); - myViewController.view.frame = rect; - [window addSubview:[myViewController view]]; + myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX]; + + myCallHistoryTableViewController = (CallHistoryTableViewController*)[myTabBarController.viewControllers objectAtIndex: HISTORY_TAB_INDEX]; + [myCallHistoryTableViewController setPhoneControllerDelegate:myPhoneViewController]; + [myCallHistoryTableViewController setLinphoneDelegate:self]; + + myFavoriteTableViewController = (FavoriteTableViewController*)[myTabBarController.viewControllers objectAtIndex: FAVORITE_TAB_INDEX]; + [myFavoriteTableViewController setPhoneControllerDelegate:myPhoneViewController]; + [myFavoriteTableViewController setLinphoneDelegate:self]; - //init lib linphone - [aViewController startlibLinphone] ; + //people picker delegates + myContactPickerDelegate = [[ContactPickerDelegate alloc] init]; + myContactPickerDelegate.phoneControllerDelegate=myPhoneViewController; + myContactPickerDelegate.linphoneDelegate=self; + //people picker + myPeoplePickerController = [[[ABPeoplePickerNavigationController alloc] init] autorelease]; + [myPeoplePickerController setDisplayedProperties:[NSArray arrayWithObject:[NSNumber numberWithInt:kABPersonPhoneProperty]]]; + [myPeoplePickerController setPeoplePickerDelegate:myContactPickerDelegate]; + //copy tab bar item + myPeoplePickerController.tabBarItem = [(UIViewController*)[myTabBarController.viewControllers objectAtIndex:CONTACTS_TAB_INDEX] tabBarItem]; + //insert contact controller + NSMutableArray* newArray = [NSMutableArray arrayWithArray:self.myTabBarController.viewControllers]; + [newArray replaceObjectAtIndex:CONTACTS_TAB_INDEX withObject:myPeoplePickerController]; + + [myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; + [myTabBarController setViewControllers:newArray animated:NO]; + + [window addSubview:myTabBarController.view]; + + [window makeKeyAndVisible]; + + [self startlibLinphone]; + + [myCallHistoryTableViewController setLinphoneCore: myLinphoneCore]; + [myFavoriteTableViewController setLinphoneCore: myLinphoneCore]; + [myPhoneViewController setLinphoneCore: myLinphoneCore]; + + +} +-(void)selectDialerTab { + [myTabBarController setSelectedIndex:DIALER_TAB_INDEX]; +} - [window makeKeyAndVisible]; +- (void)applicationWillTerminate:(UIApplication *)application { + linphone_core_destroy(myLinphoneCore); +} +- (void)dealloc { + [window release]; + [myPeoplePickerController release]; + [super dealloc]; +} + +/************* + *lib linphone init method + */ +-(void)startlibLinphone { + + //init audio session + NSError *setError = nil; + [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayAndRecord error: &setError]; //must be call before linphone_core_init + + //get default config from bundle + NSBundle* myBundle = [NSBundle mainBundle]; + NSString* defaultConfigFile = [myBundle pathForResource:@"linphonerc"ofType:nil] ; +#if TARGET_IPHONE_SIMULATOR + NSDictionary *dictionary = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:NSFileImmutable]; + [[NSFileManager defaultManager] setAttributes:dictionary ofItemAtPath:defaultConfigFile error:nil]; +#endif + //log management + traceLevel = 9; + if (traceLevel > 0) { + //redirect all traces to the iphone log framework + linphone_core_enable_logs_with_cb(linphone_iphone_log_handler); + } + else { + linphone_core_disable_logs(); + } + + //register audio queue sound card + ms_au_register_card(); + + /* + * Initialize linphone core + */ + + myLinphoneCore = linphone_core_new (&linphonec_vtable, [defaultConfigFile cStringUsingEncoding:[NSString defaultCStringEncoding]],self); + + // Set audio assets + const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + linphone_core_set_ring(myLinphoneCore, lRing ); + const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + linphone_core_set_ringback(myLinphoneCore, lRingBack); + + + //configure sip account + //get data from Settings bundle + NSString* accountNameUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"account_preference"]; + const char* identity = [accountNameUri cStringUsingEncoding:[NSString defaultCStringEncoding]]; + + NSString* accountPassword = [[NSUserDefaults standardUserDefaults] stringForKey:@"password_preference"]; + const char* password = [accountPassword cStringUsingEncoding:[NSString defaultCStringEncoding]]; + + NSString* proxyUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"proxy_preference"]; + const char* proxy = [proxyUri cStringUsingEncoding:[NSString defaultCStringEncoding]]; + + NSString* routeUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"route_preference"]; + const char* route = [routeUri cStringUsingEncoding:[NSString defaultCStringEncoding]]; + + if (([accountNameUri length] + [proxyUri length]) >8 ) { + //possible valid config detected + LinphoneProxyConfig* proxyCfg; + //clear auth info list + linphone_core_clear_all_auth_info(myLinphoneCore); + //get default proxy + linphone_core_get_default_proxy(myLinphoneCore,&proxyCfg); + boolean_t addProxy=false; + if (proxyCfg == NULL) { + //create new proxy + proxyCfg = linphone_proxy_config_new(); + addProxy = true; + } else { + linphone_proxy_config_edit(proxyCfg); + } + + // add username password + osip_from_t *from; + LinphoneAuthInfo *info; + osip_from_init(&from); + if (osip_from_parse(from,identity)==0){ + info=linphone_auth_info_new(from->url->username,NULL,password,NULL,NULL); + linphone_core_add_auth_info(myLinphoneCore,info); + } + osip_from_free(from); + + // configure proxy entries + linphone_proxy_config_set_identity(proxyCfg,identity); + linphone_proxy_config_set_server_addr(proxyCfg,proxy); + if ([routeUri length] > 4) { + linphone_proxy_config_set_route(proxyCfg,route); + } + linphone_proxy_config_enable_register(proxyCfg,TRUE); + if (addProxy) { + linphone_core_add_proxy_config(myLinphoneCore,proxyCfg); + //set to default proxy + linphone_core_set_default_proxy(myLinphoneCore,proxyCfg); + } else { + linphone_proxy_config_done(proxyCfg); + } + + } + + //Configure Codecs + + PayloadType *pt; + //get codecs from linphonerc + const MSList *audioCodecs=linphone_core_get_audio_codecs(myLinphoneCore); + + //read from setting bundle + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"speex_32k_preference"]) { + if(pt = [self findPayload:@"speex"withRate:32000 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"speex_16k_preference"]) { + if(pt = [self findPayload:@"speex"withRate:16000 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"speex_8k_preference"]) { + if(pt = [self findPayload:@"speex"withRate:8000 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"gsm_22k_preference"]) { + if(pt = [self findPayload:@"GSM"withRate:22050 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"gsm_11k_preference"]) { + if(pt = [self findPayload:@"GSM"withRate:11025 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"gsm_8k_preference"]) { + if(pt = [self findPayload:@"GSM"withRate:8000 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"pcmu_preference"]) { + if(pt = [self findPayload:@"PCMU"withRate:8000 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"pcma_preference"]) { + if(pt = [self findPayload:@"PCMA"withRate:8000 from:audioCodecs]) { + payload_type_set_enable(pt,TRUE); + } + } + + + // start scheduler + [NSTimer scheduledTimerWithTimeInterval:0.1 + target:self + selector:@selector(iterate) + userInfo:nil + repeats:YES]; } +-(void) newIncomingCall:(NSString*) from { + //redirect audio to speaker + UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker; + + AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute + , sizeof (audioRouteOverride) + , &audioRouteOverride); + + UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:@" %@ is calling you",from] + delegate:self cancelButtonTitle:@"Decline" destructiveButtonTitle:@"Answer" otherButtonTitles:nil]; + actionSheet.actionSheetStyle = UIActionSheetStyleDefault; + [actionSheet showFromTabBar:myTabBarController.tabBar]; + [actionSheet release]; + +} -- (void)dealloc { - [window release]; - [myViewController release]; - [super dealloc]; +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { + if (buttonIndex == 0 ) { + linphone_core_accept_call(myLinphoneCore,NULL); + } else { + linphone_core_terminate_call (myLinphoneCore,NULL); + } +} +//scheduling loop +-(void) iterate { + linphone_core_iterate(myLinphoneCore); +} + + +-(PayloadType*) findPayload:(NSString*)type withRate:(int)rate from:(const MSList*)list { + const MSList *elem; + for(elem=list;elem!=NULL;elem=elem->next){ + PayloadType *pt=(PayloadType*)elem->data; + if ([type isEqualToString:[NSString stringWithCString:payload_type_get_mime(pt) length:strlen(payload_type_get_mime(pt))]] && rate==pt->clock_rate) { + return pt; + } + } + return nil; + } diff --git a/PhoneMainView.xib b/PhoneMainView.xib index 557698096..a9588c6ae 100644 --- a/PhoneMainView.xib +++ b/PhoneMainView.xib @@ -8,6 +8,7 @@ 353.00 YES + YES @@ -44,6 +45,71 @@ NO + + + + + + Dialer + + NSImage + linphone2.png + + + + + PhoneViewController + + + + YES + + + Favorites + + + + FavoriteTableViewController + + + + History + + history + + + + CallHistoryTableViewController + + + + + + + 5 + + + + + + + 0 + + + + + + + + 266 + {{129, 330}, {163, 49}} + + 3 + MCAwAA + + NO + + @@ -64,6 +130,14 @@ 7 + + + myTabBarController + + + + 14 + @@ -98,6 +172,99 @@ + + 8 + + + YES + + + + + + + + + + + 9 + + + + + 11 + + + YES + + + + Contacts + + + 12 + + + + + 38 + + + YES + + + + dialer + + + 39 + + + + + 41 + + + YES + + + + history + + + 42 + + + + + 43 + + + YES + + + + more + + + 44 + + + + + 46 + + + YES + + + + + + 47 + + + @@ -106,17 +273,32 @@ YES -1.CustomClassName -2.CustomClassName + 11.IBPluginDependency + 12.IBPluginDependency 2.IBAttributePlaceholdersKey 2.IBEditorWindowLastContentRect 2.IBPluginDependency 2.UIWindow.visibleAtLaunch + 38.CustomClassName + 38.IBEditorWindowLastContentRect + 38.IBPluginDependency 4.CustomClassName 4.IBPluginDependency + 41.CustomClassName + 41.IBPluginDependency + 43.IBPluginDependency + 46.CustomClassName + 46.IBPluginDependency + 8.IBEditorWindowLastContentRect + 8.IBPluginDependency + 9.IBPluginDependency YES UIApplication UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin YES @@ -129,8 +311,19 @@ {{190, 156}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin + PhoneViewController + {{343, 544}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin linphoneAppDelegate com.apple.InterfaceBuilder.IBCocoaTouchPlugin + CallHistoryTableViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + FavoriteTableViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{11, 205}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -153,33 +346,126 @@ - 7 + 47 YES + + CallHistoryTableViewController + GenericTabViewController + + IBProjectSource + Classes/CallHistoryTableViewController.h + + + + FavoriteTableViewController + GenericTabViewController + + YES + + YES + doAddFavorite: + doEditFavorite: + + + YES + id + id + + + + add + UIButton + + + IBProjectSource + Classes/FavoriteTableViewController.h + + + + GenericTabViewController + UITableViewController + + YES + + YES + header + linphoneDelegate + phoneControllerDelegate + + + YES + UIView + id + id + + + + IBProjectSource + Classes/GenericTabViewController.h + + PhoneViewController UIViewController - doAction: - id + YES + + YES + doAction: + doKeyPad: + doKeyPadUp: + + + YES + id + id + id + YES YES address + back call cancel + eight + five + four + hash + nine + one + seven + six + star status + three + two + zero YES UITextField UIButton UIButton + UIButton + UIButton + UIButton + UIButton + UIButton + UIButton + UIButton + UIButton + UIButton + UIButton UILabel + UIButton + UIButton + UIButton @@ -194,12 +480,16 @@ YES YES - myViewController + myPeoplePickerController + myPhoneViewController + myTabBarController window YES + ABPeoplePickerNavigationController PhoneViewController + UITabBarController UIWindow diff --git a/in_call.png b/in_call.png new file mode 100644 index 000000000..d48369e6a Binary files /dev/null and b/in_call.png differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index f28af75ee..705ad8849 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -22,6 +22,13 @@ 220FAD3910765B400068D98F /* libspeexdsp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD3010765B400068D98F /* libspeexdsp.a */; }; 220FAE4B10767A6A0068D98F /* PhoneMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 220FAE4A10767A6A0068D98F /* PhoneMainView.xib */; }; 2237D4091084D7A9001383EE /* oldphone-mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = 2237D4081084D7A9001383EE /* oldphone-mono.wav */; }; + 2242D91610D66BF300E9963F /* in_call.png in Resources */ = {isa = PBXBuildFile; fileRef = 2242D91410D66BF300E9963F /* in_call.png */; }; + 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 */; }; 2245671D107699F700F10948 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2245671C107699F700F10948 /* Settings.bundle */; }; @@ -31,6 +38,13 @@ 2274401A106F31BD006EC466 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22744019106F31BD006EC466 /* CoreAudio.framework */; }; 2274402F106F335E006EC466 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2274402E106F335E006EC466 /* AudioToolbox.framework */; }; 2274550810700509006EC466 /* linphonerc in Resources */ = {isa = PBXBuildFile; fileRef = 2274550710700509006EC466 /* linphonerc */; }; + 227BCDC210D4004600FBFD76 /* CallHistoryTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 227BCDC010D4004600FBFD76 /* CallHistoryTableViewController.m */; }; + 227BCDC310D4004600FBFD76 /* CallHistoryTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 227BCDC110D4004600FBFD76 /* CallHistoryTableViewController.xib */; }; + 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 */; }; 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 */; }; @@ -174,6 +188,15 @@ 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; path = "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 = ""; }; + 2242D91810D66C2100E9963F /* mic_active.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mic_active.png; path = ../../pixmaps/mic_active.png; sourceTree = SOURCE_ROOT; }; + 2242D91910D66C2100E9963F /* mic_muted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = mic_muted.png; path = ../../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 = ../../pixmaps/linphone2.png; sourceTree = SOURCE_ROOT; }; 2245667910768B9000F10948 /* linphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone.png; path = ../../pixmaps/linphone.png; sourceTree = SOURCE_ROOT; }; 2245671C107699F700F10948 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; @@ -185,9 +208,19 @@ 22744043106F33FC006EC466 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 22744056106F9BC9006EC466 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 2274550710700509006EC466 /* linphonerc */ = {isa = PBXFileReference; explicitFileType = text; fileEncoding = 4; path = linphonerc; sourceTree = ""; }; + 227BCDBF10D4004600FBFD76 /* CallHistoryTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallHistoryTableViewController.h; sourceTree = ""; }; + 227BCDC010D4004600FBFD76 /* CallHistoryTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallHistoryTableViewController.m; sourceTree = ""; }; + 227BCDC110D4004600FBFD76 /* CallHistoryTableViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CallHistoryTableViewController.xib; sourceTree = ""; }; + 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; + 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 = ""; }; 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; name = PhoneViewController.xib; path = Classes/PhoneViewController.xib; sourceTree = ""; }; + 22F2508D107141E100AC9B3F /* PhoneViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PhoneViewController.xib; sourceTree = ""; }; 22F254801073D99800AC9B3F /* ringback.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = ringback.wav; path = ../../share/ringback.wav; sourceTree = SOURCE_ROOT; }; 22F255131073EEE600AC9B3F /* green.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = green.png; path = ../../pixmaps/green.png; sourceTree = SOURCE_ROOT; }; 22F255141073EEE600AC9B3F /* red.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = red.png; path = ../../pixmaps/red.png; sourceTree = SOURCE_ROOT; }; @@ -219,6 +252,8 @@ 220FAD3910765B400068D98F /* libspeexdsp.a in Frameworks */, 224567C2107B968500F10948 /* AVFoundation.framework in Frameworks */, 2273785E10A3703300526073 /* libmsiounit.a in Frameworks */, + 22B5EFA310CE50BD00777D97 /* AddressBookUI.framework in Frameworks */, + 22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -232,6 +267,20 @@ 1D3623250D0F684500981E51 /* linphoneAppDelegate.m */, 22F2508B107141E100AC9B3F /* PhoneViewController.h */, 22F2508C107141E100AC9B3F /* PhoneViewController.m */, + 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 */, ); path = Classes; sourceTree = ""; @@ -477,6 +526,8 @@ 2245671C107699F700F10948 /* Settings.bundle */, 224567C1107B968500F10948 /* AVFoundation.framework */, 22F51EF5107FA66500F98953 /* untitled.plist */, + 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */, + 22B5F03410CE6B2F00777D97 /* AddressBook.framework */, ); name = CustomTemplate; sourceTree = ""; @@ -493,13 +544,16 @@ 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + 2242D91810D66C2100E9963F /* mic_active.png */, + 2242D91910D66C2100E9963F /* mic_muted.png */, + 2242D91410D66BF300E9963F /* in_call.png */, + 2242D91510D66BF300E9963F /* out_call.png */, 2245667910768B9000F10948 /* linphone.png */, 2245667710768B7300F10948 /* linphone2.png */, 22F255131073EEE600AC9B3F /* green.png */, 22F255141073EEE600AC9B3F /* red.png */, 22F254801073D99800AC9B3F /* ringback.wav */, 22F2546F1073D95B00AC9B3F /* rings */, - 22F2508D107141E100AC9B3F /* PhoneViewController.xib */, 8D1107310486CEB800E47090 /* linphone-Info.plist */, 2274550710700509006EC466 /* linphonerc */, 220FAE4A10767A6A0068D98F /* PhoneMainView.xib */, @@ -571,6 +625,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 */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -584,6 +645,11 @@ 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 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; }; @@ -606,10 +672,9 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", - "\"$(SRCROOT)/../../liblinphone-sdk/armv6-apple-darwin/lib/mediastreamer/plugins\"", ); "LIBRARY_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/armv6-apple-darwin/lib\"/**"; - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/i386-apple-darwin/lib\""; + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/i386-apple-darwin/lib\"/**"; PRODUCT_NAME = linphone; SDKROOT = iphoneos3.0; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; @@ -629,10 +694,9 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", - "\"$(SRCROOT)/../../liblinphone-sdk/armv6-apple-darwin/lib/mediastreamer/plugins\"", ); "LIBRARY_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/armv6-apple-darwin/lib\"/**"; - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/i386-apple-darwin/lib\""; + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/i386-apple-darwin/lib\"/**"; PRODUCT_NAME = linphone; }; name = Release; @@ -671,10 +735,9 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)\"", - "\"$(SRCROOT)/../../liblinphone-sdk/armv6-apple-darwin/lib/mediastreamer/plugins\"", ); "LIBRARY_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/armv6-apple-darwin/lib\"/**"; - "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/i386-apple-darwin/lib\""; + "LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*][arch=*]" = "\"$(SRCROOT)/../../liblinphone-sdk/i386-apple-darwin/lib\"/**"; PRODUCT_NAME = linphone; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos3.0; diff --git a/out_call.png b/out_call.png new file mode 100644 index 000000000..7fef2b4ae Binary files /dev/null and b/out_call.png differ