Commit Graph

48 Commits

Author SHA1 Message Date
Matthew Chen 8cc33b3de1 Refine loading view of share extension. 2017-12-01 10:48:18 -05:00
Michael Kirk a11d83187b WIP: Framework-friendly - compiles but crashes on launch
// FREEBIE
2017-11-29 13:58:27 -08:00
Michael Kirk 86c1a3d08a CR: use weak capture
// FREEBIE
2017-11-20 14:41:00 -05:00
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
2017-11-20 14:35:16 -05:00
Michael Kirk 2e75e9df55 Don't ignore critical errors
// FREEBIE
2017-11-20 14:35:16 -05:00
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
2017-11-02 08:49:46 -04:00
Matthew Chen e8daf9a8d3 Fix assert when missing camera permission during calls.
// FREEBIE
2017-09-18 16:03:03 -04:00
Matthew Chen 465711c2cb Add script to extract and gather analytics event names.
// FREEBIE
2017-07-27 12:45:29 -04:00
Matthew Chen 863fd27abe Respond to CR.
// FREEBIE
2017-07-26 10:52:15 -04:00
Matthew Chen d639d6557e Add owsFail free function for swift.
// FREEBIE
2017-07-11 16:20:20 -04:00
Michael Kirk f681712ea0 Code Cleanup
- make some logging clearer
- remove noisy unhelpful logging
- clearer method names

// FREEBIE
2017-07-10 11:09:39 -05:00
Matthew Chen f5f506d06f Investigate “call stuck on connecting” issue.
// FREEBIE
2017-06-13 11:18:27 -04:00
Matthew Chen dcdfcb0a6f Insist upon an "ordered" TCP data channel for delivery reliability.
// FREEBIE
2017-05-05 10:41:00 -04:00
Michael Kirk 0c8da2865e Fix search/replace
// FREEBIE
2017-03-23 20:52:42 -04:00
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
2017-03-22 10:48:37 -04:00
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
2017-03-06 12:48:47 -05:00
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
2017-02-24 11:21:52 -08:00
Michael Kirk 2f6bf0e551 Code cleanup per CR
// FREEBIE
2017-02-08 10:33:43 -05:00
Matthew Chen 217866c588 Respond to CR.
// FREEBIE
2017-02-06 12:05:25 -05:00
Matthew Chen 228b0e7dc6 Synchronize access to remoteVideoTrack.
// FREEBIE
2017-02-06 11:18:30 -05:00
Matthew Chen ca76ec6f36 Respond to CR.
// FREEBIE
2017-02-06 09:39:14 -05:00
Matthew Chen 6f3a45ff8c Avoid crashes when deallocating remote video tracks.
// FREEBIE
2017-02-06 09:33:47 -05:00
Matthew Chen d9bcd563b1 Avoid possible deadlock in PeerConnectionClient.
// FREEBIE
2017-02-06 09:33:47 -05:00
Matthew Chen 98caeb6a03 Be even more cautious when tearing down a PeerConnectionClient.
// FREEBIE
2017-02-03 11:29:47 -05:00
Matthew Chen 36356fbff6 Avoid crashes when closing peer connection client.
// FREEBIE
2017-02-01 21:55:10 -05:00
Matthew Chen dacb2840f2 Avoid crashes when closing peer connection client.
// FREEBIE
2017-02-01 21:52:01 -05:00
Matthew Chen 535770a92e Avoid crashes when closing peer connection client.
// FREEBIE
2017-02-01 17:58:54 -05:00
Matthew Chen 4dec1e2ded Avoid crashes when closing peer connection client.
// FREEBIE
2017-02-01 17:38:17 -05:00
Matthew Chen b415b6142f Respond to CR, mainly by fixing broken tests.
// FREEBIE
2017-02-01 12:26:10 -05:00
Matthew Chen 49bb3d942d Clean up ahead of PR.
// FREEBIE
2017-02-01 10:44:29 -05:00
Matthew Chen d294557bdd Rework concurrency in the signaling logic.
// FREEBIE
2017-02-01 10:24:23 -05:00
Matthew Chen dd374afdaa Rework concurrency in the signaling logic.
// FREEBIE
2017-02-01 09:43:16 -05:00
Matthew Chen af289145b5 Rework concurrency in the signaling logic.
// FREEBIE
2017-02-01 09:43:16 -05:00
Matthew Chen 50addfa4e8 Remove camera constraints.
// FREEBIE
2017-01-30 14:08:32 -05:00
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
2017-01-30 13:35:39 -05:00
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
2017-01-26 16:56:35 -05:00
Matthew Chen a65d3b7c4e Add video-related views.
// FREEBIE
2017-01-26 16:41:59 -05:00
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
2017-01-26 13:18:06 -05:00
Matthew Chen 9e739433c5 Start work on video.
// FREEBIE
2017-01-23 13:41:59 -05:00
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
2017-01-17 21:49:13 -05:00
Michael Kirk 0072ee3033 Ensure a stale peerConnectionClient doesn't call any methods on the CallService
Nil delegates when terminating call

// FREEBIE
2017-01-17 20:19:55 -05:00
Michael Kirk 32789bd960 Move RTCDataChannelDelegate to PeerConnectionClient
- minimizes CallService exposure to WebRTC

// FREEBIE
2017-01-17 20:14:33 -05:00
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
2017-01-17 20:14:33 -05:00
Michael Kirk fc6da05259 remove some dead code
Related to an earlier failed attempt of reconciling CallKit audio
management with WebRTC's.

// FREEBIE
2017-01-12 13:27:45 -05:00
Michael Kirk c7449db289 remove stubbed audio manager implementation until it's clear what to do
with it.

// FREEBIE
2017-01-12 09:56:09 -05:00
Michael Kirk f9b44c8892 Added CallService documentation
// FREEBIE
2017-01-12 09:56:08 -05:00
Michael Kirk 57ad7a2808 cleanup 2017-01-12 09:56:08 -05:00
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
2017-01-12 09:56:05 -05:00