Commit 5799f875 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk

fix: handle incoming call

Change-Id: I8520d89e30e725feeba667644f395ebc1c49c70f
parent 54de24cc
...@@ -327,8 +327,14 @@ class CallsService: CallsAdapterDelegate { ...@@ -327,8 +327,14 @@ class CallsService: CallsAdapterDelegate {
if let callDictionary = self.callsAdapter.callDetails(withCallId: callId) { if let callDictionary = self.callsAdapter.callDetails(withCallId: callId) {
if !isCurrentCall() { if !isCurrentCall() {
let call = CallModel(withCallId: callId, callDetails: callDictionary) var call = self.calls[callId]
self.newCall.value = call if call == nil {
call = CallModel(withCallId: callId, callDetails: callDictionary)
} else {
call?.update(withDictionary: callDictionary)
}
//Emit the call to the observers
self.newCall.value = call!
} else { } else {
self.refuse(callId: callId).subscribe(onCompleted: { [weak self] in self.refuse(callId: callId).subscribe(onCompleted: { [weak self] in
self?.log.debug("call refused") self?.log.debug("call refused")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment