| | |
| | | |
| | | 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) |
| | |
| | | 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() |
| | | } |
| | |
| | | } |
| | | |
| | | func provider(_ provider: CXProvider, didActivate audioSession: AVAudioSession) { |
| | | |
| | | print("didActivate"); |
| | | HDLCallManager.instance().lc?.activateAudioSession(actived: true) |
| | | } |
| | | |