mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
tunnel: remove deprecated API calls
This commit is contained in:
parent
576141c2a4
commit
ea272d6bdf
5 changed files with 7 additions and 59 deletions
|
|
@ -21,6 +21,7 @@
|
|||
#import "Utils.h"
|
||||
|
||||
#include "linphone/lpconfig.h"
|
||||
#include "linphone/linphone_tunnel.h"
|
||||
|
||||
@implementation LinphoneCoreSettingsStore
|
||||
|
||||
|
|
@ -758,7 +759,7 @@
|
|||
NSString *lTunnelPrefAddress = [self stringForKey:@"tunnel_address_preference"];
|
||||
int lTunnelPrefPort = [self integerForKey:@"tunnel_port_preference"];
|
||||
LinphoneTunnel *tunnel = linphone_core_get_tunnel(LC);
|
||||
TunnelMode mode = tunnel_off;
|
||||
LinphoneTunnelMode mode = LinphoneTunnelModeDisable;
|
||||
int lTunnelPort = 443;
|
||||
if (lTunnelPrefPort) {
|
||||
lTunnelPort = lTunnelPrefPort;
|
||||
|
|
@ -772,20 +773,18 @@
|
|||
linphone_tunnel_add_server(tunnel, ltc);
|
||||
|
||||
if ([lTunnelPrefMode isEqualToString:@"off"]) {
|
||||
mode = tunnel_off;
|
||||
mode = LinphoneTunnelModeDisable;
|
||||
} else if ([lTunnelPrefMode isEqualToString:@"on"]) {
|
||||
mode = tunnel_on;
|
||||
} else if ([lTunnelPrefMode isEqualToString:@"wwan"]) {
|
||||
mode = tunnel_wwan;
|
||||
mode = LinphoneTunnelModeEnable;
|
||||
} else if ([lTunnelPrefMode isEqualToString:@"auto"]) {
|
||||
mode = tunnel_auto;
|
||||
mode = LinphoneTunnelModeAuto;
|
||||
} else {
|
||||
LOGE(@"Unexpected tunnel mode [%s]", [lTunnelPrefMode UTF8String]);
|
||||
}
|
||||
}
|
||||
|
||||
[lm lpConfigSetString:lTunnelPrefMode forKey:@"tunnel_mode_preference"];
|
||||
[LinphoneManager.instance setTunnelMode:mode];
|
||||
linphone_tunnel_set_mode(tunnel, mode);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#import "InAppProductsManager.h"
|
||||
|
||||
#include "linphone/linphonecore.h"
|
||||
#include "linphone/linphone_tunnel.h"
|
||||
|
||||
extern NSString *const LINPHONERC_APPLICATION_KEY;
|
||||
|
||||
|
|
@ -64,13 +63,6 @@ typedef enum _NetworkType {
|
|||
network_wifi
|
||||
} NetworkType;
|
||||
|
||||
typedef enum _TunnelMode {
|
||||
tunnel_off = 0,
|
||||
tunnel_on,
|
||||
tunnel_wwan,
|
||||
tunnel_auto
|
||||
} TunnelMode;
|
||||
|
||||
typedef enum _Connectivity {
|
||||
wifi,
|
||||
wwan,
|
||||
|
|
@ -208,7 +200,6 @@ typedef struct _LinphoneManagerSounds {
|
|||
@property (nonatomic, assign) BOOL bluetoothAvailable;
|
||||
@property (nonatomic, assign) BOOL bluetoothEnabled;
|
||||
@property (readonly) ALAssetsLibrary *photoLibrary;
|
||||
@property (nonatomic, assign) TunnelMode tunnelMode;
|
||||
@property (readonly) NSString* contactSipField;
|
||||
@property (readonly,copy) NSString* contactFilter;
|
||||
@property (copy) void (^silentPushCompletion)(UIBackgroundFetchResult);
|
||||
|
|
|
|||
|
|
@ -248,7 +248,6 @@ struct codec_name_pref_table codec_pref_table[] = {{"speex", 8000, "speex_8k_pre
|
|||
_database = NULL;
|
||||
_speakerEnabled = FALSE;
|
||||
_bluetoothEnabled = FALSE;
|
||||
_tunnelMode = FALSE;
|
||||
|
||||
_fileTransferDelegates = [[NSMutableArray alloc] init];
|
||||
|
||||
|
|
@ -1210,7 +1209,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
lm.connectivity = none;
|
||||
[LinphoneManager kickOffNetworkConnection];
|
||||
} else {
|
||||
LinphoneTunnel *tunnel = linphone_core_get_tunnel(LC);
|
||||
Connectivity newConnectivity;
|
||||
BOOL isWifiOnly = [lm lpConfigBoolForKey:@"wifi_only_preference" withDefault:FALSE];
|
||||
if (!ctx || ctx->testWWan)
|
||||
|
|
@ -1229,8 +1227,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
}
|
||||
|
||||
if (lm.connectivity != newConnectivity) {
|
||||
if (tunnel)
|
||||
linphone_tunnel_reconnect(tunnel);
|
||||
// connectivity has changed
|
||||
linphone_core_set_network_reachable(theLinphoneCore, false);
|
||||
if (newConnectivity == wwan && proxy && isWifiOnly) {
|
||||
|
|
@ -1241,17 +1237,6 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
LOGI(@"Network connectivity changed to type [%s]", (newConnectivity == wifi ? "wifi" : "wwan"));
|
||||
}
|
||||
lm.connectivity = newConnectivity;
|
||||
switch (lm.tunnelMode) {
|
||||
case tunnel_wwan:
|
||||
linphone_tunnel_enable(tunnel, lm.connectivity == wwan);
|
||||
break;
|
||||
case tunnel_auto:
|
||||
linphone_tunnel_auto_detect(tunnel);
|
||||
break;
|
||||
default:
|
||||
// nothing to do
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ctx && ctx->networkStateChanged) {
|
||||
(*ctx->networkStateChanged)(lm.connectivity);
|
||||
|
|
@ -2343,31 +2328,6 @@ static int comp_call_state_paused(const LinphoneCall *call, const void *param) {
|
|||
return filter;
|
||||
}
|
||||
|
||||
#pragma Tunnel
|
||||
|
||||
- (void)setTunnelMode:(TunnelMode)atunnelMode {
|
||||
LinphoneTunnel *tunnel = linphone_core_get_tunnel(theLinphoneCore);
|
||||
_tunnelMode = atunnelMode;
|
||||
switch (_tunnelMode) {
|
||||
case tunnel_off:
|
||||
linphone_tunnel_enable(tunnel, false);
|
||||
break;
|
||||
case tunnel_on:
|
||||
linphone_tunnel_enable(tunnel, true);
|
||||
break;
|
||||
case tunnel_wwan:
|
||||
if (connectivity != wwan) {
|
||||
linphone_tunnel_enable(tunnel, false);
|
||||
} else {
|
||||
linphone_tunnel_enable(tunnel, true);
|
||||
}
|
||||
break;
|
||||
case tunnel_auto:
|
||||
linphone_tunnel_auto_detect(tunnel);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - InApp Purchase events
|
||||
|
||||
- (void)inappReady:(NSNotification *)notif {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@
|
|||
<array>
|
||||
<string>Off</string>
|
||||
<string>On</string>
|
||||
<string>WWAN</string>
|
||||
<string>Auto</string>
|
||||
</array>
|
||||
<key>Key</key>
|
||||
|
|
@ -24,7 +23,6 @@
|
|||
<array>
|
||||
<string>off</string>
|
||||
<string>on</string>
|
||||
<string>wwan</string>
|
||||
<string>auto</string>
|
||||
</array>
|
||||
</dict>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit fa75613e8e8a042c78b76972ca14398bc82549cf
|
||||
Subproject commit 88e593e944cafecfc63ddbff23038fff96325ba7
|
||||
Loading…
Add table
Reference in a new issue