diff --git a/Classes/Base.lproj/CallOutgoingView.xib b/Classes/Base.lproj/CallOutgoingView.xib index 3b99f6ebc..ee5560114 100644 --- a/Classes/Base.lproj/CallOutgoingView.xib +++ b/Classes/Base.lproj/CallOutgoingView.xib @@ -60,7 +60,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -86,7 +86,7 @@ - + diff --git a/Classes/FirstLoginView.m b/Classes/FirstLoginView.m index e71a5ae4a..13a91ebed 100644 --- a/Classes/FirstLoginView.m +++ b/Classes/FirstLoginView.m @@ -163,39 +163,18 @@ static UICompositeViewDescription *compositeDescription = nil; } - (void)onLoginClick:(id)sender { - NSString *errorMessage = nil; - if ([_usernameField.text length] == 0) { - errorMessage = NSLocalizedString(@"Enter your username", nil); - } else if ([_passwordField.text length] == 0) { - errorMessage = NSLocalizedString(@"Enter your password", nil); - } - - if (errorMessage != nil) { - UIAlertView *error = nil; - error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Alert", nil) - message:errorMessage - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Continue", nil) - otherButtonTitles:nil]; - [error show]; - } else { - linphone_core_clear_all_auth_info([LinphoneManager getLc]); - linphone_core_clear_proxy_config([LinphoneManager getLc]); - LinphoneProxyConfig *proxyCfg = linphone_core_create_proxy_config([LinphoneManager getLc]); - /*default domain is supposed to be preset from linphonerc*/ - NSString *identity = - [NSString stringWithFormat:@"sip:%@@%s", _usernameField.text, linphone_proxy_config_get_addr(proxyCfg)]; - linphone_proxy_config_set_identity(proxyCfg, [identity UTF8String]); - LinphoneAuthInfo *auth_info = linphone_auth_info_new( - [_usernameField.text UTF8String], [_usernameField.text UTF8String], [_passwordField.text UTF8String], NULL, - NULL, linphone_proxy_config_get_domain(proxyCfg)); - linphone_core_add_auth_info([LinphoneManager getLc], auth_info); - linphone_core_add_proxy_config([LinphoneManager getLc], proxyCfg); - linphone_core_set_default_proxy_config([LinphoneManager getLc], proxyCfg); - // reload address book to prepend proxy config domain to contacts' phone number - [[[LinphoneManager instance] fastAddressBook] reload]; - [_waitView setHidden:false]; - }; + _waitView.hidden = NO; + [XMLRPCHelper GetProvisioningURL:_usernameField.text + password:_passwordField.text + domain:_domainField.text + OnSuccess:^(NSString *url) { + if (url) { + linphone_core_set_provisioning_uri([LinphoneManager getLc], url.UTF8String); + [[LinphoneManager instance] resetLinphoneCore]; + } else { + _waitView.hidden = YES; + } + }]; } #pragma mark - UITextFieldDelegate Functions diff --git a/Classes/FirstLoginView.xib b/Classes/FirstLoginView.xib index 088d14e18..e729c1fe6 100644 --- a/Classes/FirstLoginView.xib +++ b/Classes/FirstLoginView.xib @@ -63,6 +63,7 @@ + @@ -92,6 +93,7 @@ + diff --git a/Classes/LinphoneUI/UIAssistantTextField.m b/Classes/LinphoneUI/UIAssistantTextField.m index c034d2bc4..f7e64c945 100644 --- a/Classes/LinphoneUI/UIAssistantTextField.m +++ b/Classes/LinphoneUI/UIAssistantTextField.m @@ -52,6 +52,7 @@ INIT_WITH_COMMON { } - (void)textFieldDidEndEditing:(UITextField *)textField { + _lastText = textField.text; _canShowError = YES; [self checkDisplayError]; } diff --git a/main.m b/main.m index 9280fee88..c5b9e3fee 100644 --- a/main.m +++ b/main.m @@ -26,7 +26,7 @@ void uncaughtExceptionHandler(NSException *exception) { NSLog(@"Crash: %@", exception); NSLog(@"Stack Trace: %@", [exception callStackSymbols]); - // Internal error reportingstx + // Internal error reporting }; #endif