chenqiyang
2021-08-24 8227d1cefb20e357250a4a7fe8da32141b6cfc1e
HDLLinPhoneSDK/HDLLinPhoneSDK/HDLProviderDelegate.swift
@@ -75,13 +75,14 @@
        let callInfo = callInfos[uuid]
        let callId = callInfo?.callId
//        HDLCallManager.instance().lc?.activateAudioSession(actived: true)
        provider.reportNewIncomingCall(with: uuid, update: update) { error in
            if error == nil {
                HDLCallManager.instance().providerDelegate.endCallNotExist(uuid: uuid, timeout: .now() + 20)
            } else {
                if (call == nil) {
                    callInfo?.declined = true
                    self.callInfos.updateValue(callInfo!, forKey: uuid)
@@ -159,11 +160,12 @@
        if (call == nil || call?.state != Call.State.IncomingReceived) {
            // The application is not yet registered or the call is not yet received, mark the call as accepted. The audio session must be configured here.
            HDLCallManager.configAudioSession(audioSession: AVAudioSession.sharedInstance())
            print("进来这里了")
            callInfo?.accepted = true
            callInfos.updateValue(callInfo!, forKey: uuid)
            HDLCallManager.instance().providerDelegate.endCallNotExist(uuid: uuid, timeout: .now() + 10)
        } else {
//            HDLCallManager.instance().acceptCall(call: call!, hasVideo: call!.params?.videoEnabled ?? false)
            HDLCallManager.instance().acceptCall(call: call!, hasVideo: call!.params?.videoEnabled ?? false)
        }
        action.fulfill()
    }
@@ -268,7 +270,7 @@
    }
    func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) {
        print("didActivate");
        HDLCallManager.instance().lc?.activateAudioSession(actived: true)
    }