Commit Graph

45 Commits (30b50e1489d3532d6c4840f7d3ad467dcdbb76bb)

Author SHA1 Message Date
Michael Kirk 81f097c1f5 Don't drop critical data messages
Assigning dataChannel sometimes happens after iceConnect.

Fixes symptom where Alice calls Bob.
Bob answers and sees the call UI as normal
but Alice sees call as continuing to ring

// FREEBIE
8 years ago
Michael Kirk 2e75e9df55 Don't ignore critical errors
// FREEBIE
8 years ago
Michael Kirk c7642cc628 Fix volume burst when call connects
By centralizing AudioSession management onto the AudioService, we can
avoid enabling the RTCAudioSession while we're mid-ring.

Also allows us to centralize and remove redundant audio session logic.

// FREEBIE
8 years ago
Matthew Chen e8daf9a8d3 Fix assert when missing camera permission during calls.
// FREEBIE
8 years ago
Matthew Chen 465711c2cb Add script to extract and gather analytics event names.
// FREEBIE
8 years ago
Matthew Chen 863fd27abe Respond to CR.
// FREEBIE
8 years ago
Matthew Chen d639d6557e Add owsFail free function for swift.
// FREEBIE
8 years ago
Michael Kirk f681712ea0 Code Cleanup
- make some logging clearer
- remove noisy unhelpful logging
- clearer method names

// FREEBIE
8 years ago
Matthew Chen f5f506d06f Investigate “call stuck on connecting” issue.
// FREEBIE
8 years ago
Matthew Chen dcdfcb0a6f Insist upon an "ordered" TCP data channel for delivery reliability.
// FREEBIE
8 years ago
Michael Kirk 0c8da2865e Fix search/replace
// FREEBIE
8 years ago
Michael Kirk eb0399f040 Fix "Call failed" due to deadlock when immediately terminating call
It's not clear why we were ever dispatching `sync` here.

Before this:

Place a call
See "connecting..."
Hang up
UI hangs for ~5 seconds
See "call failed" on CallKit screen
Press "cancel" on CallKit screen
returned to responsive app.

// FREEBIE
8 years ago
Michael Kirk e3eca4db7b stop videoCapture until video track is enabled to save some battery
Instruments showed a reduction from ~65% -> ~45% while on audio only
call on iPhone5c.

// FREEBIE
8 years ago
Michael Kirk 4b8a5f8ccb TURN-only option, and for unknown caller
Now, by default, we only use TURN for incoming calls from unknown
contacts. We will potentially directly connect for outgoing calls and
for incoming calls from known contacts.

Optionally, the user can disable direct connection altogether, at the
cost of some call quality.

// FREEBIE
8 years ago
Michael Kirk 2f6bf0e551 Code cleanup per CR
// FREEBIE
8 years ago
Matthew Chen 217866c588 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 228b0e7dc6 Synchronize access to remoteVideoTrack.
// FREEBIE
8 years ago
Matthew Chen ca76ec6f36 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 6f3a45ff8c Avoid crashes when deallocating remote video tracks.
// FREEBIE
8 years ago
Matthew Chen d9bcd563b1 Avoid possible deadlock in PeerConnectionClient.
// FREEBIE
8 years ago
Matthew Chen 98caeb6a03 Be even more cautious when tearing down a PeerConnectionClient.
// FREEBIE
8 years ago
Matthew Chen 36356fbff6 Avoid crashes when closing peer connection client.
// FREEBIE
8 years ago
Matthew Chen dacb2840f2 Avoid crashes when closing peer connection client.
// FREEBIE
8 years ago
Matthew Chen 535770a92e 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 dd374afdaa Rework concurrency in the signaling logic.
// FREEBIE
8 years ago
Matthew Chen af289145b5 Rework concurrency in the signaling logic.
// FREEBIE
8 years ago
Matthew Chen 50addfa4e8 Remove camera constraints.
// FREEBIE
8 years ago
Michael Kirk 459d0d6012 Working around a bizarre crash on iOS 9
Without this, I get a SEGFAULT on iOS 9.3 device 1 in 3 calls when
accessing the RTC extern constants. Swift bug?

Currently using XCode 8.2

// 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
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 fc6da05259 remove some dead code
Related to an earlier failed attempt of reconciling CallKit audio
management with WebRTC's.

// 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 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