From 1ef6bf2fc7bb35a0ba282123c383ca2115898510 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 26 Aug 2013 11:03:03 +0200 Subject: [PATCH] only repport registration error due to bad credential --- Classes/PhoneMainView.m | 44 +++++++++--------------------- linphone.xcodeproj/project.pbxproj | 4 +-- submodules/belle-sip | 2 +- submodules/linphone | 2 +- 4 files changed, 16 insertions(+), 36 deletions(-) diff --git a/Classes/PhoneMainView.m b/Classes/PhoneMainView.m index 50fd131d6..d219b99f5 100644 --- a/Classes/PhoneMainView.m +++ b/Classes/PhoneMainView.m @@ -211,42 +211,24 @@ static PhoneMainView* phoneMainViewInstance=nil; [self updateApplicationBadgeNumber]; } -- (void)registrationUpdate:(NSNotification*)notif { +- (void)registrationUpdate:(NSNotification*)notif { LinphoneRegistrationState state = [[notif.userInfo objectForKey: @"state"] intValue]; LinphoneProxyConfig *cfg = [[notif.userInfo objectForKey: @"cfg"] pointerValue]; - // Show error - if (state == LinphoneRegistrationFailed) { - NSString* lErrorMessage = nil; - LinphoneReason reason = linphone_proxy_config_get_error(cfg); - if (reason == LinphoneReasonBadCredentials) { - lErrorMessage = NSLocalizedString(@"Bad credentials, check your account settings", nil); - } else if (reason == LinphoneReasonNoResponse) { - lErrorMessage = NSLocalizedString(@"SIP server unreachable", nil); - } else { - lErrorMessage = NSLocalizedString(@"Unknown error", nil); - } - - if (lErrorMessage != nil && linphone_proxy_config_get_error(cfg) != LinphoneReasonNoResponse) { - //do not report network connection issue on registration - //default behavior if no registration delegates - UIApplicationState s = [UIApplication sharedApplication].applicationState; - - // do not stack error message when going to backgroud - if (s != UIApplicationStateBackground) { - UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Registration failure",nil) - message:lErrorMessage - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue",nil) - otherButtonTitles:nil,nil]; - [error show]; - [error release]; - } - } - + //Only report bad credential issue + if (state == LinphoneRegistrationFailed + &&[UIApplication sharedApplication].applicationState != UIApplicationStateBackground + && linphone_proxy_config_get_error(cfg) == LinphoneReasonBadCredentials ) { + UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Registration failure",nil) + message:NSLocalizedString(@"Bad credentials, check your account settings", nil) + delegate:nil + cancelButtonTitle:NSLocalizedString(@"Continue",nil) + otherButtonTitles:nil,nil]; + [error show]; + [error release]; } } -- (void)callUpdate:(NSNotification*)notif { +- (void)callUpdate:(NSNotification*)notif { LinphoneCall *call = [[notif.userInfo objectForKey: @"call"] pointerValue]; LinphoneCallState state = [[notif.userInfo objectForKey: @"state"] intValue]; NSString *message = [notif.userInfo objectForKey: @"message"]; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 4636f6a60..dd056dab3 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -5789,7 +5789,7 @@ HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 4.3; LIBRARY_SEARCH_PATHS = ""; - PROVISIONING_PROFILE = "BB7E624F-8CD6-448B-A235-CE8DBB401F92"; + PROVISIONING_PROFILE = "0636A6EA-90EB-4D92-B707-19FC32F9A7CF"; SDKROOT = iphoneos; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; TARGETED_DEVICE_FAMILY = "1,2"; @@ -5801,7 +5801,6 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CODE_SIGN_ENTITLEMENTS = ""; - CODE_SIGN_IDENTITY = "iPhone Distribution: jehan monnier"; COMPRESS_PNG_FILES = NO; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ""; @@ -5833,7 +5832,6 @@ ORDER_FILE = ""; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = linphone; - PROVISIONING_PROFILE = "906D0BA7-CD8F-470C-A060-F0752867FC5D"; SKIP_INSTALL = NO; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/submodules/belle-sip b/submodules/belle-sip index 274ee4488..f10b5b4eb 160000 --- a/submodules/belle-sip +++ b/submodules/belle-sip @@ -1 +1 @@ -Subproject commit 274ee44882abdda62914a09cc9f2df38892ca336 +Subproject commit f10b5b4eb8dd5afc075d006f4cea108d662f5f41 diff --git a/submodules/linphone b/submodules/linphone index 01d35e5b5..6d0e4f352 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 01d35e5b53fca8358e2b9b8dc67d47b4cca4327f +Subproject commit 6d0e4f3525a56577cd3b0d2b48856e81227c7529