| | |
| | | providerDelegate.callInfos.updateValue(callInfo, forKey: uuid) |
| | | providerDelegate.uuids.updateValue(uuid, forKey: callId) |
| | | let state: UIApplication.State = UIApplication.shared.applicationState |
| | | if state == .background{ |
| | | providerDelegate.reportIncomingCall(call:call, uuid: uuid, handle: handle, hasVideo: hasVideo) |
| | | } |
| | | // if state == .background{ |
| | | // providerDelegate.reportIncomingCall(call:call, uuid: uuid, handle: handle, hasVideo: hasVideo) |
| | | // } |
| | | // providerDelegate.reportIncomingCall(call:call, uuid: uuid, handle: handle, hasVideo: hasVideo) |
| | | } |
| | | |
| | |
| | | } |
| | | let call = Call.getSwiftObject(cObject: call!) |
| | | acceptCall(call: call, hasVideo: hasVideo) |
| | | // HDLCallManager.instance().lc?.activateAudioSession(actived: true) |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | let sAddr = Address.getSwiftObject(cObject: addr!) |
| | | if (HDLCallManager.callKitEnabled() && !HDLCallManager.instance().nextCallIsTransfer) { |
| | | print("callKitEnabled") |
| | | // HDLCallManager.configAudioSession(audioSession: AVAudioSession.sharedInstance()) |
| | | |
| | | let uuid = UUID() |
| | | let name = "unknow" |
| | | let handle = CXHandle(type: .generic, value: name) |
| | |
| | | |
| | | requestTransaction(transaction, action: "startCall") |
| | | }else { |
| | | print("doCall") |
| | | try? doCall(addr: sAddr, isSas: isSas) |
| | | } |
| | | } |
| | |
| | | lcallParams.mediaEncryption = .ZRTP |
| | | } |
| | | lcallParams.videoEnabled=true; |
| | | |
| | | let call = HDLCallManager.instance().lc!.inviteAddressWithParams(addr: addr, params: lcallParams) |
| | | if (call != nil) { |
| | | // The LinphoneCallAppData object should be set on call creation with callback |
| | |
| | | } |
| | | |
| | | // To be removed. |
| | | static func configAudioSession(audioSession: AVAudioSession) { |
| | | @objc static func configAudioSession(audioSession: AVAudioSession) { |
| | | do { |
| | | try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.voiceChat, options: AVAudioSession.CategoryOptions(rawValue: AVAudioSession.CategoryOptions.allowBluetooth.rawValue | AVAudioSession.CategoryOptions.allowBluetoothA2DP.rawValue)) |
| | | try audioSession.setMode(AVAudioSession.Mode.voiceChat) |
| | |
| | | } catch { |
| | | |
| | | } |
| | | // LinphoneCall *currentcall = linphone_core_get_current_call(LC); |
| | | // if (linphone_core_is_in_conference(LC) || // In conference |
| | | // (linphone_core_get_conference_size(LC) > 0 && [UIHangUpButton callCount] == 0) // Only one conf |
| | | // ) { |
| | | // LinphoneManager.instance.conf = TRUE; |
| | | // linphone_core_terminate_conference(LC); |
| | | // } else if (currentcall != NULL) { |
| | | // linphone_call_terminate(currentcall); |
| | | // } else { |
| | | // const MSList *calls = linphone_core_get_calls(LC); |
| | | // if (bctbx_list_size(calls) == 1) { // Only one call |
| | | // linphone_call_terminate((LinphoneCall *)(calls->data)); |
| | | // } |
| | | // } |
| | | if (UIApplication.shared.applicationState == .background) { |
| | | HDLCoreManager.instance().stopLinphoneCore() |
| | | } |