Implement call holding (call swapping still broken).

- Alice calls Bob on Signal and they start talking
- Charlie calls Alice on Not-Signal.
- Alice chooses to "Hold & Accept" putting Bob on Hold while the call with
  Charlie connects.
- If Alice ends the call with Charlie, we're back in Signal-iOS and
  talking to Bob, no problem.
- However, if, before ending the call with Charlie, Alice tries to swap
  *back* to bob, bob won't hear any audio in the callkit screen. Alice
  has to switch back to the Signal screen before the audio is transmitted.

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent e425d351c7
commit 969b73cad8

@ -133,6 +133,8 @@ protocol CallObserver: class {
}
}
var isOnHold = false
var connectedDate: NSDate?
var error: CallError?

@ -285,20 +285,19 @@ final class CallKitCallUIAdaptee: NSObject, CallUIAdaptee, CXProviderDelegate {
action.fail()
return
}
Logger.warn("TODO, unimplemented set held call: \(call)")
// TODO FIXME
// // Update the SpeakerboxCall's underlying hold state.
// call.isOnHold = action.isOnHold
//
// // Stop or start audio in response to holding or unholding the call.
// if call.isOnHold {
// // stopAudio() <-- SpeakerBox
// PeerConnectionClient.stopAudioSession()
// } else {
// // startAudio() <-- SpeakerBox
// PeerConnectionClient.startAudioSession()
// }
// Update the SignalCall's underlying hold state.
call.isOnHold = action.isOnHold
// Stop or start audio in response to holding or unholding the call.
if call.isOnHold {
// stopAudio() <-- SpeakerBox
PeerConnectionClient.stopAudioSession()
} else {
// startAudio() <-- SpeakerBox
// This is redundant with what happens in `provider(_:didActivate:)`
//PeerConnectionClient.startAudioSession()
}
// Signal to the system that the action has been successfully performed.
action.fulfill()

Loading…
Cancel
Save