forked from mirrors/linphone-iphone
Compare commits
7 commits
master
...
release/4.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0808ed8d5e | ||
|
|
53004f0272 | ||
|
|
0bf5f0dfd3 | ||
|
|
ee19cce8ea | ||
|
|
90b59da64d | ||
|
|
f96473c616 | ||
|
|
a5c7b5483a |
10 changed files with 78 additions and 37 deletions
|
|
@ -743,11 +743,9 @@ static UICompositeViewDescription *compositeDescription = nil;
|
||||||
[url showError:NSLocalizedString(@"Invalid remote provisioning URL", nil)
|
[url showError:NSLocalizedString(@"Invalid remote provisioning URL", nil)
|
||||||
when:^BOOL(NSString *inputEntry) {
|
when:^BOOL(NSString *inputEntry) {
|
||||||
if (inputEntry.length > 0) {
|
if (inputEntry.length > 0) {
|
||||||
// missing prefix will result in http:// being used
|
bool isValid = linphone_core_set_provisioning_uri(LC, [self addSchemeToProvisiionninUriIMissing:inputEntry].UTF8String) != 0;
|
||||||
if ([inputEntry rangeOfString:@"://"].location == NSNotFound) {
|
linphone_core_set_provisioning_uri(LC,NULL);
|
||||||
inputEntry = [NSString stringWithFormat:@"http://%@", inputEntry];
|
return isValid;
|
||||||
}
|
|
||||||
return (linphone_core_set_provisioning_uri(LC, inputEntry.UTF8String) != 0);
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}];
|
}];
|
||||||
|
|
@ -773,6 +771,11 @@ static UICompositeViewDescription *compositeDescription = nil;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(NSString *) addSchemeToProvisiionninUriIMissing:(NSString *)uri {
|
||||||
|
// missing prefix will result in http:// being used
|
||||||
|
return [uri rangeOfString:@"://"].location == NSNotFound ? [NSString stringWithFormat:@"http://%@", uri] : uri;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)shouldEnableNextButton {
|
- (void)shouldEnableNextButton {
|
||||||
BOOL invalidInputs = NO;
|
BOOL invalidInputs = NO;
|
||||||
for (int i = 0; !invalidInputs && i < ViewElement_TextFieldCount; i++) {
|
for (int i = 0; !invalidInputs && i < ViewElement_TextFieldCount; i++) {
|
||||||
|
|
@ -1464,6 +1467,7 @@ void assistant_is_account_linked(LinphoneAccountCreator *creator, LinphoneAccoun
|
||||||
[errView addAction:defaultAction];
|
[errView addAction:defaultAction];
|
||||||
[self presentViewController:errView animated:YES completion:nil];
|
[self presentViewController:errView animated:YES completion:nil];
|
||||||
} else {
|
} else {
|
||||||
|
linphone_core_set_provisioning_uri(LC, [self addSchemeToProvisiionninUriIMissing:[self findTextField:ViewElement_URL].text].UTF8String);
|
||||||
[self resetLiblinphone:TRUE];
|
[self resetLiblinphone:TRUE];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ import AVFoundation
|
||||||
@objc var alreadyRegisteredForNotification: Bool = false
|
@objc var alreadyRegisteredForNotification: Bool = false
|
||||||
var referedFromCall: String?
|
var referedFromCall: String?
|
||||||
var referedToCall: String?
|
var referedToCall: String?
|
||||||
|
var endCallkit: Bool = false
|
||||||
|
|
||||||
|
|
||||||
fileprivate override init() {
|
fileprivate override init() {
|
||||||
|
|
@ -247,6 +248,7 @@ import AVFoundation
|
||||||
providerDelegate.callInfos.updateValue(callInfo, forKey: uuid)
|
providerDelegate.callInfos.updateValue(callInfo, forKey: uuid)
|
||||||
providerDelegate.uuids.updateValue(uuid, forKey: "")
|
providerDelegate.uuids.updateValue(uuid, forKey: "")
|
||||||
|
|
||||||
|
setHeldOtherCalls(exceptCallid: "")
|
||||||
requestTransaction(transaction, action: "startCall")
|
requestTransaction(transaction, action: "startCall")
|
||||||
}else {
|
}else {
|
||||||
try? doCall(addr: sAddr, isSas: isSas)
|
try? doCall(addr: sAddr, isSas: isSas)
|
||||||
|
|
@ -384,7 +386,14 @@ import AVFoundation
|
||||||
|
|
||||||
@objc func setHeld(call: OpaquePointer, hold: Bool) {
|
@objc func setHeld(call: OpaquePointer, hold: Bool) {
|
||||||
let sCall = Call.getSwiftObject(cObject: call)
|
let sCall = Call.getSwiftObject(cObject: call)
|
||||||
let callid = sCall.callLog?.callId ?? ""
|
if (!hold) {
|
||||||
|
setHeldOtherCalls(exceptCallid: sCall.callLog?.callId ?? "")
|
||||||
|
}
|
||||||
|
setHeld(call: sCall, hold: hold)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setHeld(call: Call, hold: Bool) {
|
||||||
|
let callid = call.callLog?.callId ?? ""
|
||||||
let uuid = providerDelegate.uuids["\(callid)"]
|
let uuid = providerDelegate.uuids["\(callid)"]
|
||||||
|
|
||||||
if (uuid == nil) {
|
if (uuid == nil) {
|
||||||
|
|
@ -396,11 +405,31 @@ import AVFoundation
|
||||||
|
|
||||||
requestTransaction(transaction, action: "setHeld")
|
requestTransaction(transaction, action: "setHeld")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func setHeldOtherCalls(exceptCallid: String) {
|
||||||
|
for call in CallManager.instance().lc!.calls {
|
||||||
|
if (call.callLog?.callId != exceptCallid && call.state != .Paused && call.state != .Pausing && call.state != .PausedByRemote) {
|
||||||
|
setHeld(call: call, hold: true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class CoreManagerDelegate: CoreDelegate {
|
class CoreManagerDelegate: CoreDelegate {
|
||||||
static var speaker_already_enabled : Bool = false
|
static var speaker_already_enabled : Bool = false
|
||||||
|
|
||||||
|
override func onRegistrationStateChanged(lc: Core, cfg: ProxyConfig, cstate: RegistrationState, message: String) {
|
||||||
|
if lc.proxyConfigList.count == 1 && (cstate == .Failed || cstate == .Cleared){
|
||||||
|
// terminate callkit immediately when registration failed or cleared, supporting single proxy configuration
|
||||||
|
CallManager.instance().endCallkit = true
|
||||||
|
for call in CallManager.instance().providerDelegate.uuids {
|
||||||
|
CallManager.instance().providerDelegate.endCall(uuid: call.value)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CallManager.instance().endCallkit = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override func onCallStateChanged(lc: Core, call: Call, cstate: Call.State, message: String) {
|
override func onCallStateChanged(lc: Core, call: Call, cstate: Call.State, message: String) {
|
||||||
let addr = call.remoteAddress;
|
let addr = call.remoteAddress;
|
||||||
let address = FastAddressBook.displayName(for: addr?.getCobject) ?? "Unknow"
|
let address = FastAddressBook.displayName(for: addr?.getCobject) ?? "Unknow"
|
||||||
|
|
|
||||||
|
|
@ -264,22 +264,8 @@
|
||||||
//init logs asap
|
//init logs asap
|
||||||
[Log enableLogs:[[LinphoneManager instance] lpConfigIntForKey:@"debugenable_preference"]];
|
[Log enableLogs:[[LinphoneManager instance] lpConfigIntForKey:@"debugenable_preference"]];
|
||||||
|
|
||||||
//Starting with iOS 13, the CNCopyCurrentNetworkInfo API will no longer return valid Wi-Fi SSID and BSSID information.
|
|
||||||
//Use the CoreLocation API to request the user’s consent to access location information.
|
|
||||||
if (@available(iOS 13.0, *)) {
|
|
||||||
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
|
|
||||||
switch(status) {
|
|
||||||
case kCLAuthorizationStatusDenied:
|
|
||||||
case kCLAuthorizationStatusRestricted:
|
|
||||||
case kCLAuthorizationStatusNotDetermined:
|
|
||||||
locationManager = [[CLLocationManager alloc]init];
|
|
||||||
locationManager.delegate = self;
|
|
||||||
[locationManager requestWhenInUseAuthorization];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ([PHPhotoLibrary authorizationStatus] != PHAuthorizationStatusAuthorized) {
|
if ([PHPhotoLibrary authorizationStatus] != PHAuthorizationStatusAuthorized) {
|
||||||
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
|
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@
|
||||||
[self setCString:"" forKey:@"account_userid_preference"];
|
[self setCString:"" forKey:@"account_userid_preference"];
|
||||||
[self setCString:"" forKey:@"account_mandatory_password_preference"];
|
[self setCString:"" forKey:@"account_mandatory_password_preference"];
|
||||||
[self setCString:"" forKey:@"ha1_preference"];
|
[self setCString:"" forKey:@"ha1_preference"];
|
||||||
|
[self setCString:"" forKey:@"ha1_algo_preferencex"];
|
||||||
[self setInteger:-1 forKey:@"account_expire_preference"];
|
[self setInteger:-1 forKey:@"account_expire_preference"];
|
||||||
[self setInteger:-1 forKey:@"current_proxy_config_preference"];
|
[self setInteger:-1 forKey:@"current_proxy_config_preference"];
|
||||||
[self setCString:"" forKey:@"account_prefix_preference"];
|
[self setCString:"" forKey:@"account_prefix_preference"];
|
||||||
|
|
@ -228,6 +229,7 @@
|
||||||
[self setCString:linphone_auth_info_get_passwd(ai) forKey:@"account_mandatory_password_preference"];
|
[self setCString:linphone_auth_info_get_passwd(ai) forKey:@"account_mandatory_password_preference"];
|
||||||
// hidden but useful if provisioned
|
// hidden but useful if provisioned
|
||||||
[self setCString:linphone_auth_info_get_ha1(ai) forKey:@"ha1_preference"];
|
[self setCString:linphone_auth_info_get_ha1(ai) forKey:@"ha1_preference"];
|
||||||
|
[self setCString:linphone_auth_info_get_algorithm(ai) forKey:@"ha1_algo_preference"];
|
||||||
}
|
}
|
||||||
|
|
||||||
int idx = (int)bctbx_list_index(linphone_core_get_proxy_config_list(LC), proxy);
|
int idx = (int)bctbx_list_index(linphone_core_get_proxy_config_list(LC), proxy);
|
||||||
|
|
@ -490,6 +492,7 @@
|
||||||
NSString *transport = [self stringForKey:@"account_transport_preference"];
|
NSString *transport = [self stringForKey:@"account_transport_preference"];
|
||||||
NSString *accountHa1 = [self stringForKey:@"ha1_preference"];
|
NSString *accountHa1 = [self stringForKey:@"ha1_preference"];
|
||||||
NSString *accountPassword = [self stringForKey:@"account_mandatory_password_preference"];
|
NSString *accountPassword = [self stringForKey:@"account_mandatory_password_preference"];
|
||||||
|
NSString *accountAlgoPreference = [self stringForKey:@"ha1_algo_preference"];;
|
||||||
BOOL isOutboundProxy = [self boolForKey:@"account_outbound_proxy_preference"];
|
BOOL isOutboundProxy = [self boolForKey:@"account_outbound_proxy_preference"];
|
||||||
BOOL use_avpf = [self boolForKey:@"account_avpf_preference"];
|
BOOL use_avpf = [self boolForKey:@"account_avpf_preference"];
|
||||||
BOOL is_default = [self boolForKey:@"account_is_default_preference"];
|
BOOL is_default = [self boolForKey:@"account_is_default_preference"];
|
||||||
|
|
@ -622,9 +625,9 @@
|
||||||
linphone_proxy_config_get_realm(proxyCfg),
|
linphone_proxy_config_get_realm(proxyCfg),
|
||||||
linphone_proxy_config_get_domain(proxyCfg));
|
linphone_proxy_config_get_domain(proxyCfg));
|
||||||
} else {
|
} else {
|
||||||
info = linphone_auth_info_new(linphone_address_get_username(from), userid_str, NULL, ha1,
|
info = linphone_auth_info_new_for_algorithm(linphone_address_get_username(from), userid_str, NULL, ha1,
|
||||||
realm ? realm : linphone_proxy_config_get_realm(proxyCfg),
|
realm ? realm : linphone_proxy_config_get_realm(proxyCfg),
|
||||||
linphone_proxy_config_get_domain(proxyCfg));
|
linphone_proxy_config_get_domain(proxyCfg), [accountAlgoPreference UTF8String]);
|
||||||
}
|
}
|
||||||
|
|
||||||
linphone_address_unref(from);
|
linphone_address_unref(from);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
|
||||||
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
<device id="retina4_7" orientation="portrait" appearance="light"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17125"/>
|
||||||
|
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
|
|
@ -16,6 +17,7 @@
|
||||||
<outlet property="deleteButton" destination="C2f-aP-xjR" id="sxr-th-6rq"/>
|
<outlet property="deleteButton" destination="C2f-aP-xjR" id="sxr-th-6rq"/>
|
||||||
<outlet property="editTextfield" destination="dTn-Hc-bGM" id="bkN-xg-S9D"/>
|
<outlet property="editTextfield" destination="dTn-Hc-bGM" id="bkN-xg-S9D"/>
|
||||||
<outlet property="editView" destination="rAa-qu-PDc" id="cGz-D2-GiI"/>
|
<outlet property="editView" destination="rAa-qu-PDc" id="cGz-D2-GiI"/>
|
||||||
|
<outlet property="encryptedChatButton" destination="Red-NG-DKu" id="Hre-cq-m5b"/>
|
||||||
<outlet property="encryptedChatView" destination="ERg-IK-XJX" id="Aam-pm-R6d"/>
|
<outlet property="encryptedChatView" destination="ERg-IK-XJX" id="Aam-pm-R6d"/>
|
||||||
<outlet property="inviteButton" destination="lgb-5W-T0c" id="iOl-Fl-AXH"/>
|
<outlet property="inviteButton" destination="lgb-5W-T0c" id="iOl-Fl-AXH"/>
|
||||||
<outlet property="linphoneImage" destination="ZaI-29-AOK" id="dY1-vO-spk"/>
|
<outlet property="linphoneImage" destination="ZaI-29-AOK" id="dY1-vO-spk"/>
|
||||||
|
|
@ -34,7 +36,7 @@
|
||||||
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="dTn-Hc-bGM" userLabel="editTextField">
|
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="dTn-Hc-bGM" userLabel="editTextField">
|
||||||
<rect key="frame" x="8" y="7" width="327" height="30"/>
|
<rect key="frame" x="8" y="7" width="327" height="30"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/>
|
||||||
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor" red="0.94901960780000005" green="0.94901960780000005" blue="0.96862745100000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" systemColor="secondarySystemBackgroundColor"/>
|
||||||
<rect key="contentStretch" x="1.3877787807814457e-17" y="0.0" width="1" height="1"/>
|
<rect key="contentStretch" x="1.3877787807814457e-17" y="0.0" width="1" height="1"/>
|
||||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||||
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done"/>
|
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done"/>
|
||||||
|
|
@ -53,7 +55,7 @@
|
||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||||
</view>
|
</view>
|
||||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SR2-3m-6t5" userLabel="defaultView">
|
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SR2-3m-6t5" userLabel="defaultView">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="375" height="88"/>
|
<rect key="frame" x="0.0" y="0.0" width="375" height="88"/>
|
||||||
|
|
@ -138,7 +140,7 @@
|
||||||
</subviews>
|
</subviews>
|
||||||
</view>
|
</view>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
|
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||||
</view>
|
</view>
|
||||||
</subviews>
|
</subviews>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
|
@ -158,5 +160,11 @@
|
||||||
<image name="delete_field_over.png" width="44" height="44"/>
|
<image name="delete_field_over.png" width="44" height="44"/>
|
||||||
<image name="linphone_user.png" width="41.599998474121094" height="42.400001525878906"/>
|
<image name="linphone_user.png" width="41.599998474121094" height="42.400001525878906"/>
|
||||||
<image name="security_toogle_icon_green.png" width="33.599998474121094" height="38.400001525878906"/>
|
<image name="security_toogle_icon_green.png" width="33.599998474121094" height="38.400001525878906"/>
|
||||||
|
<systemColor name="secondarySystemBackgroundColor">
|
||||||
|
<color red="0.94901960784313721" green="0.94901960784313721" blue="0.96862745098039216" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
</systemColor>
|
||||||
|
<systemColor name="systemBackgroundColor">
|
||||||
|
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
|
</systemColor>
|
||||||
</resources>
|
</resources>
|
||||||
</document>
|
</document>
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
@property(weak, nonatomic) IBOutlet UIIconButton *deleteButton;
|
@property(weak, nonatomic) IBOutlet UIIconButton *deleteButton;
|
||||||
@property(weak, nonatomic) IBOutlet UIIconButton *callButton;
|
@property(weak, nonatomic) IBOutlet UIIconButton *callButton;
|
||||||
@property(weak, nonatomic) IBOutlet UIIconButton *chatButton;
|
@property(weak, nonatomic) IBOutlet UIIconButton *chatButton;
|
||||||
|
@property (weak, nonatomic) IBOutlet UIIconButton *encryptedChatButton;
|
||||||
@property (weak, nonatomic) IBOutlet UIImageView *linphoneImage;
|
@property (weak, nonatomic) IBOutlet UIImageView *linphoneImage;
|
||||||
@property (weak, nonatomic) UIView *waitView;
|
@property (weak, nonatomic) UIView *waitView;
|
||||||
@property (strong, nonatomic) IBOutlet UIButton *inviteButton;
|
@property (strong, nonatomic) IBOutlet UIButton *inviteButton;
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
_addressLabel.text.UTF8String);
|
_addressLabel.text.UTF8String);
|
||||||
}
|
}
|
||||||
LinphoneAddress *addr = linphone_core_interpret_url(LC, normAddr);
|
LinphoneAddress *addr = linphone_core_interpret_url(LC, normAddr);
|
||||||
_chatButton.enabled = _callButton.enabled = (addr != NULL);
|
_chatButton.enabled = _callButton.enabled = _encryptedChatButton.enabled = (addr != NULL);
|
||||||
|
|
||||||
_chatButton.accessibilityLabel =
|
_chatButton.accessibilityLabel =
|
||||||
[NSString stringWithFormat:NSLocalizedString(@"Chat with %@", nil), _addressLabel.text];
|
[NSString stringWithFormat:NSLocalizedString(@"Chat with %@", nil), _addressLabel.text];
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,14 @@ class ProviderDelegate: NSObject {
|
||||||
let callInfo = callInfos[uuid]
|
let callInfo = callInfos[uuid]
|
||||||
let callId = callInfo?.callId
|
let callId = callInfo?.callId
|
||||||
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: report new incoming call with call-id: [\(String(describing: callId))] and UUID: [\(uuid.description)]")
|
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: report new incoming call with call-id: [\(String(describing: callId))] and UUID: [\(uuid.description)]")
|
||||||
|
CallManager.instance().setHeldOtherCalls(exceptCallid: callId ?? "")
|
||||||
provider.reportNewIncomingCall(with: uuid, update: update) { error in
|
provider.reportNewIncomingCall(with: uuid, update: update) { error in
|
||||||
if error == nil {
|
if error == nil {
|
||||||
CallManager.instance().providerDelegate.endCallNotExist(uuid: uuid, timeout: .now() + 20)
|
if CallManager.instance().endCallkit {
|
||||||
|
CallManager.instance().providerDelegate.endCall(uuid: uuid)
|
||||||
|
} else {
|
||||||
|
CallManager.instance().providerDelegate.endCallNotExist(uuid: uuid, timeout: .now() + 20)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.directLog(BCTBX_LOG_ERROR, text: "CallKit: cannot complete incoming call with call-id: [\(String(describing: callId))] and UUID: [\(uuid.description)] from [\(handle)] caused by [\(error!.localizedDescription)]")
|
Log.directLog(BCTBX_LOG_ERROR, text: "CallKit: cannot complete incoming call with call-id: [\(String(describing: callId))] and UUID: [\(uuid.description)] from [\(handle)] caused by [\(error!.localizedDescription)]")
|
||||||
let code = (error as NSError?)?.code
|
let code = (error as NSError?)?.code
|
||||||
|
|
@ -124,12 +129,17 @@ class ProviderDelegate: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
func endCall(uuid: UUID) {
|
func endCall(uuid: UUID) {
|
||||||
provider.reportCall(with: uuid, endedAt: .init(), reason: .declinedElsewhere)
|
provider.reportCall(with: uuid, endedAt: .init(), reason: .failed)
|
||||||
}
|
}
|
||||||
|
|
||||||
func endCallNotExist(uuid: UUID, timeout: DispatchTime) {
|
func endCallNotExist(uuid: UUID, timeout: DispatchTime) {
|
||||||
DispatchQueue.main.asyncAfter(deadline: timeout) {
|
DispatchQueue.main.asyncAfter(deadline: timeout) {
|
||||||
let callId = CallManager.instance().providerDelegate.callInfos[uuid]?.callId
|
let callId = CallManager.instance().providerDelegate.callInfos[uuid]?.callId
|
||||||
|
if (callId == nil) {
|
||||||
|
// callkit already ended
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let call = CallManager.instance().callByCallId(callId: callId)
|
let call = CallManager.instance().callByCallId(callId: callId)
|
||||||
if (call == nil) {
|
if (call == nil) {
|
||||||
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: terminate call with call-id: \(String(describing: callId)) and UUID: \(uuid) which does not exist.")
|
Log.directLog(BCTBX_LOG_MESSAGE, text: "CallKit: terminate call with call-id: \(String(describing: callId)) and UUID: \(uuid) which does not exist.")
|
||||||
|
|
|
||||||
2
Podfile
2
Podfile
|
|
@ -5,7 +5,7 @@ source "https://github.com/CocoaPods/Specs.git"
|
||||||
|
|
||||||
def all_pods
|
def all_pods
|
||||||
if ENV['PODFILE_PATH'].nil?
|
if ENV['PODFILE_PATH'].nil?
|
||||||
pod 'linphone-sdk', '4.4.2'
|
pod 'linphone-sdk', '4.4.3'
|
||||||
else
|
else
|
||||||
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk
|
pod 'linphone-sdk', :path => ENV['PODFILE_PATH'] # local sdk
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -4923,7 +4923,7 @@
|
||||||
"-DENABLE_QRCODE=TRUE",
|
"-DENABLE_QRCODE=TRUE",
|
||||||
"-DENABLE_SMS_INVITE=TRUE",
|
"-DENABLE_SMS_INVITE=TRUE",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"-DLINPHONE_SDK_VERSION=\\\"4.4.2\\\"",
|
"-DLINPHONE_SDK_VERSION=\\\"4.4.3\\\"",
|
||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited)";
|
OTHER_SWIFT_FLAGS = "$(inherited)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
||||||
|
|
@ -5046,7 +5046,7 @@
|
||||||
"-DENABLE_QRCODE=TRUE",
|
"-DENABLE_QRCODE=TRUE",
|
||||||
"-DENABLE_SMS_INVITE=TRUE",
|
"-DENABLE_SMS_INVITE=TRUE",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"-DLINPHONE_SDK_VERSION=\\\"4.4.2\\\"",
|
"-DLINPHONE_SDK_VERSION=\\\"4.4.3\\\"",
|
||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited)";
|
OTHER_SWIFT_FLAGS = "$(inherited)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
||||||
|
|
@ -5168,7 +5168,7 @@
|
||||||
"-DENABLE_QRCODE=TRUE",
|
"-DENABLE_QRCODE=TRUE",
|
||||||
"-DENABLE_SMS_INVITE=TRUE",
|
"-DENABLE_SMS_INVITE=TRUE",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"-DLINPHONE_SDK_VERSION=\\\"4.4.2\\\"",
|
"-DLINPHONE_SDK_VERSION=\\\"4.4.3\\\"",
|
||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited)";
|
OTHER_SWIFT_FLAGS = "$(inherited)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
||||||
|
|
@ -5289,7 +5289,7 @@
|
||||||
"-DENABLE_QRCODE=TRUE",
|
"-DENABLE_QRCODE=TRUE",
|
||||||
"-DENABLE_SMS_INVITE=TRUE",
|
"-DENABLE_SMS_INVITE=TRUE",
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"-DLINPHONE_SDK_VERSION=\\\"4.4.2\\\"",
|
"-DLINPHONE_SDK_VERSION=\\\"4.4.3\\\"",
|
||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited)";
|
OTHER_SWIFT_FLAGS = "$(inherited)";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
PRODUCT_BUNDLE_IDENTIFIER = org.linphone.phone;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue