Commit Graph

44 Commits (17fe3f66c0cbcf6df5126834a9d7c93fada5c6c5)

Author SHA1 Message Date
Matthew Chen 17fe3f66c0 Ensure audio service observation of call is always correctly wired up.
// FREEBIE
8 years ago
Michael Kirk 90388ebd63 Coordinate "busy" state across redphone and webrtc
Previously a redphone call didn't know when the user was busy due to
webrtc and vice versa

// FREEBIE
8 years ago
Matthew Chen 6e390d40b7 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 732144c9ed Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 98caeb6a03 Be even more cautious when tearing down a PeerConnectionClient.
// FREEBIE
8 years ago
Michael Kirk 2a9aa4c852 users can opt out of CallKit
// FREEBIE
8 years ago
Matthew Chen 5687925513 Prevent simultaneous incoming and outgoing calls from leaving CallService in a bad state.
// FREEBIE
8 years ago
Matthew Chen 0893930485 Handle “busy signal” appropriately.
// FREEBIE
8 years ago
Michael Kirk b6f098bfa7 Log when receiving unknown call datachannel message
// FREEBIE
8 years ago
Matthew Chen f81feca2d6 Avoid crashes when closing peer connection client.
// FREEBIE
8 years ago
Matthew Chen 4dec1e2ded Avoid crashes when closing peer connection client.
// FREEBIE
8 years ago
Matthew Chen b415b6142f Respond to CR, mainly by fixing broken tests.
// FREEBIE
8 years ago
Matthew Chen 49bb3d942d Clean up ahead of PR.
// FREEBIE
8 years ago
Matthew Chen d294557bdd Rework concurrency in the signaling logic.
// FREEBIE
8 years ago
Matthew Chen d6c849eab3 Revert whitespace changes.
// FREEBIE
8 years ago
Matthew Chen af289145b5 Rework concurrency in the signaling logic.
// FREEBIE
8 years ago
Matthew Chen 8454c7dc2f Log reconnect events as such.
// FREEBIE
8 years ago
Matthew Chen 40b3d038db Disable local video in background.
// FREEBIE
8 years ago
Matthew Chen c8e5884087 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 9a0a7bb6b1 Show alert when user tries to activate local video without camera permissions.
// FREEBIE
8 years ago
Matthew Chen da53368bc2 Show alert when user tries to activate local video without camera permissions.
// FREEBIE
8 years ago
Matthew Chen 2ef80e569d Improve thread safety in call ui adapter and adatapees.
// FREEBIE
8 years ago
Matthew Chen 6ce33381a8 Prevent screen from dimming or device from locking during video call.
// FREEBIE
8 years ago
Michael Kirk fff061ff3f Make sure WebRTC preferences are synced *every* call
This slows the UI, but only for people who have locally opted into
WebRTC calls, and the alternative is that users are likely to have stale
settings the first time a pair of people opt-in.

// FREEBIE
8 years ago
Matthew Chen d560aa022a Reworked call view’s remote video mode. 8 years ago
Matthew Chen 204aeab69c Respond to CR.
// FREEBIE
8 years ago
Matthew Chen ec1f77c630 Polish video calls.
* Send and handle messages around video status.
* Fix handling of callee data channel.
* Fix layout of local video view.

// FREEBIE
8 years ago
Matthew Chen a65d3b7c4e Add video-related views.
// FREEBIE
8 years ago
Michael Kirk 814aec6cdd Recover CallKit state when remote client fails to hangup
Distinguish between localHangup, remoteHangup, and call failure.

This allows us to put CallKit in the proper state, ready to receive new
calls without having a backlog of phantom calls which haven't been
properly removed.

Note the "call error" occurs at the point ICE fails, which takes a
while. Anecdotally, like 10 seconds, which feels like a long to be
talking into the ether.

I briefly considered failing at 'disconnected', which happens much
sooner, but that's actually a recoverable state. E.g. if you toggle
airplane mode you can see that you bounce into `disconnected` and then
back to `connected`, so I don't think we'd want to fail the call as long
as WebRTC considers it "recoverable".

// FREEBIE
8 years ago
Michael Kirk 6c14f2f500 Fix "Answer" from iOS9 notification doesn't init audio
The removed code was from an older eon. CallService shouldn't be touched
except via the CallUIAdapter since only there is the omnipresent
distinction between CallKit vs. NonCallKit made.

i.e. when the RTCAudioSession get's started depends on the
CallUIAdaptee.

// FREEBIE
8 years ago
Michael Kirk 87ed662116 Persist AudioService if CallViewController is dismissed
...in response to CR, move the AudioService off of the CallViewController

Adopt multiple observer pattern vs. a singular delegate. Doing so
required implementing some machinery to address the ARC (see:
Weak.swift)

// FREEBIE
8 years ago
Matthew Chen 9e739433c5 Start work on video.
// FREEBIE
8 years ago
Michael Kirk dbb29d7d7e Don't require recording permissions until call is ringing.
We do this by manually managing the RTCAudioSession.
Unfortunately to do this we have to include a couple of RTC headers not
exported by the default build of WebRTC.framework (see: Libraries/WebRTC)

// FREEBIE
8 years ago
Michael Kirk 0072ee3033 Ensure a stale peerConnectionClient doesn't call any methods on the CallService
Nil delegates when terminating call

// FREEBIE
8 years ago
Michael Kirk 32789bd960 Move RTCDataChannelDelegate to PeerConnectionClient
- minimizes CallService exposure to WebRTC

// FREEBIE
8 years ago
Michael Kirk 8998853aff Move RTCPeerConnectionDelegate to PeerConnectionClient
This makes sense as PeerConnectionClient is our interface to WebRTC

- Makes it easier to test PeerConnectionClient and CallService
- Allows us to shrink CallService class a bit (it's huge)

// FREEBIE
8 years ago
Michael Kirk bd65dc6ba7 Fallback TURN servers if we can't get them from the server for some reason
// FREEBIE
8 years ago
Michael Kirk f6e6e6b787 CallViewController only accesses CallService via the CallUIAdapter
This is an effort to better define boundaries and simplify
relationships.

This also fixes a theoretical problem where CallKit was showing the in-app
call screen before the call was successfully answered, now we wait until
the action is fulfilled.

// FREEBIE
8 years ago
Michael Kirk 947a637669 Sync "mute" controls between CallKit
In the process, extracted the CallDelegate to allow the
CAllViewController to observe useful call state properties (call.state
and call.isMuted)

// FREEBIE
8 years ago
Michael Kirk c7449db289 remove stubbed audio manager implementation until it's clear what to do
with it.

// FREEBIE
8 years ago
Michael Kirk 6eecef99ba Promise aware Message sender
As this could be used elsewhere, ideally it'd added to the actual class
definition, but MessageSender (SSK) doesn't use PromiseKit

// FREEBIE
8 years ago
Michael Kirk f9b44c8892 Added CallService documentation
// FREEBIE
8 years ago
Michael Kirk 57ad7a2808 cleanup 8 years ago
Michael Kirk 647b2b37e9 WIP: WebRTC calling
* Ensure NotificationsManager has dependencies
    Otherwise it's easy to mess up the order of the required dependencies.
* move AccountManager into Environment, it's heavy to construct

// FREEBIE
8 years ago