mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
fix auroc tunnel not enabled on first start
fix advanced settings section remove http link from first login page
This commit is contained in:
parent
2f61bb4ee1
commit
139b99fad6
8 changed files with 45 additions and 36 deletions
|
|
@ -129,7 +129,7 @@ end:
|
|||
[error show];
|
||||
} else {
|
||||
//[self.view removeFromSuperview:self];
|
||||
if ([mainDelegate initProxySettings]) {
|
||||
if ([mainDelegate initProxyAndTunnelSettings]) {
|
||||
[self.activityIndicator setHidden:false];
|
||||
} else {
|
||||
error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Error",nil)
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
</object>
|
||||
<object class="IBUIButton" id="731646357">
|
||||
<reference key="NSNextResponder" ref="191373211"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<int key="NSvFlags">-2147483356</int>
|
||||
<string key="NSFrame">{{25, 319}, {184, 37}}</string>
|
||||
<reference key="NSSuperview" ref="191373211"/>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
|
|
|
|||
|
|
@ -298,7 +298,11 @@
|
|||
// e.g. self.myOutlet = nil;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[self setTunnelState:[linphoneDelegate isTunnel]];
|
||||
}
|
||||
*/
|
||||
-(void) dismissAlertDialog:(UIAlertView*) alertView{
|
||||
[alertView dismissWithClickedButtonIndex:0 animated:TRUE];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
/*
|
||||
* return true if register is activated
|
||||
*/
|
||||
-(bool)initProxySettings;
|
||||
-(bool)initProxyAndTunnelSettings;
|
||||
/* return new tunnel state*/
|
||||
-(bool) toggleTunnel;
|
||||
-(bool) isTunnel;
|
||||
|
|
@ -89,7 +89,6 @@ bool networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
-(void) enableTunnel;
|
||||
-(void) disableTunnel;
|
||||
-(void) doRegister;
|
||||
-(void) doUnRegister;
|
||||
|
||||
-(PayloadType*) findPayload:(NSString*)type withRate:(int)rate from:(const MSList*)list;
|
||||
|
||||
|
|
|
|||
|
|
@ -267,33 +267,6 @@ LinphoneCoreVTable linphone_iphone_vtable = {
|
|||
[factoryConfigFile cStringUsingEncoding:[NSString defaultCStringEncoding]],
|
||||
self);
|
||||
|
||||
//tunneling config
|
||||
isTunnelConfigured = [[NSUserDefaults standardUserDefaults] boolForKey:@"tunnelenable_preference"];
|
||||
NSString* username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"];
|
||||
NSString* axtelPin = [[NSUserDefaults standardUserDefaults] stringForKey:@"axtelpin_preference"];
|
||||
|
||||
if (isTunnelConfigured) {
|
||||
const char* tunnelIp=axtunnel_get_ip_from_key([username cStringUsingEncoding:[NSString defaultCStringEncoding]]
|
||||
,[axtelPin cStringUsingEncoding:[NSString defaultCStringEncoding]] );
|
||||
if(!tunnelIp) {
|
||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Alert",nil)
|
||||
message:NSLocalizedString(@"Wrong axtel number or pin, disabling tunnel",nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
isTunnelConfigured=false;
|
||||
isTunnel=false;
|
||||
|
||||
} else {
|
||||
linphone_iphone_tunneling_init(tunnelIp,443,isDebug);
|
||||
isTunnel=true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isTunnel) {
|
||||
linphone_iphone_enable_tunneling(myLinphoneCore);
|
||||
}
|
||||
|
||||
// Set audio assets
|
||||
const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||
|
|
@ -304,7 +277,7 @@ LinphoneCoreVTable linphone_iphone_vtable = {
|
|||
//init proxy config if not first login
|
||||
bool isFirstLoginDone = [[NSUserDefaults standardUserDefaults] boolForKey:@"firstlogindone_preference"];
|
||||
if (isFirstLoginDone) {
|
||||
[self initProxySettings];
|
||||
[self initProxyAndTunnelSettings];
|
||||
}
|
||||
//Configure Codecs
|
||||
|
||||
|
|
@ -363,11 +336,40 @@ LinphoneCoreVTable linphone_iphone_vtable = {
|
|||
repeats:YES];
|
||||
|
||||
}
|
||||
-(bool)initProxySettings {
|
||||
-(bool)initProxyAndTunnelSettings {
|
||||
//tunneling config
|
||||
isTunnelConfigured = [[NSUserDefaults standardUserDefaults] boolForKey:@"tunnelenable_preference"];
|
||||
NSString* username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"];
|
||||
NSString* axtelPin = [[NSUserDefaults standardUserDefaults] stringForKey:@"axtelpin_preference"];
|
||||
|
||||
if (isTunnelConfigured) {
|
||||
const char* tunnelIp=axtunnel_get_ip_from_key([username cStringUsingEncoding:[NSString defaultCStringEncoding]]
|
||||
,[axtelPin cStringUsingEncoding:[NSString defaultCStringEncoding]] );
|
||||
if(!tunnelIp) {
|
||||
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Alert",nil)
|
||||
message:NSLocalizedString(@"Wrong axtel number or pin, disabling tunnel",nil)
|
||||
delegate:nil
|
||||
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
isTunnelConfigured=false;
|
||||
isTunnel=false;
|
||||
|
||||
} else {
|
||||
linphone_iphone_tunneling_init(tunnelIp,443,isDebug);
|
||||
isTunnel=true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isTunnel) {
|
||||
linphone_iphone_enable_tunneling(myLinphoneCore);
|
||||
}
|
||||
|
||||
[myPhoneViewController setTunnelState:isTunnel];
|
||||
|
||||
//configure sip account
|
||||
//get data from Settings bundle
|
||||
NSString* accountNameUri = [[NSUserDefaults standardUserDefaults] stringForKey:@"account_preference"];
|
||||
NSString* username = [[NSUserDefaults standardUserDefaults] stringForKey:@"username_preference"];
|
||||
NSString* domain = [[NSUserDefaults standardUserDefaults] stringForKey:@"domain_preference"];
|
||||
if (!accountNameUri) {
|
||||
accountNameUri = [NSString stringWithFormat:@"sip:%@@%@",username,domain];
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@
|
|||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Advance</string>
|
||||
<string>Advanced</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
|
|
|
|||
|
|
@ -12,3 +12,5 @@
|
|||
"enable Auroc" = "enable Auroc";
|
||||
|
||||
"Axtel PIN" = "Axtel PIN";
|
||||
|
||||
"Advanced" = "Advanced";
|
||||
|
|
|
|||
|
|
@ -12,3 +12,5 @@
|
|||
"enable Auroc" = "Habilitar AXTEL Key";
|
||||
|
||||
"Axtel PIN" = "AXTEL Key";
|
||||
|
||||
"Advanced" = "Avanzado";
|
||||
Loading…
Add table
Reference in a new issue