add some logs

pull/1055/head
Ryan ZHAO 4 months ago
parent 47805b96ac
commit 921ef93064

@ -27,7 +27,6 @@ public final class SessionCall: CurrentCallProtocol, WebRTCSessionDelegate {
let isOutgoing: Bool
var remoteSDP: RTCSessionDescription? = nil
var callInteractionId: Int64?
var answerCallAction: CXAnswerCallAction? = nil
let contactName: String
let profilePicture: UIImage
@ -268,12 +267,15 @@ public final class SessionCall: CurrentCallProtocol, WebRTCSessionDelegate {
hasStartedConnecting = true
if let sdp = remoteSDP {
SNLog("[Calls] Got remote sdp already")
webRTCSession.handleRemoteSDP(sdp, from: sessionId) // This sends an answer message internally
} else {
SNLog("[Calls] Didn't get remote sdp yet, waiting for it")
}
}
func answerSessionCallInBackground(action: CXAnswerCallAction) {
answerCallAction = action
func answerSessionCallInBackground() {
SNLog("[Calls] Answering call in background")
self.answerSessionCall()
}
@ -394,7 +396,6 @@ public final class SessionCall: CurrentCallProtocol, WebRTCSessionDelegate {
}
self.hasConnected = true
self.answerCallAction?.fulfill()
}
public func isRemoteVideoDidChange(isEnabled: Bool) {

@ -23,9 +23,12 @@ extension SessionCallManager: CXProviderDelegate {
public func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
Log.assertOnMainThread()
Log.debug("[CallKit] Perform CXAnswerCallAction")
Log.info("[CallKit] Perform CXAnswerCallAction")
guard let call: SessionCall = (self.currentCall as? SessionCall) else { return action.fail() }
guard let call: SessionCall = (self.currentCall as? SessionCall) else {
Log.warn("[CallKit] No session call")
return action.fail()
}
if Singleton.hasAppContext && Singleton.appContext.isMainAppAndActive {
if answerCallAction() {
@ -36,7 +39,8 @@ extension SessionCallManager: CXProviderDelegate {
}
}
else {
call.answerSessionCallInBackground(action: action)
call.answerSessionCallInBackground()
action.fulfill()
}
}

Loading…
Cancel
Save