Commit Graph

214 Commits (078a1312fa75c9e4d372d892322e22a378c8a0fd)

Author SHA1 Message Date
Matthew Chen 03aacbd682 [SSK] Try applying national prefixes when parsing phone numbers.
// FREEBIE
8 years ago
Matthew Chen a9ce1cde2f Simplify CallViewController.
// FREEBIE
8 years ago
Matthew Chen 149c64ce49 Refine call service.
// FREEBIE
8 years ago
Michael Kirk 9287b8560c clean up comments per code review
// FREEBIE
8 years ago
Michael Kirk fb5c17a6b4 minimize sound overlap
Because there is some asynchrony involved, there may be a blip during
the switch between sounds/audio sessions

// FREEBIE
8 years ago
Michael Kirk e3faddedbc Disallow bluetooth when user has opted for local receiver
// FREEBIE
8 years ago
Michael Kirk 524ba80b75 WIP: have ensureAudioSession set preferred input
Call it all the time, but only mutate the AVAudioSession when necessary

TODO

Can't switch to iPhone

// FREEBIE
8 years ago
Michael Kirk 220cd345f6 add comments
// FREEBIE
8 years ago
Michael Kirk ba97ff3f5f Label tweaks for device listing
// FREEBIE
8 years ago
Michael Kirk b8ec353d77 Use recommended approach for speakerphone mode
From: https://developer.apple.com/library/content/qa/qa1754/_index.html

Q:  Can you explain the difference between calling the AVAudioSession method overrideOutputAudioPort: with the value AVAudioSessionPortOverrideSpeaker and using the category option AVAudioSessionCategoryOptionDefaultToSpeaker with setCategory:withOptions:error:.

A: The difference is that setting the AVAudioSessionPortOverride by calling overrideOutputAudioPort: is more transient than using the category option AVAudioSessionCategoryOptionDefaultToSpeaker.

Important: The use of both AVAudioSessionPortOverrideSpeaker and AVAudioSessionCategoryOptionDefaultToSpeaker are only applicable to the AVAudioSessionCategoryPlayAndRecord category.
Calling overrideOutputAudioPort: and setting the AVAudioSessionPortOverride to AVAudioSessionPortOverrideSpeaker is a way of temporarily overriding the output to play to the speaker. Any route change or interruption will cause the audio to be routed back to its normal route, following the last-in wins rule. Think of using overrideOutputAudioPort: in terms of what you might use to implement a Speakerphone button where you want to be able to toggle between the speaker (AVAudioSessionPortOverrideSpeaker) and the normal output route (AVAudioSessionPortOverrideNone).

Note: This property is intended to allow 3rd party applications to mimic the behavior of a Speakerphone button and therefore may change the input route as well as output route. For example, setting the AVAudioSessionPortOverride to AVAudioSessionPortOverrideSpeaker while a headset is plugged in will cause the route to change to built-in mic / built-in speaker.

// FREEBIE
8 years ago
Michael Kirk b495b23420 more cleanup and commenting
// FREEBIE
8 years ago
Michael Kirk 03f1bbca62 Move state from CallViewController -> Call
I think whenever reasonable we prefer to consodlidate state on the call

// FREEBIE
8 years ago
Michael Kirk 4e11e90ebb cleanup
- remove dead code
- rename vars
- add coments

// FREEBIE
8 years ago
Michael Kirk 9bd68ed490 WIP: bluetooth shows audio route button instead of speakerphone
// FREEBIE

TODO

NEED
-[ ] icon in route picker
-[ ] commit cleanup

NICE
-[ ] present action sheet automatically when making outgoing bluetooth call
-[ ] left align icons
-[ ] audio is paused when switching between video mode (maybe existing behavior, not sure)
-[ ] Copy: iPhone/iPad/iPod instead of "iPhone Microphone"

DONE
-[x] remove "receiver" from options while in video mode
-[x] show available audio routes
-[x] select available audio routes
-[x] notification if availabe inputs change so we can update call screen
     mid call with available BT route
-[x] include speakerphone in choices
-[x] Enabled button shows active speakerphone. Should still show
     bluetooth picker.
-[x] toggle back and forth between audio devices
-[x] hide audio route button in video mode if no BT available
-[x] Fixed: When on speakerphone - switching to video mode goes back to bluetooth.
-[x] Fixed: When switching to video w/ bluetooth device connected there is no
     audio picker.
-[x] respect speakerphone/BT selection when in or toggling to/from video
-[x] do not hide audio route button when in video mode and bluetooth
     connected
-[x] Show which is currently selected audio route
-[x] switching to speakerphone no longer works
-[x] switching *back* to bluetooth no longer works
-[x] add proper bluetooth button for audio calls
-[x] add proper bluetooth button for video calls
8 years ago
Matthew Chen ac616d6936 Reject the “call connected” promise immediately when clearing a call.
// FREEBIE
8 years ago
Michael Kirk b82aedc3a0 Assertion failures for unexpected promise state
These don't currently result in failed calls, but we should at least
know about it in debug.

// FREEBIE
8 years ago
Michael Kirk 438635393b Don't send ICE updates until after the CallOffer has been sent.
This ensures message ordering for clients that can't handle out of order
call messages (legacy iOS and Android).

Even when we revert the previous commit, to send ICE Updates sooner,
we'll want to keep this (until we're confident all clients can receive
out of order call messages)

// FREEBIE
8 years ago
Michael Kirk d910da0157 Partial revert of: Send ICE updates immediately - 2dcfb4e3b8
That change makes it more likely that the remote client will receive an
ICE update before their peer connection client is set.

We want to ship the robustness fix (waitForPeerConnection in
handleRemoteAddedIceCandidate) before we have the caller start sending
ICE updates immediately, in a future release.

At that time, we can simply revert this commit.

// FREEBIE
8 years ago
Matthew Chen d639d6557e Add owsFail free function for swift.
// FREEBIE
8 years ago
Michael Kirk 2dcfb4e3b8 Send ICE updates immediately.
Now that SN changes do not block incoming messages, the caller does not
need to enqueue outgoing ICE updates.

However this introduces the possibility that the call recipient could
recieve an ICE update before their peerConnectionClient is set up - so
now we ensure that call service waits for it's peerConnectionClient
before processing incoming ICE updates.

// FREEBIE
8 years ago
Matthew Chen 1a400f8414 Respond to CR.
// FREEBIE
8 years ago
Matthew Chen b6531a8b5d If two users call each other at the same time, ensure they both see “busy”.
// FREEBIE
8 years ago
Michael Kirk f681712ea0 Code Cleanup
- make some logging clearer
- remove noisy unhelpful logging
- clearer method names

// FREEBIE
8 years ago
Michael Kirk d8330a2c4f Fix bluetooth audio for calls
Allow bluetooth in all call speaking modes. This was much simpler to fix
now that all call AudioSession mgmt happens in one method.

// FREEBIE
8 years ago
Matthew Chen 0244e134f5 Block device from sleeping during certain activities.
// FREEBIE
8 years ago
Michael Kirk 1f9f066fa9 print call record when declining a call
// FREEBIE
8 years ago
Michael Kirk 1e0cf89f7a Explanatory comment
// FREEBIE
8 years ago
Michael Kirk 43a3a4afaf play *after* stop
In theory this shouldn't make a difference, since we're not playing the
ringer twice, but in practice I fail to here ringer audio 50% of the
time (in DEBUG builds) while app is in the foreground.

// FREEBIE
8 years ago
Michael Kirk 8abde1dff8 Non-Callkit adapter plays audio from notification when app is in
background

// FREEBIE
8 years ago
Matthew Chen 3d0811c03f Respond to CR.
// FREEBIE
8 years ago
Matthew Chen 029da7e0ce Hang up current call if we receive a call offer from the same user.
// FREEBIE
8 years ago
Matthew Chen 9fc92990f5 Improve logging in CallService.
// FREEBIE
8 years ago
Michael Kirk 39563ab8c2 present from signalsViewController so users don't get confused by being
dropped into a different thread when the call is over.

e.g. chatting with Alice, but Bob calls. When I end the call with Bob It
would be too easy to fire off a message assuming it's going to Bob.

// FREEBIE
8 years ago
Michael Kirk 36c09aeb84 cleanup ahead of PR
// FREEBIE
8 years ago
Michael Kirk ff93732ed7 WIP: fix call from contacts when signal hasn't been launched yet 8 years ago
Matthew Chen bd440f0878 Respond to post-holiday code reviews.
// FREEBIE
8 years ago
Matthew Chen 3bc73bea25 Don't return busy signal to untrusted callers.
// FREEBIE
8 years ago
Matthew Chen f5f506d06f Investigate “call stuck on connecting” issue.
// FREEBIE
9 years ago
Michael Kirk 1a3204bf46 create interaction in thread when missing call due to changed identity
// FREEBIE
9 years ago
Michael Kirk 8c592a373a log error on assertion failure
// FREEBIE
9 years ago
Michael Kirk c8d547a08f Only allow callback for identities that were not previously verified
// FREEBIE
9 years ago
Michael Kirk 1127553041 restore "confirm and callback" functionality
// FREEBIE
9 years ago
Michael Kirk 146031e4d5 update copy / remove some unused "unseen" tracking
// FREEBIE
9 years ago
Michael Kirk 41a34e572b Update Safety Number alerts to work with verification
// FREEBIE
9 years ago
Matthew Chen ceb210748e Sketch out OWSIdentityManager.
// FREEBIE
9 years ago
Michael Kirk 5b12f4afae Prevent outgoing calls started from various places unless have been seen
e.g. from contacts app

// FREEBIE
9 years ago
Michael Kirk 130aa132a0 Reject incoming calls from an unseen changed identity
// FREEBIE
9 years ago
Michael Kirk 17cff1a26d Revert "Merge branch 'charlesmchen/bluetoothAudio'"
This reverts commit 48a2005aa2, reversing
changes made to de1332479c.

// FREEBIE
9 years ago
Matthew Chen 6c9f44b99d Clean up ahead of PR.
// FREEBIE
9 years ago
Matthew Chen 7e18052c45 Fix Bluetooth audio in calls.
// FREEBIE
9 years ago