Add registration failure additionnal message

Change sip to viewer mode
This commit is contained in:
Yann Diorcet 2012-09-28 12:06:33 +02:00
parent fe5b67bac5
commit e5cf9331c9
8 changed files with 43 additions and 12 deletions

View file

@ -423,7 +423,7 @@ static void linphone_iphone_transfer_state_changed(LinphoneCore* lc, LinphoneCal
#pragma mark - Registration State Functions
-(void) onRegister:(LinphoneCore *)lc cfg:(LinphoneProxyConfig*) cfg state:(LinphoneRegistrationState) state message:(const char*) message {
- (void)onRegister:(LinphoneCore *)lc cfg:(LinphoneProxyConfig*) cfg state:(LinphoneRegistrationState) state message:(const char*) message {
[LinphoneLogger logc:LinphoneLoggerLog format:"NEW REGISTRATION STATE: '%s' (message: '%s')", linphone_registration_state_to_string(state), message];
if (state==LinphoneRegistrationOk)
[LinphoneManager instance]->stopWaitingRegisters=TRUE;

View file

@ -283,12 +283,15 @@ static PhoneMainView* phoneMainViewInstance=nil;
LinphoneProxyConfig *cfg = [[notif.userInfo objectForKey: @"cfg"] pointerValue];
// Show error
if (state == LinphoneRegistrationFailed) {
NSString* lErrorMessage=nil;
if (linphone_proxy_config_get_error(cfg) == LinphoneReasonBadCredentials) {
lErrorMessage = NSLocalizedString(@"Bad credentials, check your account settings",nil);
} else if (linphone_proxy_config_get_error(cfg) == LinphoneReasonNoResponse) {
lErrorMessage = NSLocalizedString(@"SIP server unreachable",nil);
}
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

View file

@ -351,6 +351,7 @@ static UICompositeViewDescription *compositeDescription = nil;
}
- (void)addProxyConfig:(NSString*)username password:(NSString*)password domain:(NSString*)domain server:(NSString*)server {
[self clearProxyConfig];
if(server == nil) {
server = domain;
}
@ -777,8 +778,10 @@ static UICompositeViewDescription *compositeDescription = nil;
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
if ([touch.view isKindOfClass:[UIButton class]]) { //Avoid tap gesture on Button
[LinphoneUtils findAndResignFirstResponder:currentView];
return NO;
if([LinphoneUtils findAndResignFirstResponder:currentView]) {
[(UIButton*)touch.view sendActionsForControlEvents:UIControlEventTouchUpInside];
return NO;
}
}
return YES;
}

View file

@ -47,7 +47,7 @@
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<string>Viewer</string>
<key>CFBundleURLIconFile</key>
<string>linphone_icon_72@2x</string>
<key>CFBundleURLName</key>

View file

@ -11997,7 +11997,7 @@
</dict>
</dict>
<key>change date</key>
<date>2012-09-28T08:39:17Z</date>
<date>2012-09-28T09:53:17Z</date>
<key>changed values</key>
<array/>
<key>class</key>
@ -12007,7 +12007,7 @@
<key>flags</key>
<integer>0</integer>
<key>hash</key>
<string>974d882db652398dc5678a38298fec69
<string>301ca0dd125a814aec815b3dce0b61e4
</string>
<key>name</key>
<string>Localizable.strings</string>
@ -14226,6 +14226,31 @@ La cause était: %2$@</string>
<key>snapshots</key>
<dict/>
</dict>
<dict>
<key>change date</key>
<date>2001-01-01T00:00:00Z</date>
<key>changed values</key>
<array/>
<key>class</key>
<string>BLStringKeyObject</string>
<key>comment</key>
<string>No comment provided by engineer.</string>
<key>errors</key>
<array/>
<key>flags</key>
<integer>0</integer>
<key>key</key>
<string>Unknown error</string>
<key>localizations</key>
<dict>
<key>en</key>
<string>Unknown error</string>
<key>fr</key>
<string>Erreur inconnue</string>
</dict>
<key>snapshots</key>
<dict/>
</dict>
<dict>
<key>change date</key>
<date>2001-01-01T00:00:00Z</date>