Merge branch 'master' into apple_store

This commit is contained in:
Guillaume BIENKOWSKI 2015-01-20 11:17:11 +01:00
commit 57b1a5f06b
34 changed files with 378 additions and 294 deletions

View file

@ -111,7 +111,7 @@
<color key="titleColor" red="0.72549019609999998" green="0.76862745099999996" blue="0.79607843140000001" alpha="1" colorSpace="deviceRGB"/>
</state>
<connections>
<action selector="onConnectAccountClick:" destination="-1" eventType="touchUpInside" id="41"/>
<action selector="onConnectLinphoneAccountClick:" destination="-1" eventType="touchUpInside" id="JTf-u3-Kbe"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="39" userLabel="externalAccountButton" customClass="UILinphoneButton">

View file

@ -292,7 +292,10 @@ static UICompositeViewDescription *compositeDescription = nil;
// Display name
if(displayName == nil) {
displayName = [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)];
const char* username = linphone_address_get_username(linphoneAddress);
char* address = linphone_address_as_string(linphoneAddress);
displayName = [NSString stringWithUTF8String:username?:address];
ms_free(address);
}
[addressLabel setText:displayName];

View file

@ -148,6 +148,16 @@ static UICompositeViewDescription *compositeDescription = nil;
[super viewWillDisappear:animated];
}
- (void)relayoutTableView {
CGRect subViewFrame= self.view.frame;
// let the toolBar be visible
subViewFrame.origin.y += self.toolBar.frame.size.height;
subViewFrame.size.height -= self.toolBar.frame.size.height;
[UIView animateWithDuration:0.2 animations:^{
self.tableView.frame = subViewFrame;
}];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
@ -166,19 +176,17 @@ static UICompositeViewDescription *compositeDescription = nil;
[self.view addSubview:picker.view];
self.sysViewController = picker;
self.searchBar.hidden = TRUE;
} else if( !use_system && !self.tableController ){
CGRect subViewFrame= self.view.frame;
// let the toolBar be visible
subViewFrame.origin.y += self.toolBar.frame.size.height;
subViewFrame.size.height -= self.toolBar.frame.size.height;
self.tableController = [[[ContactsTableViewController alloc] init] autorelease];
self.tableView = [[[UITableView alloc] init] autorelease];
self.tableController.view = self.tableView;
self.tableView.frame = subViewFrame;
[self relayoutTableView];
self.tableView.dataSource = self.tableController;
self.tableView.delegate = self.tableController;
@ -316,6 +324,15 @@ static UICompositeViewDescription *compositeDescription = nil;
[searchBar resignFirstResponder];
}
#pragma mark - Rotation handling
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
// the searchbar overlaps the subview in most rotation cases, we have to re-layout the view manually:
[self relayoutTableView];
}
#pragma mark - ABPeoplePickerDelegate
-(void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker

View file

@ -144,15 +144,23 @@ static UICompositeViewDescription *compositeDescription = nil;
[callButton setEnabled:TRUE];
// Update on show
LinphoneManager *mgr=[LinphoneManager instance];
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = linphone_core_get_current_call(lc);
LinphoneManager *mgr = [LinphoneManager instance];
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = linphone_core_get_current_call(lc);
LinphoneCallState state = (call != NULL)?linphone_call_get_state(call): 0;
[self callUpdate:call state:state];
if([LinphoneManager runningOnIpad]) {
if(linphone_core_video_enabled(lc) && [mgr lpConfigBoolForKey:@"preview_preference"]) {
BOOL videoEnabled = linphone_core_video_enabled(lc);
BOOL previewPref = [mgr lpConfigBoolForKey:@"preview_preference"];
if( videoEnabled && previewPref ) {
linphone_core_set_native_preview_window_id(lc, (unsigned long)videoPreview);
if( !linphone_core_video_preview_enabled(lc)){
linphone_core_enable_video_preview(lc, TRUE);
}
[backgroundView setHidden:FALSE];
[videoCameraSwitch setHidden:FALSE];
} else {

View file

@ -67,6 +67,7 @@ static UICompositeViewDescription *compositeDescription = nil;
fullscreen:false
landscapeMode:[LinphoneManager runningOnIpad]
portraitMode:true];
compositeDescription.darkBackground = false;
}
return compositeDescription;
}
@ -93,7 +94,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[popoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:FALSE];
}
[[UIApplication sharedApplication] setStatusBarHidden:NO]; //Fix UIImagePickerController status bar hide
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque]; //Fix UIImagePickerController status bar style change
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; //Fix UIImagePickerController status bar style change
}

View file

@ -245,10 +245,12 @@
[confirmation release];
} else {
if([[url scheme] isEqualToString:@"sip"]) {
// Go to Dialer view
DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
// remove "sip://" from the URI, and do it correctly by taking resourceSpecifier and removing leading and trailing "/"
NSString* sipUri = [[url resourceSpecifier] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]];
DialerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[DialerViewController compositeViewDescription]], DialerViewController);
if(controller != nil) {
[controller setAddress:[url absoluteString]];
[controller setAddress:sipUri];
}
}
}
@ -265,11 +267,7 @@
}
- (void)processRemoteNotification:(NSDictionary*)userInfo{
if ([LinphoneManager instance].pushNotificationToken==Nil){
[LinphoneLogger log:LinphoneLoggerLog format:@"Ignoring push notification we did not subscribed."];
return;
}
NSDictionary *aps = [userInfo objectForKey:@"aps"];
if(aps != nil) {
@ -284,18 +282,22 @@
[LinphoneManager instance].connectivity=none; /*force connectivity to be discovered again*/
[[LinphoneManager instance] refreshRegisters];
if(loc_key != nil) {
if([loc_key isEqualToString:@"IM_MSG"]) {
[[PhoneMainView instance] addInhibitedEvent:kLinphoneTextReceived];
NSString* callId = [userInfo objectForKey:@"call-id"];
if( callId != nil ){
[[LinphoneManager instance] addPushCallId:callId];
} else {
[LinphoneLogger log:LinphoneLoggerError format:@"PushNotification: does not have call-id yet, fix it !"];
}
if( [loc_key isEqualToString:@"IM_MSG"] ) {
[[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]];
} else if([loc_key isEqualToString:@"IC_MSG"]) {
//it's a call
NSString *callid=[userInfo objectForKey:@"call-id"];
if (callid)
[[LinphoneManager instance] enableAutoAnswerForCallId:callid];
else
[LinphoneLogger log:LinphoneLoggerError format:@"PushNotification: does not have call-id yet, fix it !"];
} else if( [loc_key isEqualToString:@"IC_MSG"] ) {
[self fixRing];
}
}
}
@ -365,11 +367,6 @@
{
Linphone_log(@"%@ : %@", NSStringFromSelector(_cmd), userInfo);
LinphoneManager* lm = [LinphoneManager instance];
if (lm.pushNotificationToken==Nil){
[LinphoneLogger log:LinphoneLoggerLog format:@"Ignoring push notification we did not subscribed."];
return;
}
// save the completion handler for later execution.
// 2 outcomes:

View file

@ -204,7 +204,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
}
[self setString:val forKey:@"media_encryption_preference"];
}
[self setString: lp_config_get_string(conf, LINPHONERC_APPLICATION_KEY, "rotation_preference", "auto") forKey:@"rotation_preference"];
[self setBool: lp_config_get_int(conf, LINPHONERC_APPLICATION_KEY, "edge_opt_preference", 0) forKey:@"edge_opt_preference"];
[self setBool: lp_config_get_int(conf, LINPHONERC_APPLICATION_KEY, "enable_first_login_view_preference", 0) forKey:@"enable_first_login_view_preference"];
[self setBool: lp_config_get_int(conf, LINPHONERC_APPLICATION_KEY, "debugenable_preference", 0) forKey:@"debugenable_preference"];
@ -684,9 +683,6 @@ extern void linphone_iphone_log_handler(int lev, const char *fmt, va_list args);
BOOL edgeOpt = [self boolForKey:@"edge_opt_preference"];
lp_config_set_int(config, LINPHONERC_APPLICATION_KEY, "edge_opt_preference", edgeOpt);
NSString *landscape = [self stringForKey:@"rotation_preference"];
lp_config_set_string(config, LINPHONERC_APPLICATION_KEY, "rotation_preference", [landscape UTF8String]);
BOOL debugmode = [self boolForKey:@"debugenable_preference"];
lp_config_set_int(config, LINPHONERC_APPLICATION_KEY, "debugenable_preference", debugmode);
[[LinphoneManager instance] setLogsEnabled:debugmode];

View file

@ -107,7 +107,7 @@ typedef struct _LinphoneManagerSounds {
@private
NSTimer* mIterateTimer;
NSMutableArray* pendindCallIdFromRemoteNotif;
NSMutableArray* pushCallIDs;
Connectivity connectivity;
UIBackgroundTaskIdentifier pausedCallBgTask;
UIBackgroundTaskIdentifier incallBgTask;
@ -137,9 +137,9 @@ typedef struct _LinphoneManagerSounds {
- (BOOL)resignActive;
- (void)becomeActive;
- (BOOL)enterBackgroundMode;
- (void)enableAutoAnswerForCallId:(NSString*) callid;
- (void)addPushCallId:(NSString*) callid;
- (void)configurePushTokenForProxyConfig: (LinphoneProxyConfig*)cfg;
- (BOOL)shouldAutoAcceptCallForCallId:(NSString*) callId;
- (BOOL)popPushCallID:(NSString*) callId;
- (void)acceptCallForCallId:(NSString*)callid;
- (void)cancelLocalNotifTimerForCallId:(NSString*)callid;

View file

@ -276,7 +276,7 @@ struct codec_name_pref_table codec_pref_table[]={
bluetoothEnabled = FALSE;
tunnelMode = FALSE;
[self copyDefaultSettings];
pendindCallIdFromRemoteNotif = [[NSMutableArray alloc] init ];
pushCallIDs = [[NSMutableArray alloc] init ];
photoLibrary = [[ALAssetsLibrary alloc] init];
NSString* factoryConfig = [LinphoneManager bundleFile:[LinphoneManager runningOnIpad]?@"linphonerc-factory~ipad":@"linphonerc-factory"];
@ -311,7 +311,7 @@ struct codec_name_pref_table codec_pref_table[]={
[photoLibrary release];
[pendindCallIdFromRemoteNotif release];
[pushCallIDs release];
[super dealloc];
}
@ -637,7 +637,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
}
}
if(address == nil) {
address = @"Unknown";
address = NSLocalizedString(@"Unknown", nil);
}
if (state == LinphoneCallIncomingReceived) {
@ -663,7 +663,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
LinphoneCallLog* callLog=linphone_call_get_call_log(call);
NSString* callId=[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
if (![[LinphoneManager instance] shouldAutoAcceptCallForCallId:callId]){
if (![[LinphoneManager instance] popPushCallID:callId]){
// case where a remote notification is not already received
// Create a new local notification
data->notification = [[UILocalNotification alloc] init];
@ -878,14 +878,16 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo
silentPushCompletion(UIBackgroundFetchResultNewData);
silentPushCompletion = nil;
}
const LinphoneAddress* remoteAddress = linphone_chat_message_get_from_address(msg);
char* c_address = linphone_address_as_string_uri_only(remoteAddress);
NSString* address = [NSString stringWithUTF8String:c_address];
const char* call_id = linphone_chat_message_get_custom_header(msg, "Call-ID");
NSString* callID = [NSString stringWithUTF8String:call_id];
ms_free(c_address);
if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) {
const LinphoneAddress* remoteAddress = linphone_chat_message_get_from_address(msg);
char* c_address = linphone_address_as_string_uri_only(remoteAddress);
NSString* address = [NSString stringWithUTF8String:c_address];
NSString* from_address = [address copy];
ABRecordRef contact = [fastAddressBook getContact:address];
if(contact) {
address = [FastAddressBook getContactDisplayName:contact];
@ -897,7 +899,7 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo
}
}
if(address == nil) {
address = @"Unknown";
address = NSLocalizedString(@"Unknown", nil);
}
// Create a new notification
@ -910,18 +912,18 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo
notif.alertBody = [NSString stringWithFormat:NSLocalizedString(@"IM_MSG",nil), address];
notif.alertAction = NSLocalizedString(@"Show", nil);
notif.soundName = @"msg.caf";
notif.userInfo = @{@"from":from_address};
notif.userInfo = @{@"from":address, @"call-id":callID};
[[UIApplication sharedApplication] presentLocalNotificationNow:notif];
}
[from_address release];
}
// Post event
NSDictionary* dict = @{@"room" :[NSValue valueWithPointer:room],
@"from_address":[NSValue valueWithPointer:linphone_chat_message_get_from(msg)],
@"message" :[NSValue valueWithPointer:msg]};
@"from_address":[NSValue valueWithPointer:linphone_chat_message_get_from_address(msg)],
@"message" :[NSValue valueWithPointer:msg],
@"call-id" : callID};
[[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self userInfo:dict];
}
@ -1532,23 +1534,23 @@ static int comp_call_id(const LinphoneCall* call , const char *callid) {
};
}
- (void)enableAutoAnswerForCallId:(NSString*) callid {
//first, make sure this callid is not already involved in a call
- (void)addPushCallId:(NSString*) callid {
//first, make sure this callid is not already involved in a call
MSList* calls = (MSList*)linphone_core_get_calls(theLinphoneCore);
if (ms_list_find_custom(calls, (MSCompareFunc)comp_call_id, [callid UTF8String])) {
[LinphoneLogger log:LinphoneLoggerWarning format:@"Call id [%@] already handled",callid];
Linphone_warn(@"Call id [%@] already handled",callid);
return;
};
if ([pendindCallIdFromRemoteNotif count] > 10 /*max number of pending notif*/)
[pendindCallIdFromRemoteNotif removeObjectAtIndex:0];
if ([pushCallIDs count] > 10 /*max number of pending notif*/)
[pushCallIDs removeObjectAtIndex:0];
[pendindCallIdFromRemoteNotif addObject:callid];
[pushCallIDs addObject:callid];
}
- (BOOL)shouldAutoAcceptCallForCallId:(NSString*) callId {
for (NSString* pendingNotif in pendindCallIdFromRemoteNotif) {
- (BOOL)popPushCallID:(NSString*) callId {
for (NSString* pendingNotif in pushCallIDs) {
if ([pendingNotif compare:callId] == NSOrderedSame) {
[pendindCallIdFromRemoteNotif removeObject:pendingNotif];
[pushCallIDs removeObject:pendingNotif];
return TRUE;
}
}
@ -1863,8 +1865,6 @@ static void audioRouteChangeListenerCallback (
BOOL addressIsASCII = [address canBeConvertedToEncoding:[NSString defaultCStringEncoding]];
if ([address length] == 0) return; //just return
if( !addressIsASCII ){
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid SIP address",nil)
message:NSLocalizedString(@"The address should only contain ASCII data",nil)
@ -1874,9 +1874,11 @@ static void audioRouteChangeListenerCallback (
[error show];
[error release];
} else if ([address hasPrefix:@"sip:"] || [address hasPrefix:@"sips:"]) {
}
LinphoneAddress* linphoneAddress = linphone_core_interpret_url(theLinphoneCore, [address cStringUsingEncoding:[NSString defaultCStringEncoding]]);
if (linphoneAddress) {
LinphoneAddress* linphoneAddress = linphone_address_new([address cStringUsingEncoding:[NSString defaultCStringEncoding]]);
if(displayName!=nil) {
linphone_address_set_display_name(linphoneAddress,[displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
@ -1889,7 +1891,7 @@ static void audioRouteChangeListenerCallback (
}
linphone_address_destroy(linphoneAddress);
} else if (proxyCfg==nil){
} else {
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Invalid SIP address",nil)
message:NSLocalizedString(@"Either configure a SIP proxy server from settings prior to place a call or use a valid SIP address (I.E sip:john@example.net)",nil)
@ -1899,23 +1901,9 @@ static void audioRouteChangeListenerCallback (
[error show];
[error release];
} else {
char normalizedUserName[256];
LinphoneAddress* linphoneAddress = linphone_address_new(linphone_core_get_identity(theLinphoneCore));
linphone_proxy_config_normalize_number(proxyCfg,[address cStringUsingEncoding:[NSString defaultCStringEncoding]],normalizedUserName,sizeof(normalizedUserName));
linphone_address_set_username(linphoneAddress, normalizedUserName);
if(displayName!=nil) {
linphone_address_set_display_name(linphoneAddress, [displayName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
}
if ([[LinphoneManager instance] lpConfigBoolForKey:@"override_domain_with_default_one"])
linphone_address_set_domain(linphoneAddress, [[[LinphoneManager instance] lpConfigStringForKey:@"domain" forSection:@"wizard"] cStringUsingEncoding:[NSString defaultCStringEncoding]]);
if(transfer) {
linphone_core_transfer_call(theLinphoneCore, linphone_core_get_current_call(theLinphoneCore), linphone_address_as_string_uri_only(linphoneAddress));
} else {
call=linphone_core_invite_address_with_params(theLinphoneCore, linphoneAddress, lcallParams);
}
linphone_address_destroy(linphoneAddress);
}
}
if (call) {
// The LinphoneCallAppData object should be set on call creation with callback
// - (void)onCall:StateChanged:withMessage:. If not, we are in big trouble and expect it to crash

View file

@ -4,16 +4,16 @@
*
* 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
* 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.
*/
@ -36,8 +36,8 @@
self->view = UICallCellOtherView_Avatar;
self->call = acall;
image = [[UIImage imageNamed:@"avatar_unknown.png"] retain];
address = [@"Unknown" retain];
[self update];
address = [NSLocalizedString(@"Unknown",nil) retain];
[self update];
}
return self;
}
@ -48,7 +48,7 @@
return;
}
const LinphoneAddress* addr = linphone_call_get_remote_address(call);
if(addr != NULL) {
BOOL useLinphoneAddress = true;
// contact name
@ -85,7 +85,7 @@
- (void)dealloc {
[address release];
[image release];
[super dealloc];
}
@ -145,7 +145,7 @@
NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"UICallCell"
owner:self
options:nil];
if ([arrayOfViews count] >= 1) {
//resize cell to match .nib size. It is needed when resized the cell to
//correctly adapt its height too
@ -154,28 +154,28 @@
[self addSubview:sub];
}
// Set selected+over background: IB lack !
[pauseButton setImage:[UIImage imageNamed:@"call_state_pause_over.png"]
[pauseButton setImage:[UIImage imageNamed:@"call_state_pause_over.png"]
forState:(UIControlStateHighlighted | UIControlStateSelected)];
self->currentCall = FALSE;
self->detailsRightSwipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doDetailsSwipe:)];
[detailsRightSwipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionLeft];
[otherView addGestureRecognizer:detailsRightSwipeGestureRecognizer];
self->detailsRightSwipeGestureRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(doDetailsSwipe:)];
[detailsRightSwipeGestureRecognizer setDirection:UISwipeGestureRecognizerDirectionRight];
[otherView addGestureRecognizer:detailsRightSwipeGestureRecognizer];
[self->avatarView setHidden:TRUE];
[self->audioStatsView setHidden:TRUE];
[self->videoStatsView setHidden:TRUE];
[UICallCell adaptSize:audioCodecHeaderLabel field:audioCodecLabel];
[UICallCell adaptSize:audioDownloadBandwidthHeaderLabel field:audioDownloadBandwidthLabel];
[UICallCell adaptSize:audioUploadBandwidthHeaderLabel field:audioUploadBandwidthLabel];
[UICallCell adaptSize:audioIceConnectivityHeaderLabel field:audioIceConnectivityLabel];
[UICallCell adaptSize:videoCodecHeaderLabel field:videoCodecLabel];
[UICallCell adaptSize:videoDownloadBandwidthHeaderLabel field:videoDownloadBandwidthLabel];
[UICallCell adaptSize:videoUploadBandwidthHeaderLabel field:videoUploadBandwidthLabel];
@ -185,7 +185,7 @@
[LinphoneUtils adjustFontSize:self.audioStatsView mult:2.22];
[LinphoneUtils adjustFontSize:self.videoStatsView mult:2.22];
}
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(applicationWillEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
@ -198,23 +198,23 @@
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIApplicationWillEnterForegroundNotification
object:nil];
[headerBackgroundImage release];
[headerBackgroundHighlightImage release];
[addressLabel release];
[stateLabel release];
[stateImage release];
[avatarImage release];
[pauseButton release];
[removeButton release];
[headerView release];
[avatarView release];
[audioStatsView release];
[audioCodecLabel release];
[audioCodecHeaderLabel release];
[audioUploadBandwidthLabel release];
@ -223,9 +223,9 @@
[audioDownloadBandwidthHeaderLabel release];
[audioIceConnectivityLabel release];
[audioIceConnectivityHeaderLabel release];
[videoStatsView release];
[videoCodecLabel release];
[videoCodecHeaderLabel release];
[videoUploadBandwidthLabel release];
@ -234,11 +234,11 @@
[videoDownloadBandwidthHeaderLabel release];
[videoIceConnectivityLabel release];
[videoIceConnectivityHeaderLabel release];
[otherView release];
[data release];
[detailsLeftSwipeGestureRecognizer release];
[detailsRightSwipeGestureRecognizer release];
@ -292,20 +292,20 @@
//
CGRect labelFrame = [label frame];
CGRect fieldFrame = [field frame];
fieldFrame.origin.x -= labelFrame.size.width;
// Compute firstName size
CGSize contraints;
contraints.height = [label frame].size.height;
contraints.width = ([field frame].size.width + [field frame].origin.x) - [label frame].origin.x;
CGSize firstNameSize = [[label text] sizeWithFont:[label font] constrainedToSize: contraints];
labelFrame.size.width = firstNameSize.width;
// Compute lastName size & position
fieldFrame.origin.x += labelFrame.size.width;
fieldFrame.size.width = (contraints.width + [label frame].origin.x) - fieldFrame.origin.x;
[label setFrame: labelFrame];
[field setFrame: fieldFrame];
}
@ -372,7 +372,7 @@
[target setAlpha:0.0f];
}
#pragma mark -
- (void)update {
@ -381,12 +381,12 @@
return;
}
LinphoneCall *call = data->call;
[pauseButton setType:UIPauseButtonType_Call call:call];
[addressLabel setText:data.address];
[avatarImage setImage:data.image];
LinphoneCallState state = linphone_call_get_state(call);
if(!conferenceCell) {
if(state == LinphoneCallOutgoingRinging) {
@ -416,10 +416,10 @@
[removeButton setHidden:false];
[headerBackgroundImage setImage:[UIImage imageNamed:@"cell_conference.png"]];
}
int duration = linphone_call_get_duration(call);
[stateLabel setText:[NSString stringWithFormat:@"%02i:%02i", (duration/60), (duration%60), nil]];
if(!data->minimize) {
CGRect frame = [self frame];
frame.size.height = [UICallCell getMaximizedHeight];
@ -434,9 +434,9 @@
[self setFrame:frame];
[otherView setHidden:true];
}
[self updateStats];
[self updateDetailsView];
}
@ -446,7 +446,7 @@
return;
}
LinphoneCall *call = data->call;
const LinphoneCallParams *params = linphone_call_get_current_params(call);
{
const PayloadType* payload = linphone_call_params_get_used_audio_codec(params);
@ -466,7 +466,7 @@
[audioIceConnectivityLabel setText:@""];
}
}
{
const PayloadType* payload = linphone_call_params_get_used_video_codec(params);
if(payload != NULL) {
@ -474,7 +474,7 @@
} else {
[videoCodecLabel setText:NSLocalizedString(@"No codec", nil)];
}
const LinphoneCallStats *stats = linphone_call_get_video_stats(call);
MSVideoSize sentSize = linphone_call_params_get_sent_video_size(params);
@ -520,7 +520,7 @@
- (void)selfUpdate {
UITableView *parentTable = (UITableView *)self.superview;
while( parentTable != nil && ![parentTable isKindOfClass:[UITableView class]] ) parentTable = (UITableView *)[parentTable superview];
if(parentTable != nil) {

View file

@ -99,7 +99,10 @@
// Display name
if(displayName == nil) {
displayName = [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)];
const char* username = linphone_address_get_username(linphoneAddress);
char* address = linphone_address_as_string(linphoneAddress);
displayName = [NSString stringWithUTF8String:username?:address];
ms_free(address);
}
[addressLabel setText:displayName];

View file

@ -372,76 +372,45 @@
[controller view]; // Load the view
}
}
return controller;
return controller;
}
- (UIInterfaceOrientation)getCorrectInterfaceOrientation:(UIDeviceOrientation)deviceOrientation {
if(currentViewDescription != nil) {
// If unknown return status bar orientation
if(deviceOrientation == UIDeviceOrientationUnknown && currentOrientation == UIDeviceOrientationUnknown) {
return [UIApplication sharedApplication].statusBarOrientation;
}
NSString* rotationPreference = [[LinphoneManager instance] lpConfigStringForKey:@"rotation_preference"];
if([rotationPreference isEqualToString:@"auto"]) {
// Don't rotate in UIDeviceOrientationFaceUp UIDeviceOrientationFaceDown
if(!UIDeviceOrientationIsPortrait(deviceOrientation) && !UIDeviceOrientationIsLandscape(deviceOrientation)) {
if(currentOrientation == UIDeviceOrientationUnknown) {
return [UIApplication sharedApplication].statusBarOrientation;
}
deviceOrientation = (UIDeviceOrientation)currentOrientation;
}
if (UIDeviceOrientationIsPortrait(deviceOrientation)) {
if ([currentViewDescription portraitMode]) {
return (UIInterfaceOrientation)deviceOrientation;
} else {
return UIInterfaceOrientationLandscapeLeft;
}
}
if (UIDeviceOrientationIsLandscape(deviceOrientation)) {
if ([currentViewDescription landscapeMode]) {
return (UIInterfaceOrientation)deviceOrientation;
} else {
return UIInterfaceOrientationPortrait;
}
}
} else if([rotationPreference isEqualToString:@"portrait"]) {
if ([currentViewDescription portraitMode]) {
if (UIDeviceOrientationIsPortrait(deviceOrientation)) {
return (UIInterfaceOrientation)deviceOrientation;
} else {
if(UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) {
return [UIApplication sharedApplication].statusBarOrientation;
} else {
return UIInterfaceOrientationPortrait;
}
}
} else {
return UIInterfaceOrientationLandscapeLeft;
}
} else if([rotationPreference isEqualToString:@"landscape"]) {
if ([currentViewDescription landscapeMode]) {
if (UIDeviceOrientationIsLandscape(deviceOrientation)) {
return (UIInterfaceOrientation)deviceOrientation;
} else {
if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
return [UIApplication sharedApplication].statusBarOrientation;
} else {
return UIInterfaceOrientationLandscapeLeft;
}
}
} else {
return UIInterfaceOrientationPortrait;
}
}
}
if(currentViewDescription != nil) {
// If unknown return status bar orientation
if(deviceOrientation == UIDeviceOrientationUnknown && currentOrientation == UIDeviceOrientationUnknown) {
return [UIApplication sharedApplication].statusBarOrientation;
}
// Don't rotate in UIDeviceOrientationFaceUp UIDeviceOrientationFaceDown
if(!UIDeviceOrientationIsPortrait(deviceOrientation) && !UIDeviceOrientationIsLandscape(deviceOrientation)) {
if(currentOrientation == UIDeviceOrientationUnknown) {
return [UIApplication sharedApplication].statusBarOrientation;
}
deviceOrientation = (UIDeviceOrientation)currentOrientation;
}
if (UIDeviceOrientationIsPortrait(deviceOrientation)) {
if ([currentViewDescription portraitMode]) {
return (UIInterfaceOrientation)deviceOrientation;
} else {
return UIInterfaceOrientationLandscapeLeft;
}
}
if (UIDeviceOrientationIsLandscape(deviceOrientation)) {
if ([currentViewDescription landscapeMode]) {
return (UIInterfaceOrientation)deviceOrientation;
} else {
return UIInterfaceOrientationPortrait;
}
}
}
return UIInterfaceOrientationPortrait;
}
#define IPHONE_STATUSBAR_HEIGHT 20
- (void)update: (UICompositeViewDescription*) description tabBar:(NSNumber*)tabBar stateBar:(NSNumber*)stateBar fullscreen:(NSNumber*)fullscreen {
UIViewController *oldContentViewController = self.contentViewController;
UIViewController *oldStateBarViewController = self.stateBarViewController;
UIViewController *oldTabBarViewController = self.tabBarViewController;

View file

@ -39,6 +39,8 @@
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic, retain) IBOutlet id<ContactDetailsDelegate> contactDetailsDelegate;
@property (retain, nonatomic) ImagePickerViewController* popoverController;
@property(nonatomic,getter=isEditing) BOOL editing;
- (IBAction)onAvatarClick:(id)event;

View file

@ -36,6 +36,7 @@
@synthesize editView;
@synthesize tableView;
@synthesize contactDetailsDelegate;
@synthesize popoverController;
#pragma mark - Lifecycle Functions
@ -123,7 +124,7 @@
// Avatar image
{
UIImage *image = [FastAddressBook getContactImage:contact thumbnail:true];
UIImage *image = [FastAddressBook getContactImage:contact thumbnail:false];
if(image == nil) {
image = [UIImage imageNamed:@"avatar_unknown_small.png"];
}
@ -243,11 +244,13 @@
- (IBAction)onAvatarClick:(id)event {
if(self.isEditing) {
void (^block)(UIImagePickerControllerSourceType) = ^(UIImagePickerControllerSourceType type) {
void (^showAppropriateController)(UIImagePickerControllerSourceType) = ^(UIImagePickerControllerSourceType type) {
UICompositeViewDescription *description = [ImagePickerViewController compositeViewDescription];
ImagePickerViewController *controller;
if([LinphoneManager runningOnIpad]) {
controller = DYNAMIC_CAST([[PhoneMainView instance].mainViewController getCachedController:description.content], ImagePickerViewController);
// keep a reference to this controller so that in case of memory pressure we keep it
self.popoverController = controller;
} else {
controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:description push:TRUE], ImagePickerViewController);
}
@ -271,12 +274,12 @@
DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)] autorelease];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[sheet addButtonWithTitle:NSLocalizedString(@"Camera",nil) block:^(){
block(UIImagePickerControllerSourceTypeCamera);
showAppropriateController(UIImagePickerControllerSourceTypeCamera);
}];
}
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
[sheet addButtonWithTitle:NSLocalizedString(@"Photo library",nil) block:^(){
block(UIImagePickerControllerSourceTypePhotoLibrary);
showAppropriateController(UIImagePickerControllerSourceTypePhotoLibrary);
}];
}
if([FastAddressBook getContactImage:contact thumbnail:true] != nil) {
@ -288,8 +291,10 @@
[self update];
}];
}
[sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:nil];
[sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil) block:^{
self.popoverController = nil;
}];
[sheet showInView:[PhoneMainView instance].view];
}
}
@ -304,19 +309,25 @@
ImagePickerViewController *controller = DYNAMIC_CAST([[PhoneMainView instance].mainViewController getCachedController:description.content], ImagePickerViewController);
if(controller != nil) {
[controller.popoverController dismissPopoverAnimated:TRUE];
self.popoverController = nil;
}
}
FastAddressBook* fab = [LinphoneManager instance].fastAddressBook;
NSError* error = NULL;
if(!ABPersonRemoveImageData(contact, (CFErrorRef*)error)) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Can't remove entry: %@", [error localizedDescription]];
}
NSData *dataRef = UIImageJPEGRepresentation(image, 0.9f);
CFDataRef cfdata = CFDataCreate(NULL,[dataRef bytes], [dataRef length]);
if(!ABPersonSetImageData(contact, cfdata, (CFErrorRef*)error)) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Can't add entry: %@", [error localizedDescription]];
}
[fab saveAddressBook];
if(!ABPersonSetImageData(contact, cfdata, (CFErrorRef*)error)) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Can't add entry: %@", [error localizedDescription]];
} else {
[fab saveAddressBook];
}
CFRelease(cfdata);
[self update];

View file

@ -151,7 +151,7 @@
}
}
if(address == nil) {
address = @"Unknown";
address = NSLocalizedString(@"Unknown", nil);
}
[addressLabel setText:address];

View file

@ -29,15 +29,16 @@
[self setRoundRadius:rounded];
}
// warning: for non-squared image, this function will generate an ellipsoidal image, not a round image!
- (void)setRoundRadius:(BOOL)radius {
CALayer *imageLayer = self.layer;
CGFloat height =self.frame.size.height;
CGFloat witdh = self.frame.size.width;
CGFloat roundRadius = height > witdh ? witdh / 2 : height / 2;
CALayer *imageLayer = self.layer;
CGFloat height = imageLayer.frame.size.height;
CGFloat width = imageLayer.frame.size.width;
CGFloat roundRadius = height > width ? width / 2 : height / 2;
[imageLayer setCornerRadius:roundRadius];
[imageLayer setBorderWidth:0];
[imageLayer setMasksToBounds:YES];
[imageLayer setCornerRadius:roundRadius];
[imageLayer setBorderWidth:0];
[imageLayer setMasksToBounds:YES];
}

View file

@ -270,10 +270,11 @@ static RootViewManager* rootViewManagerInstance = nil;
#pragma mark - Event Functions
- (void)textReceived:(NSNotification*)notif {
LinphoneAddress*from = [[notif.userInfo objectForKey:@"from_address"] pointerValue];
LinphoneAddress* from = [[notif.userInfo objectForKey:@"from_address"] pointerValue];
NSString* callID = [notif.userInfo objectForKey:@"call-id"];
if(from != nil) {
[self playMessageSound];
}
[self playMessageSoundForCallID:callID];
}
[self updateApplicationBadgeNumber];
}
@ -653,22 +654,31 @@ static RootViewManager* rootViewManagerInstance = nil;
#pragma mark - ActionSheet Functions
- (void)playMessageSound {
- (void)playMessageSoundForCallID:(NSString*)callID {
if ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground) {
if(![self removeInhibitedEvent:kLinphoneTextReceived]) {
[[LinphoneManager instance] playMessageSound];
LinphoneManager* lm = [LinphoneManager instance];
// if the message was already received through a push notif, we don't need to ring
if( ![lm popPushCallID:callID] ) {
[lm playMessageSound];
}
}
}
- (void)displayIncomingCall:(LinphoneCall*) call{
LinphoneCallLog* callLog=linphone_call_get_call_log(call);
NSString* callId=[NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
LinphoneCallLog* callLog = linphone_call_get_call_log(call);
NSString* callId = [NSString stringWithUTF8String:linphone_call_log_get_call_id(callLog)];
if ([UIApplication sharedApplication].applicationState != UIApplicationStateBackground) {
if ([[LinphoneManager instance] shouldAutoAcceptCallForCallId:callId]){
[[LinphoneManager instance] acceptCall:call];
}else {
LinphoneManager* lm = [LinphoneManager instance];
BOOL callIDFromPush = [lm popPushCallID:callId];
BOOL autoAnswer = [lm lpConfigBoolForKey:@"autoanswer_notif_preference"];
if (callIDFromPush && autoAnswer){
// accept call automatically
[lm acceptCall:call];
} else {
IncomingCallViewController *controller = nil;
if( ![currentView.name isEqualToString:[IncomingCallViewController compositeViewDescription].name]){
controller = DYNAMIC_CAST([self changeCurrentView:[IncomingCallViewController compositeViewDescription] push:TRUE],IncomingCallViewController);
@ -676,11 +686,12 @@ static RootViewManager* rootViewManagerInstance = nil;
// controller is already presented, don't bother animating a transition
controller = DYNAMIC_CAST([self.mainViewController getCurrentViewController],IncomingCallViewController);
}
AudioServicesPlaySystemSound([LinphoneManager instance].sounds.vibrate);
AudioServicesPlaySystemSound(lm.sounds.vibrate);
if(controller != nil) {
[controller setCall:call];
[controller setDelegate:self];
}
}
}
}

View file

@ -672,6 +672,13 @@ static UICompositeViewDescription *compositeDescription = nil;
return hiddenKeys;
}
- (void)goToWizard {
WizardViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]], WizardViewController);
if(controller != nil) {
[controller reset];
}
}
#pragma mark - IASKSettingsDelegate Functions
- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController *)sender {
@ -694,6 +701,12 @@ static UICompositeViewDescription *compositeDescription = nil;
}
#endif
if([key isEqual:@"wizard_button"]) {
LinphoneProxyConfig* proxy = NULL;
linphone_core_get_default_proxy([LinphoneManager getLc], &proxy);
if (proxy == NULL ) {
[self goToWizard];
return;
}
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Warning",nil)
message:NSLocalizedString(@"Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?",nil)
delegate:self
@ -736,12 +749,8 @@ static UICompositeViewDescription *compositeDescription = nil;
#pragma mark - UIAlertView delegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if( buttonIndex != 1 ) return;
WizardViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[WizardViewController compositeViewDescription]], WizardViewController);
if(controller != nil) {
[controller reset];
}
if( buttonIndex != 1 ) return; /* cancel */
else [self goToWizard];
}
#pragma mark - Mail composer for send log

View file

@ -31,6 +31,7 @@
+ (UIImage*)getContactImage:(ABRecordRef)contact thumbnail:(BOOL)thumbnail;
- (ABRecordRef)getContact:(NSString*)address;
- (void)reload;
- (void)saveAddressBook;
+ (BOOL)isAuthorized;
+ (NSString*)appendCountryCodeIfPossible:(NSString*)number;
+ (NSString*)normalizePhoneNumber:(NSString*)number;

View file

@ -36,6 +36,35 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
return retString;
}
+ (UIImage*)squareImageCrop:(UIImage*)image
{
UIImage *ret = nil;
// This calculates the crop area.
float originalWidth = image.size.width;
float originalHeight = image.size.height;
float edge = fminf(originalWidth, originalHeight);
float posX = (originalWidth - edge) / 2.0f;
float posY = (originalHeight - edge) / 2.0f;
CGRect cropSquare = CGRectMake(posX, posY,
edge, edge);
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], cropSquare);
ret = [UIImage imageWithCGImage:imageRef
scale:image.scale
orientation:image.imageOrientation];
CGImageRelease(imageRef);
return ret;
}
+ (UIImage*)getContactImage:(ABRecordRef)contact thumbnail:(BOOL)thumbnail {
UIImage* retImage = nil;
if (contact && ABPersonHasImageData(contact)) {
@ -46,7 +75,13 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
if(imgData != NULL) {
CFRelease(imgData);
}
if (retImage != nil && retImage.size.width != retImage.size.height) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Image is not square : cropping it."];
return [self squareImageCrop:retImage];
}
}
return retImage;
}
@ -126,6 +161,15 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf
return self;
}
- (void)saveAddressBook {
if( addressBook != nil ){
NSError* err = nil;
if( !ABAddressBookSave(addressBook, (CFErrorRef*)err) ){
Linphone_warn(@"Couldn't save Address Book");
}
}
}
- (void)reload {
if(addressBook != nil) {
ABAddressBookUnregisterExternalChangeCallback(addressBook, sync_address_book, self);

View file

@ -71,7 +71,7 @@
- (IBAction)onCancelClick:(id)sender;
- (IBAction)onCreateAccountClick:(id)sender;
- (IBAction)onConnectAccountClick:(id)sender;
- (IBAction)onConnectLinphoneAccountClick:(id)sender;
- (IBAction)onExternalAccountClick:(id)sender;
- (IBAction)onCheckValidationClick:(id)sender;
- (IBAction)onRemoteProvisioningClick:(id)sender;

View file

@ -425,7 +425,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain withTransport:(NSString*)transport {
- (BOOL)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain withTransport:(NSString*)transport {
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneProxyConfig* proxyCfg = linphone_core_create_proxy_config(lc);
NSString* server_address = domain;
@ -448,11 +448,29 @@ static UICompositeViewDescription *compositeDescription = nil;
linphone_address_set_domain(linphoneAddress, [domain UTF8String]);
}
identity = linphone_address_as_string_uri_only(linphoneAddress);
char* extractedAddres = linphone_address_as_string_uri_only(linphoneAddress);
linphone_proxy_config_set_identity(proxyCfg, identity);
LinphoneAddress* parsedAddress = linphone_address_new(extractedAddres);
ms_free(extractedAddres);
if( parsedAddress == NULL || !linphone_address_is_sip(parsedAddress) ){
if( parsedAddress ) linphone_address_destroy(parsedAddress);
UIAlertView* errorView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Check error(s)",nil)
message:NSLocalizedString(@"Please enter a valid username", nil)
delegate:nil
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil,nil];
[errorView show];
[errorView release];
return FALSE;
}
char *c_parsedAddress = linphone_address_as_string_uri_only(parsedAddress);
linphone_proxy_config_set_identity(proxyCfg, c_parsedAddress);
linphone_address_destroy(parsedAddress);
ms_free(c_parsedAddress);
LinphoneAuthInfo* info = linphone_auth_info_new([username UTF8String]
, NULL, [password UTF8String]
@ -467,7 +485,8 @@ static UICompositeViewDescription *compositeDescription = nil;
linphone_proxy_config_enable_register(proxyCfg, true);
linphone_core_add_auth_info(lc, info);
linphone_core_add_proxy_config(lc, proxyCfg);
linphone_core_set_default_proxy(lc, proxyCfg);
linphone_core_set_default_proxy_config(lc, proxyCfg);
return TRUE;
}
- (void)addProvisionedProxy:(NSString*)username withPassword:(NSString*)password withDomain:(NSString*)domain {
@ -509,6 +528,8 @@ static UICompositeViewDescription *compositeDescription = nil;
return [uri substringFromIndex:[scheme length] + 1];
}
#pragma mark - Linphone XMLRPC
- (void)checkUserExist:(NSString*)username {
[LinphoneLogger log:LinphoneLoggerLog format:@"XMLRPC check_account %@", username];
@ -552,6 +573,8 @@ static UICompositeViewDescription *compositeDescription = nil;
[waitView setHidden:false];
}
#pragma mark -
- (void)registrationUpdate:(LinphoneRegistrationState)state message:(NSString*)message{
switch (state) {
case LinphoneRegistrationOk: {
@ -668,7 +691,7 @@ static UICompositeViewDescription *compositeDescription = nil;
[self loadWizardConfig:@"wizard_linphone_create.rc"];
}
- (IBAction)onConnectAccountClick:(id)sender {
- (IBAction)onConnectLinphoneAccountClick:(id)sender {
nextView = connectAccountView;
[self loadWizardConfig:@"wizard_linphone_existing.rc"];
}
@ -704,11 +727,11 @@ static UICompositeViewDescription *compositeDescription = nil;
- (void) verificationSignInWithUsername:(NSString*)username password:(NSString*)password domain:(NSString*)domain withTransport:(NSString*)transport {
NSMutableString *errors = [NSMutableString string];
if ([username length] == 0) {
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a username.\n", nil)]];
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a valid username.\n", nil)]];
}
if (domain != nil && [domain length] == 0) {
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a domain.\n", nil)]];
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a valid domain.\n", nil)]];
}
if([errors length]) {
@ -720,9 +743,10 @@ static UICompositeViewDescription *compositeDescription = nil;
[errorView show];
[errorView release];
} else {
[self.waitView setHidden:false];
[waitView setHidden:false];
if ([LinphoneManager instance].connectivity == none) {
DTAlertView *alert = [[DTAlertView alloc] initWithTitle:NSLocalizedString(@"No connectivity", nil) message:NSLocalizedString(@"You can either skip verification or connect to the Internet first.", nil)];
DTAlertView *alert = [[DTAlertView alloc] initWithTitle:NSLocalizedString(@"No connectivity", nil)
message:NSLocalizedString(@"You can either skip verification or connect to the Internet first.", nil)];
[alert addCancelButtonWithTitle:NSLocalizedString(@"Stay here", nil) block:^{
[waitView setHidden:true];
}];
@ -733,7 +757,10 @@ static UICompositeViewDescription *compositeDescription = nil;
}];
[alert show];
} else {
[self addProxyConfig:username password:password domain:domain withTransport:transport];
BOOL success = [self addProxyConfig:username password:password domain:domain withTransport:transport];
if( !success ){
waitView.hidden = true;
}
}
}
}
@ -807,7 +834,7 @@ static UICompositeViewDescription *compositeDescription = nil;
NSMutableString *errors = [NSMutableString string];
if ([username length] == 0) {
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a username.\n", nil)]];
[errors appendString:[NSString stringWithFormat:NSLocalizedString(@"Please enter a valid username.\n", nil)]];
}
if([errors length]) {

View file

@ -10,11 +10,11 @@ You will NOT be able to build the SDK if you did not read liblinphone README fir
* Using HomeBrew:
brew install imagemagick
brew install imagemagick yasm nasm
* Using MacPorts:
sudo port install ImageMagick optipng
sudo port install ImageMagick optipng yasm nasm
### System linking
@ -91,6 +91,11 @@ After the SDK is built, just open the Linphone Xcode project with Xcode, and pre
* Video capture does not work in simulator (not implemented by simulator?).
* Link errors with x86_64: this happens when you try to run linphone on the iPhone 5S/6/6+ simulators.
This is due to the fact that we're not building the SDK for the x86_64 architecture, due to it being redundant with i386 (and increasing dramatically the compile time and build size).
The solution (temporary) is to force the acceptable architectures to be 'armv7' only (remove 'arm64') and disable the "build active architecture" flag in the linphone, XMLRPC and NinePatch projects.
Don't forget to re-enable them when archiving your project.
## DEBUGING THE SDK
Sometime it can be useful to step into liblinphone SDK functions. To allow Xcode to enable breakpoint within liblinphone, SDK must be built with debug symbols.

View file

@ -281,10 +281,10 @@
"Photo library" = "Photo library";
/* No comment provided by engineer. */
"Please enter a domain.\n" = "Please enter a domain.\n";
"Please enter a valid domain.\n" = "Please enter a valid domain.\n";
/* No comment provided by engineer. */
"Please enter a username.\n" = "Please enter a username.\n";
"Please enter a valid username.\n" = "Please enter a valid username.\n";
/* No comment provided by engineer. */
"Please make sure your device is connected to the internet and double check your SIP account configuration in the settings." = "Please make sure your device is connected to the internet and double check your SIP account configuration in the settings.";

View file

@ -30,7 +30,6 @@ capture_dev_id=AU: Audio Unit Receiver
eq_active=0
[app]
rotation_preference=auto
animations_preference=1
edge_opt_preference=0
use_system_contacts=0

View file

@ -30,7 +30,7 @@ capture_dev_id=AU: Audio Unit Receiver
eq_active=0
[app]
rotation_preference=auto
preview_preference=1
animations_preference=1
edge_opt_preference=0
use_system_contacts=0

View file

@ -52,28 +52,6 @@
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string>auto</string>
<key>Key</key>
<string>rotation_preference</string>
<key>Title</key>
<string>Rotation</string>
<key>Titles</key>
<array>
<string>Automatic</string>
<string>Portrait</string>
<string>Landscape</string>
</array>
<key>Type</key>
<string>PSMultiValueSpecifier</string>
<key>Values</key>
<array>
<string>auto</string>
<string>portrait</string>
<string>landscape</string>
</array>
</dict>
<dict>
<key>DefaultValue</key>
<true/>

Binary file not shown.

View file

@ -122,6 +122,7 @@
639CEB061A1DF4F1004DE38F /* UIChatRoomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB081A1DF4F1004DE38F /* UIChatRoomCell.xib */; };
639CEB091A1DF4FA004DE38F /* UIChatCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB0B1A1DF4FA004DE38F /* UIChatCell.xib */; };
63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */; };
63FB30351A680E73008CA393 /* UIRoundedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63FB30341A680E73008CA393 /* UIRoundedImageView.m */; };
70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; };
7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; };
70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; };
@ -976,6 +977,8 @@
63CD4B4D1A5AAC8C00B84282 /* DTAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTAlertView.h; sourceTree = "<group>"; };
63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTAlertView.m; sourceTree = "<group>"; };
63EF7FDC1A24B5810017A416 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/AboutViewController.strings; sourceTree = "<group>"; };
63FB30331A680E73008CA393 /* UIRoundedImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIRoundedImageView.h; sourceTree = "<group>"; };
63FB30341A680E73008CA393 /* UIRoundedImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIRoundedImageView.m; sourceTree = "<group>"; };
70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = "liblinphone-sdk/apple-darwin/share/linphone/rootca.pem"; sourceTree = "<group>"; };
7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = "<group>"; };
70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
@ -2066,6 +2069,8 @@
2214EBF212F86360002A5394 /* UIMicroButton.m */,
D36FB2D31589EF7C0036F6F2 /* UIPauseButton.h */,
D36FB2D41589EF7C0036F6F2 /* UIPauseButton.m */,
63FB30331A680E73008CA393 /* UIRoundedImageView.h */,
63FB30341A680E73008CA393 /* UIRoundedImageView.m */,
22968A5D12F875C600588287 /* UISpeakerButton.h */,
22968A5E12F875C600588287 /* UISpeakerButton.m */,
D354981E1587716B000081D8 /* UIStateBar.h */,
@ -3792,6 +3797,7 @@
D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */,
D3E8F68615ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */,
C90FAA7915AF54E6002091CB /* HistoryDetailsViewController.m in Sources */,
63FB30351A680E73008CA393 /* UIRoundedImageView.m in Sources */,
F066515517F9A02E0064280C /* UITransparentTVCell.m in Sources */,
D3F9A9EE15AF277E0045320F /* UACellBackgroundView.m in Sources */,
D35860D615B549B500513429 /* Utils.m in Sources */,

@ -1 +1 @@
Subproject commit 18040383bd13a5c683934df6744d99aee4a1231b
Subproject commit e46939b25c990d825d94c2d526c350a1380db67f

View file

@ -183,7 +183,6 @@
225D65871521C009008B2E81 /* telephonyevents.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA6D711F6CF9F00621220 /* telephonyevents.c */; };
225D65881521C009008B2E81 /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA6F211F6CF9F00621220 /* utils.c */; };
225D65B81521C009008B2E81 /* netsim.c in Sources */ = {isa = PBXBuildFile; fileRef = F4D9F23D145710540035B0D0 /* netsim.c */; };
225D65B91521C009008B2E81 /* ortp_srtp.c in Sources */ = {isa = PBXBuildFile; fileRef = F4D9F23E145710540035B0D0 /* ortp_srtp.c */; };
225D65BF1521C009008B2E81 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
225D65CC1521C195008B2E81 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 225D64F81521BFA6008B2E81 /* libmediastreamer_base.a */; };
225D65CD1521C19A008B2E81 /* libortp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 225D65C51521C009008B2E81 /* libortp.a */; };
@ -346,6 +345,8 @@
F02538F7197948C9002C30F3 /* rtcp_xr.c in Sources */ = {isa = PBXBuildFile; fileRef = F02538F3197948BE002C30F3 /* rtcp_xr.c */; };
F02538F919794908002C30F3 /* flowcontrol.c in Sources */ = {isa = PBXBuildFile; fileRef = F02538F819794908002C30F3 /* flowcontrol.c */; };
F02538FB1979491B002C30F3 /* videostarter.c in Sources */ = {isa = PBXBuildFile; fileRef = F02538FA1979491B002C30F3 /* videostarter.c */; };
F0340ADD1A6D13BD002E4BF1 /* ms_srtp.c in Sources */ = {isa = PBXBuildFile; fileRef = F0340ADC1A6D13BD002E4BF1 /* ms_srtp.c */; };
F0340ADF1A6D13FF002E4BF1 /* zrtp.c in Sources */ = {isa = PBXBuildFile; fileRef = F0340ADE1A6D13FF002E4BF1 /* zrtp.c */; };
F0497F021A1652F100B67112 /* mediastreamer2_neon_tester.c in Sources */ = {isa = PBXBuildFile; fileRef = F0ED9B981A164D7200A788CE /* mediastreamer2_neon_tester.c */; };
F0497F0C1A1B483E00B67112 /* zrtp.c in Sources */ = {isa = PBXBuildFile; fileRef = F0497F0B1A1B483E00B67112 /* zrtp.c */; };
F0497F0E1A1B4C1700B67112 /* mediastreamer2_tester_ios.m in Sources */ = {isa = PBXBuildFile; fileRef = F0497F0D1A1B4C1700B67112 /* mediastreamer2_tester_ios.m */; };
@ -366,9 +367,7 @@
F0ED99471A1645C200A788CE /* hello8000-1s.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0ED992B1A1645C200A788CE /* hello8000-1s.wav */; };
F0ED99481A1645C200A788CE /* hello8000.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0ED992C1A1645C200A788CE /* hello8000.wav */; };
F0ED99491A1645C200A788CE /* hello_opus.mka in Resources */ = {isa = PBXBuildFile; fileRef = F0ED992D1A1645C200A788CE /* hello_opus.mka */; };
F0ED994A1A1645C200A788CE /* hello_opus_h264.mkv in Resources */ = {isa = PBXBuildFile; fileRef = F0ED992E1A1645C200A788CE /* hello_opus_h264.mkv */; };
F0ED994B1A1645C200A788CE /* hello_pcmu.mka in Resources */ = {isa = PBXBuildFile; fileRef = F0ED992F1A1645C200A788CE /* hello_pcmu.mka */; };
F0ED994C1A1645C200A788CE /* hello_pcmu_h264.mkv in Resources */ = {isa = PBXBuildFile; fileRef = F0ED99301A1645C200A788CE /* hello_pcmu_h264.mkv */; };
F0ED994D1A1645C200A788CE /* laserrocket_16000_mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0ED99311A1645C200A788CE /* laserrocket_16000_mono.wav */; };
F0ED994E1A1645C200A788CE /* nylon_48000_mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0ED99321A1645C200A788CE /* nylon_48000_mono.wav */; };
F0ED994F1A1645C200A788CE /* owl_44100_mono.wav in Resources */ = {isa = PBXBuildFile; fileRef = F0ED99331A1645C200A788CE /* owl_44100_mono.wav */; };
@ -765,6 +764,8 @@
F02538F3197948BE002C30F3 /* rtcp_xr.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rtcp_xr.c; sourceTree = "<group>"; };
F02538F819794908002C30F3 /* flowcontrol.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = flowcontrol.c; sourceTree = "<group>"; };
F02538FA1979491B002C30F3 /* videostarter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = videostarter.c; sourceTree = "<group>"; };
F0340ADC1A6D13BD002E4BF1 /* ms_srtp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ms_srtp.c; sourceTree = "<group>"; };
F0340ADE1A6D13FF002E4BF1 /* zrtp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zrtp.c; sourceTree = "<group>"; };
F0497F0B1A1B483E00B67112 /* zrtp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zrtp.c; sourceTree = "<group>"; };
F0497F0D1A1B4C1700B67112 /* mediastreamer2_tester_ios.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = mediastreamer2_tester_ios.m; sourceTree = "<group>"; };
F0497F151A1C9F8700B67112 /* mediastream-tester-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "mediastream-tester-Info.plist"; sourceTree = "<group>"; };
@ -804,7 +805,6 @@
F0ED9B961A164A4800A788CE /* msmediaplayer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msmediaplayer.c; sourceTree = "<group>"; };
F0ED9B981A164D7200A788CE /* mediastreamer2_neon_tester.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mediastreamer2_neon_tester.c; sourceTree = "<group>"; };
F4D9F23D145710540035B0D0 /* netsim.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = netsim.c; sourceTree = "<group>"; };
F4D9F23E145710540035B0D0 /* ortp_srtp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ortp_srtp.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -1040,20 +1040,21 @@
222CA5DC11F6CF7600621220 /* src */ = {
isa = PBXGroup;
children = (
F0ED99161A1645C200A788CE /* tester */,
222CA5DD11F6CF7600621220 /* .gitignore */,
222CA5F911F6CF7600621220 /* Makefile.am */,
2252935A12F6CA4700DD9BFB /* ec-calibrator.c */,
2203127413A249F70049A2ED /* filter-template.c */,
221DCB6A153584410025E54D /* yuv2rgb.fs */,
222CA5FA11F6CF7600621220 /* Makefile.in */,
221DCB6B153584410025E54D /* yuv2rgb.vs */,
223CA7EF16D9268D00EF1BEC /* audiofilters */,
223CA81116D9268D00EF1BEC /* base */,
F0340ADB1A6D13BD002E4BF1 /* crypto */,
223CA81A16D9268D00EF1BEC /* otherfilters */,
F0ED99161A1645C200A788CE /* tester */,
223CA82016D9268D00EF1BEC /* utils */,
223CA83316D9268D00EF1BEC /* videofilters */,
223CA84E16D9268D00EF1BEC /* voip */,
222CA5DD11F6CF7600621220 /* .gitignore */,
2252935A12F6CA4700DD9BFB /* ec-calibrator.c */,
2203127413A249F70049A2ED /* filter-template.c */,
222CA5F911F6CF7600621220 /* Makefile.am */,
222CA5FA11F6CF7600621220 /* Makefile.in */,
221DCB6A153584410025E54D /* yuv2rgb.fs */,
221DCB6B153584410025E54D /* yuv2rgb.vs */,
);
path = src;
sourceTree = "<group>";
@ -1110,7 +1111,6 @@
222CA6C011F6CF9F00621220 /* master */,
F4D9F23D145710540035B0D0 /* netsim.c */,
222CA6C211F6CF9F00621220 /* ortp.c */,
F4D9F23E145710540035B0D0 /* ortp_srtp.c */,
222CA6C311F6CF9F00621220 /* payloadtype.c */,
222CA6C411F6CF9F00621220 /* port.c */,
222CA6C511F6CF9F00621220 /* posixtimer.c */,
@ -1278,6 +1278,7 @@
223CA86616D9268D00EF1BEC /* videostream.c */,
F02538E71979481D002C30F3 /* vp8rtpfmt.c */,
F02538E81979481D002C30F3 /* vp8rtpfmt.h */,
F0340ADE1A6D13FF002E4BF1 /* zrtp.c */,
F0497F0B1A1B483E00B67112 /* zrtp.c */,
);
path = voip;
@ -1312,6 +1313,14 @@
name = "Supporting Files";
sourceTree = "<group>";
};
F0340ADB1A6D13BD002E4BF1 /* crypto */ = {
isa = PBXGroup;
children = (
F0340ADC1A6D13BD002E4BF1 /* ms_srtp.c */,
);
path = crypto;
sourceTree = "<group>";
};
F0ED99161A1645C200A788CE /* tester */ = {
isa = PBXGroup;
children = (
@ -1783,12 +1792,10 @@
F0ED99441A1645C200A788CE /* chimes_48000_stereo.wav in Resources */,
F0ED99361A1645C200A788CE /* Makefile.am in Resources */,
F0ED99431A1645C200A788CE /* bird_44100_stereo.wav in Resources */,
F0ED994C1A1645C200A788CE /* hello_pcmu_h264.mkv in Resources */,
F0ED99471A1645C200A788CE /* hello8000-1s.wav in Resources */,
2206D2E1177ACF5700C40726 /* nowebcamCIF.jpg in Resources */,
F0ED99501A1645C200A788CE /* piano_8000_stereo.wav in Resources */,
F0ED99461A1645C200A788CE /* hello16000.wav in Resources */,
F0ED994A1A1645C200A788CE /* hello_opus_h264.mkv in Resources */,
F0ED994B1A1645C200A788CE /* hello_pcmu.mka in Resources */,
F0ED99491A1645C200A788CE /* hello_opus.mka in Resources */,
F0ED99421A1645C200A788CE /* arpeggio_8000_mono.wav in Resources */,
@ -1886,7 +1893,6 @@
225D65871521C009008B2E81 /* telephonyevents.c in Sources */,
225D65881521C009008B2E81 /* utils.c in Sources */,
225D65B81521C009008B2E81 /* netsim.c in Sources */,
225D65B91521C009008B2E81 /* ortp_srtp.c in Sources */,
22405EE51600671D00B92522 /* logging.c in Sources */,
22405EE61600671D00B92522 /* rtpprofile.c in Sources */,
);
@ -1912,6 +1918,7 @@
22C8D0A61769F8FF00DAFB4E /* msfileplayer.c in Sources */,
22C8D0A71769F8FF00DAFB4E /* msfilerec.c in Sources */,
22C8D0A81769F8FF00DAFB4E /* msg722.c in Sources */,
F0340ADD1A6D13BD002E4BF1 /* ms_srtp.c in Sources */,
22C8D0A91769F8FF00DAFB4E /* msiounit.m in Sources */,
22C8D0AA1769F8FF00DAFB4E /* msresample.c in Sources */,
22C8D0AB1769F8FF00DAFB4E /* msspeex.c in Sources */,
@ -1950,6 +1957,7 @@
22C8D0D11769F8FF00DAFB4E /* bitratecontrol.c in Sources */,
22C8D0D21769F8FF00DAFB4E /* bitratedriver.c in Sources */,
22C8D0D31769F8FF00DAFB4E /* ice.c in Sources */,
F0340ADF1A6D13FF002E4BF1 /* zrtp.c in Sources */,
22C8D0D41769F8FF00DAFB4E /* layouts.c in Sources */,
22C8D0D51769F8FF00DAFB4E /* mediastream.c in Sources */,
22C8D0D61769F8FF00DAFB4E /* msvideo.c in Sources */,

@ -1 +1 @@
Subproject commit c0870da1e7e360dadc511bc404f7f5a24f56e4f8
Subproject commit b4dc7b3868a6fe6f5aa9ece5c08d28393ba0e8dd