@ -577,27 +576,27 @@ protocol CallServiceObserver: class {
Logger.debug("\(TAG) called \(#function)")
guardself.thread!=nilelse{
handleFailedCall(failedCall:nil,error:.assertionError(description:"ignoring remote ice update for thread: \(thread.uniqueId) since there is no current thread. Call already ended?"))
Logger.warn("ignoring remote ice update for thread: \(thread.uniqueId) since there is no current thread. Call already ended?")
handleFailedCall(failedCall:nil,error:.assertionError(description:"ignoring remote ice update for thread: \(thread.uniqueId) since the current call is for thread: \(self.thread!.uniqueId)"))
Logger.warn("ignoring remote ice update for thread: \(thread.uniqueId) since there is no current thread. Call already ended?")
return
}
guardletcall=self.callelse{
handleFailedCall(failedCall:nil,error:.assertionError(description:"ignoring remote ice update for callId: \(callId), since there is no current call."))
Logger.warn("ignoring remote ice update for thread: \(thread.uniqueId) since there is no current thread. Call already ended?")
return
}
guardcall.signalingId==callIdelse{
handleFailedCall(failedCall:nil,error:.assertionError(description:"ignoring remote ice update for call: \(callId) since the current call is: \(call.signalingId)"))
Logger.warn("ignoring remote ice update for thread: \(thread.uniqueId) since there is no current thread. Call already ended?")
handleFailedCall(failedCall:call,error:.assertionError(description:"ignoring remote ice update for thread: \(thread) since the current call hasn't initialized it's peerConnectionClient"))
Logger.warn("ignoring remote ice update for thread: \(thread.uniqueId) since there is no current thread. Call already ended?")
return
}
@ -612,17 +611,23 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guardletcall=self.callelse{
handleFailedCall(failedCall:self.call,error:.assertionError(description:"ignoring local ice candidate, since there is no current call."))
handleFailedCurrentCall(error:.assertionError(description:"ignoring local ice candidate, since call is now idle."))
return
}
guardletthread=self.threadelse{
handleFailedCall(failedCall:self.call,error:.assertionError(description:"ignoring local ice candidate, because there was no current TSContactThread."))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) peerConnectionClient unexpectedly nil in \(#function)"))
//Thisshouldneverhappen;returntoaknowngoodstate.
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) peerConnectionClient unexpectedly nil in \(#function)"))
return
}
guardletcall=self.callelse{
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) call unexpectedly nil in \(#function)"))
//Thisshouldneverhappen;returntoaknowngoodstate.
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) call unexpectedly nil in \(#function)"))
return
}
@ -977,7 +995,8 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guardletcall=self.callelse{
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) received data message, but there is no current call. Ignoring."))
//Thisshouldneverhappen;returntoaknowngoodstate.
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) received data message, but there is no current call. Ignoring."))
return
}
@ -987,7 +1006,8 @@ protocol CallServiceObserver: class {
letconnected=message.connected!
guardconnected.id==call.signalingIdelse{
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)"))
//Thisshouldneverhappen;returntoaknowngoodstate.
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)"))
return
}
@ -1000,12 +1020,14 @@ protocol CallServiceObserver: class {
lethangup=message.hangup!
guardhangup.id==call.signalingIdelse{
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)"))
//Thisshouldneverhappen;returntoaknowngoodstate.
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)"))
return
}
guardletthread=self.threadelse{
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) current contact thread is unexpectedly nil when receiving hangup DataChannelMessage"))
//Thisshouldneverhappen;returntoaknowngoodstate.
handleFailedCurrentCall(error:.assertionError(description:"\(TAG) current contact thread is unexpectedly nil when receiving hangup DataChannelMessage"))
return
}
@ -1046,7 +1068,8 @@ protocol CallServiceObserver: class {