Commit graph

42 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 30b50e1489 Activate audio at the proper time
// FREEBIE
2017-11-20 14:35:16 -05:00
Michael Kirk abb57f2a15 App icon for system call screen
On iOS10 there was a default "..." button, but now we need our own.

// FREEBIE
2017-11-20 14:04:04 -05:00
Michael Kirk b77e331732 Unify Mute/Hold audio handling
// FREEBIE
2017-11-02 08:49:46 -04: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
Michael Kirk c4139b0f3e Callkit ringer uses profile name
Also presents formatted number instead of e164

// FREEBIE
2017-09-11 10:01:21 -04:00
Michael Kirk c6069376d8 more logging
// FREEBIE
2017-08-02 19:13:06 -04:00
Matthew Chen d639d6557e Add owsFail free function for swift.
// FREEBIE
2017-07-11 16:20:20 -04:00
Michael Kirk 2ec893d315 Ensure we're retaining all promises to completion
// FREEBIE
2017-05-04 15:15:14 -04:00
Matthew Chen f920300f28 Improve handling of call service edge cases.
// FREEBIE
2017-04-19 10:09:40 -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
Matthew Chen c35c118dcd Respond to CR.
// FREEBIE
2017-02-24 23:02:17 -05:00
Matthew Chen 01d2582074 Add and honor the “CallKit Privacy” setting.
// FREEBIE
2017-02-24 23:01:09 -05:00
Matthew Chen f5004b27ab Add and honor the “CallKit Privacy” setting.
// FREEBIE
2017-02-24 23:01:09 -05:00
Matthew Chen 065d383c15 Add and honor the “CallKit Privacy” setting.
// FREEBIE
2017-02-24 23:01:09 -05:00
Michael Kirk 3ab65a2c88 Prevent CallKit timeout when placing outgoing call
More fallout from the outbound call timeout which was causing all
CallKit calls not promptly answered to show "Call Failed"

Inserting the timeout exacerbated an existing issue: We can't wait for
long before choosing to fulfill/fail an action without CallKit falling
over and assuming the call failed.

We don't actually need to consider the case where we "fail to initiate"
the outgoing call. Instead we say it started "successfully, and if there
is an error, the existing promise error handling will fail the call at
that time.

// FREEBIE
2017-02-08 16:25:27 -05:00
Michael Kirk c087c56b0c Fix call timeout
- Previously only incoming calls had their timeout promise fulfilled
- Previously we'd stop the timeout once ringing started, but we
should continue the timeout clock until the users are speaking.

// FREEBIE
2017-02-08 14:25:05 -05:00
Michael Kirk 43e7defa28 Stop any lingering audio session if provider resets.
I've never actually seen this happen, but I think it makes sense.

// FREEBIE
2017-02-03 10:23:19 -05:00
Matthew Chen 0893930485 Handle “busy signal” appropriately.
// FREEBIE
2017-02-02 18:19:38 -05:00
Matthew Chen d4ba4c446b Respond to CR.
// FREEBIE
2017-02-01 14:43:47 -05:00
Matthew Chen af289145b5 Rework concurrency in the signaling logic.
// FREEBIE
2017-02-01 09:43:16 -05:00
Michael Kirk 141a1bd176 Disable half-working call-holding feature all together
consolidated feature-disable logic for incoming/outgoing calls to make
it easier to document, and less likely to break when we *do* implement
CallHolding

// FREEBIE
2017-01-30 16:13:59 -05:00
Michael Kirk 969b73cad8 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
2017-01-30 16:13:58 -05:00
Michael Kirk e425d351c7 WIP: incoming non-signal call while in outgoing signal call
Marking Signal-Call as started, changes the incoming call screen for
subsequent calls to show "Accept & End", "Send to VoiceMail" and "Accept
& Hold" instead of just "Accept" & "Decline"

Though - we don't support Holding. What we really want to see is just
"Accept & End" and "Decline | Send to Voicemail"

// FREEBIE
2017-01-30 16:13:55 -05:00
Matthew Chen 2ef80e569d Improve thread safety in call ui adapter and adatapees.
// FREEBIE
2017-01-30 14:08:53 -05:00
Matthew Chen d560aa022a Reworked call view’s remote video mode. 2017-01-27 11:11:33 -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
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
2017-01-25 12:32:36 -05:00
Michael Kirk 3ee94d57d9 Only NonCallKit adaptee uses manual ringing
- stop executing ringer code on CallKit which manages ringing for us.
- Organize ringing code more clearly.

// FREEBIE
2017-01-24 12:57:02 -05:00
Matthew Chen d4dbe7f44f Disable unused CallKit buttons.
// FREEBIE
2017-01-24 10:04:37 -05:00
Matthew Chen 229d95ecbf Respond to CR.
// FREEBIE
2017-01-24 10:02:03 -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 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 1ed39976ee make public protocol method implementations public
responding to CR

// FREEBIE
2017-01-12 13:27:45 -05:00
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
2017-01-12 13:27:45 -05:00
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
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 9e248168b9 merge CallKitProviderDelegate into CallKitCallUIAdaptee
There was not a clear distinction in responsibilities and mostly the
Adaptee was just delegating to the CKProviderDelegate
2017-01-12 09:56:09 -05:00
Michael Kirk ce3780e44a Wip smashign providerdelgate into UIAdaptee 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