@ -540,27 +577,27 @@ protocol CallServiceObserver: class {
Logger.debug("\(TAG) called \(#function)")
guardself.thread!=nilelse{
handleFailedCall(error:.assertionError(description:"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 there is no current thread. Call already ended?"))
handleFailedCall(error:.assertionError(description:"ignoring remote ice update for thread: \(thread.uniqueId) since the current call is for thread: \(self.thread!.uniqueId)"))
handleFailedCall(failedCall :nil,error:.assertionError(description:"ignoring remote ice update for thread: \(thread.uniqueId) since the current call is for thread: \(self.thread!.uniqueId)"))
return
}
guardletcall=self.callelse{
handleFailedCall(error:.assertionError(description:"ignoring remote ice update for callId: \(callId), since there is no current call."))
handleFailedCall(failedCall :nil,error:.assertionError(description:"ignoring remote ice update for callId: \(callId), since there is no current call."))
return
}
guardcall.signalingId==callIdelse{
handleFailedCall(error:.assertionError(description:"ignoring remote ice update for call: \(callId) since the current call is: \(call.signalingId)"))
handleFailedCall(failedCall :nil,error:.assertionError(description:"ignoring remote ice update for call: \(callId) since the current call is: \(call.signalingId)"))
handleFailedCall(error:.assertionError(description:"ignoring remote ice update for thread: \(thread) since the current call hasn't initialized it's peerConnectionClient"))
handleFailedCall(failedCall:call,error:.assertionError(description:"ignoring remote ice update for thread: \(thread) since the current call hasn't initialized it's peerConnectionClient"))
return
}
@ -575,17 +612,17 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guardletcall=self.callelse{
handleFailedCall(error:.assertionError(description:"ignoring local ice candidate, since there is no current call."))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"ignoring local ice candidate, since there is no current call."))
return
}
guardcall.state!=.idleelse{
handleFailedCall(error:.assertionError(description:"ignoring local ice candidate, since call is now idle."))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"ignoring local ice candidate, since call is now idle."))
return
}
guardletthread=self.threadelse{
handleFailedCall(error:.assertionError(description:"ignoring local ice candidate, because there was no current TSContactThread."))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"ignoring local ice candidate, because there was no current TSContactThread."))
return
}
@ -616,12 +653,12 @@ protocol CallServiceObserver: class {
Logger.debug("\(TAG) in \(#function)")
guardletcall=self.callelse{
handleFailedCall(error:.assertionError(description:"\(TAG) ignoring \(#function) since there is no current call."))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) ignoring \(#function) since there is no current call."))
return
}
guardletthread=self.threadelse{
handleFailedCall(error:.assertionError(description:"\(TAG) ignoring \(#function) since there is no current thread."))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) ignoring \(#function) since there is no current thread."))
return
}
@ -655,7 +692,7 @@ protocol CallServiceObserver: class {
}
guardletcall=self.callelse{
handleFailedCall(error:.assertionError(description:"\(TAG) call was unexpectedly nil in \(#function)"))
handleFailedCall(failedCall:nil,error:.assertionError(description:"\(TAG) call was unexpectedly nil in \(#function)"))
return
}
@ -683,12 +720,12 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guardletcall=self.callelse{
handleFailedCall(error:.assertionError(description:"\(TAG) call was unexpectedly nil in \(#function)"))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) call was unexpectedly nil in \(#function)"))
return
}
guardcall.localId==localIdelse{
handleFailedCall(error:.assertionError(description:"\(TAG) callLocalId:\(localId) doesn't match current calls: \(call.localId)"))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) callLocalId:\(localId) doesn't match current calls: \(call.localId)"))
return
}
@ -704,7 +741,7 @@ protocol CallServiceObserver: class {
Logger.debug("\(TAG) in \(#function)")
guardself.call!=nilelse{
handleFailedCall(error:.assertionError(description:"\(TAG) ignoring \(#function) since there is no current call"))
handleFailedCall(failedCall:call,error:.assertionError(description:"\(TAG) ignoring \(#function) since there is no current call"))
return
}
@ -716,12 +753,12 @@ protocol CallServiceObserver: class {
}
guardletthread=self.threadelse{
handleFailedCall(error:.assertionError(description:"\(TAG) ignoring \(#function) for call other than current call"))
handleFailedCall(failedCall:call,error:.assertionError(description:"\(TAG) ignoring \(#function) for call other than current call"))
handleFailedCall(error:.assertionError(description:"\(TAG) peerConnectionClient unexpectedly nil in \(#function)"))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) peerConnectionClient unexpectedly nil in \(#function)"))
return
}
guardletcall=self.callelse{
handleFailedCall(error:.assertionError(description:"\(TAG) call unexpectedly nil in \(#function)"))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) call unexpectedly nil in \(#function)"))
return
}
@ -940,7 +977,7 @@ protocol CallServiceObserver: class {
AssertIsOnMainThread()
guardletcall=self.callelse{
handleFailedCall(error:.assertionError(description:"\(TAG) received data message, but there is no current call. Ignoring."))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) received data message, but there is no current call. Ignoring."))
return
}
@ -950,7 +987,7 @@ protocol CallServiceObserver: class {
letconnected=message.connected!
guardconnected.id==call.signalingIdelse{
handleFailedCall(error:.assertionError(description:"\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)"))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) received connected message for call with id:\(connected.id) but current call has id:\(call.signalingId)"))
return
}
@ -963,12 +1000,12 @@ protocol CallServiceObserver: class {
lethangup=message.hangup!
guardhangup.id==call.signalingIdelse{
handleFailedCall(error:.assertionError(description:"\(TAG) received hangup message for call with id:\(hangup.id) but current call has id:\(call.signalingId)"))
handleFailedCall(failedCall:self.call,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(error:.assertionError(description:"\(TAG) current contact thread is unexpectedly nil when receiving hangup DataChannelMessage"))
handleFailedCall(failedCall:self.call,error:.assertionError(description:"\(TAG) current contact thread is unexpectedly nil when receiving hangup DataChannelMessage"))
return
}
@ -1009,7 +1046,7 @@ protocol CallServiceObserver: class {