mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
ios: enable TLS support
This commit is contained in:
parent
39e8d340b0
commit
7e05d67379
5 changed files with 24 additions and 9 deletions
|
|
@ -381,6 +381,12 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
||||||
else {
|
else {
|
||||||
linphone_core_disable_logs();
|
linphone_core_disable_logs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSBundle* myBundle = [NSBundle mainBundle];
|
||||||
|
|
||||||
|
const char* lRootCa = [[myBundle pathForResource:@"rootca"ofType:@"pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||||
|
linphone_core_set_root_ca(theLinphoneCore, lRootCa);
|
||||||
|
|
||||||
NSString* transport = [[NSUserDefaults standardUserDefaults] stringForKey:@"transport_preference"];
|
NSString* transport = [[NSUserDefaults standardUserDefaults] stringForKey:@"transport_preference"];
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -393,9 +399,15 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
||||||
if ([transport isEqualToString:@"tcp"]) {
|
if ([transport isEqualToString:@"tcp"]) {
|
||||||
if (transportValue.tcp_port == 0) transportValue.tcp_port=transportValue.udp_port;
|
if (transportValue.tcp_port == 0) transportValue.tcp_port=transportValue.udp_port;
|
||||||
transportValue.udp_port=0;
|
transportValue.udp_port=0;
|
||||||
|
transportValue.tls_port=0;
|
||||||
} else if ([transport isEqualToString:@"udp"]){
|
} else if ([transport isEqualToString:@"udp"]){
|
||||||
if (transportValue.udp_port == 0) transportValue.udp_port=transportValue.tcp_port;
|
if (transportValue.udp_port == 0) transportValue.udp_port=transportValue.tcp_port;
|
||||||
transportValue.tcp_port=0;
|
transportValue.tcp_port=0;
|
||||||
|
transportValue.tls_port=0;
|
||||||
|
} else if ([transport isEqualToString:@"tls"]){
|
||||||
|
if (transportValue.tls_port == 0) transportValue.tls_port=transportValue.udp_port;
|
||||||
|
transportValue.tcp_port=0;
|
||||||
|
transportValue.udp_port=0;
|
||||||
} else {
|
} else {
|
||||||
ms_error("unexpected trasnport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
ms_error("unexpected trasnport [%s]",[transport cStringUsingEncoding:[NSString defaultCStringEncoding]]);
|
||||||
}
|
}
|
||||||
|
|
@ -404,17 +416,14 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Set audio assets
|
// Set audio assets
|
||||||
NSBundle* myBundle = [NSBundle mainBundle];
|
|
||||||
const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
const char* lRing = [[myBundle pathForResource:@"oldphone-mono"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||||
linphone_core_set_ring(theLinphoneCore, lRing );
|
linphone_core_set_ring(theLinphoneCore, lRing );
|
||||||
const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]];
|
||||||
linphone_core_set_ringback(theLinphoneCore, lRingBack);
|
linphone_core_set_ringback(theLinphoneCore, lRingBack);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//configure sip account
|
//configure sip account
|
||||||
|
|
@ -452,7 +461,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
||||||
//possible valid config detected
|
//possible valid config detected
|
||||||
LinphoneProxyConfig* proxyCfg;
|
LinphoneProxyConfig* proxyCfg;
|
||||||
proxyCfg = linphone_proxy_config_new();
|
proxyCfg = linphone_proxy_config_new();
|
||||||
|
|
||||||
// add username password
|
// add username password
|
||||||
LinphoneAddress *from = linphone_address_new(identity);
|
LinphoneAddress *from = linphone_address_new(identity);
|
||||||
LinphoneAuthInfo *info;
|
LinphoneAuthInfo *info;
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,7 @@
|
||||||
<array>
|
<array>
|
||||||
<string>udp</string>
|
<string>udp</string>
|
||||||
<string>tcp</string>
|
<string>tcp</string>
|
||||||
|
<string>tls</string>
|
||||||
</array>
|
</array>
|
||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSMultiValueSpecifier</string>
|
<string>PSMultiValueSpecifier</string>
|
||||||
|
|
@ -176,6 +177,7 @@
|
||||||
<array>
|
<array>
|
||||||
<string>udp</string>
|
<string>udp</string>
|
||||||
<string>tcp</string>
|
<string>tcp</string>
|
||||||
|
<string>tls</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@
|
||||||
22F3D57E13CCC89600A0DA02 /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22F3D57D13CCC89600A0DA02 /* liblinphone.a */; };
|
22F3D57E13CCC89600A0DA02 /* liblinphone.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22F3D57D13CCC89600A0DA02 /* liblinphone.a */; };
|
||||||
22F51EF6107FA66500F98953 /* untitled.plist in Resources */ = {isa = PBXBuildFile; fileRef = 22F51EF5107FA66500F98953 /* untitled.plist */; };
|
22F51EF6107FA66500F98953 /* untitled.plist in Resources */ = {isa = PBXBuildFile; fileRef = 22F51EF5107FA66500F98953 /* untitled.plist */; };
|
||||||
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
|
288765FD0DF74451002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765FC0DF74451002DB57D /* CoreGraphics.framework */; };
|
||||||
|
70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; };
|
||||||
7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; };
|
7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; };
|
||||||
70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; };
|
70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; };
|
||||||
70E542F513E147EB002BA2C0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F413E147EB002BA2C0 /* QuartzCore.framework */; };
|
70E542F513E147EB002BA2C0 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F413E147EB002BA2C0 /* QuartzCore.framework */; };
|
||||||
|
|
@ -439,6 +440,7 @@
|
||||||
288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
288765FC0DF74451002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||||
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||||
32CA4F630368D1EE00C91783 /* linphone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = linphone_Prefix.pch; sourceTree = "<group>"; };
|
32CA4F630368D1EE00C91783 /* linphone_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = linphone_Prefix.pch; sourceTree = "<group>"; };
|
||||||
|
70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = Resources/rootca.pem; sourceTree = "<group>"; };
|
||||||
7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = "<group>"; };
|
7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = "<group>"; };
|
||||||
70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
||||||
70E542F413E147EB002BA2C0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
70E542F413E147EB002BA2C0 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||||
|
|
@ -911,6 +913,7 @@
|
||||||
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
29B97317FDCFA39411CA2CEA /* Resources */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
70571E1913FABCB000CDD3C2 /* rootca.pem */,
|
||||||
22E19E47138A67A000FBFE87 /* missed_call.png */,
|
22E19E47138A67A000FBFE87 /* missed_call.png */,
|
||||||
228B19AE130290C500F154D3 /* iTunesArtwork */,
|
228B19AE130290C500F154D3 /* iTunesArtwork */,
|
||||||
2242E312125235120061DDCE /* oldphone-mono-30s.caf */,
|
2242E312125235120061DDCE /* oldphone-mono-30s.caf */,
|
||||||
|
|
@ -1059,6 +1062,7 @@
|
||||||
22E028B813B4CCBD0068A713 /* VideoViewController.xib in Resources */,
|
22E028B813B4CCBD0068A713 /* VideoViewController.xib in Resources */,
|
||||||
226B563F13CAF1CD00921595 /* audio.plist in Resources */,
|
226B563F13CAF1CD00921595 /* audio.plist in Resources */,
|
||||||
22E1A9E813CAF4AA00219531 /* video.plist in Resources */,
|
22E1A9E813CAF4AA00219531 /* video.plist in Resources */,
|
||||||
|
70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
2
submodules/externals/exosip
vendored
2
submodules/externals/exosip
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 361a5cfe25a31d503b0d9e46960d6908c6672aad
|
Subproject commit 7aba625f1c2a16cdac6b41b190cb2d46c8578cfe
|
||||||
2
submodules/externals/osip
vendored
2
submodules/externals/osip
vendored
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5a3da085ca1dcf82a852cee1e191cab0b98ff1f1
|
Subproject commit c27b9b6702f62cdbd2143c1ccc85b8980b83adac
|
||||||
Loading…
Add table
Reference in a new issue