Commit graph

248 commits

Author SHA1 Message Date
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
402d4157c8 Uniform volume when ringing on speakerphone vs video
// FREEBIE
2017-11-02 08:49:46 -04:00
Michael Kirk
36a39caad6 Remove overzealous assert
// FREEBIE
2017-11-02 08:49:46 -04:00
Michael Kirk
dd5a19d1fd Suspend while answering shows "Missed Call"
When awakened by a voip push, we get some arbitrary amount of background
time to connect the call (in practice this is ~30s) before the app is
suspended.

Though we were properly terminating the call upon being suspended, we
were not notifying the user that they had missed a call.

// FREEBIE
2017-10-12 14:34:36 -04:00
Michael Kirk
3d3af21792 CR: clarify comment, proper linewrap
// FREEBIE
2017-10-05 13:02:39 -04:00
Michael Kirk
c3dc8508ab pre-PR cleanup
// FREEBIE
2017-10-05 13:02:38 -04:00
Michael Kirk
39e5875a36 remove overzealous assert 2017-10-05 13:02:38 -04:00
Michael Kirk
ff2f9ebaf0 fix compiling on 32bit.
// FREEBIE
2017-10-05 13:02:38 -04:00
Michael Kirk
f171c56488 Video calls use MetalKit when available
Taking advantage of the new RTCMTLVideoView where available
(64bit && >=iOS9), should help performance (battery and rendering
quality).

// FREEBIE
2017-10-05 13:02:38 -04:00
Matthew Chen
445f6dc6f8 Respond to CR.
// FREEBIE
2017-09-21 17:03:57 -04:00
Matthew Chen
35a2470cb7 Post notifications asynchronously.
// FREEBIE
2017-09-21 17:03:57 -04:00
Matthew Chen
3367292ba0 Merge branch 'hotfix/2.16.1' 2017-09-19 17:25:24 -04:00
Matthew Chen
b6d782046a Normalize conversation presentation logic.
// FREEBIE
2017-09-18 16:08:18 -04:00
Matthew Chen
7b1b532b19 Respond to CR.
// FREEBIE
2017-09-18 16:05:01 -04:00
Matthew Chen
43370ffc3f Fix assert during calls without camera permission.
// FREEBIE
2017-09-18 16:03:03 -04:00
Matthew Chen
e8daf9a8d3 Fix assert when missing camera permission during calls.
// FREEBIE
2017-09-18 16:03:03 -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
3d9796db77 Debug actions for calling
For testing stale hangup/busy messages

Extracted MessageSender promise API
Moved call debug actions to their own page

// FREEBIE
2017-08-11 09:21:11 -04:00
Michael Kirk
8da3108b53 Drop stale EndCall/BusyCall messages
// FREEBIE
2017-08-11 07:35:48 -04:00
Matthew Chen
d9bc3ac806 Respond to CR.
// FREEBIE
2017-08-03 10:49:37 -04:00
Matthew Chen
791e270578 Terminate call if call view presentation is delayed.
// FREEBIE
2017-08-03 10:29:40 -04:00
Matthew Chen
634617b7d4 Terminate call if call view presentation is delayed.
// FREEBIE
2017-08-03 10:26:22 -04:00
Michael Kirk
81d7f28253 Timer to ensure call screen shown
// FREEBIE
2017-08-02 19:13:46 -04:00
Michael Kirk
c6069376d8 more logging
// FREEBIE
2017-08-02 19:13:06 -04:00
Matthew Chen
dd13119f12 Add more instrumentation to CallService.
// FREEBIE
2017-07-27 13:57:29 -04:00
Matthew Chen
904515994f Add more instrumentation to CallService.
// FREEBIE
2017-07-27 13:28:05 -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
0cf9c01af2 Add script to extract and gather analytics event names.
// FREEBIE
2017-07-27 12:27:48 -04:00
Matthew Chen
8aff95c44e Add script to extract and gather analytics event names.
// FREEBIE
2017-07-27 12:26:02 -04:00
Matthew Chen
b4f348ad14 Add script to extract and gather analytics event names.
// FREEBIE
2017-07-27 12:26:02 -04:00
Matthew Chen
31ab9a00da Add script to extract and gather analytics event names.
// FREEBIE
2017-07-27 12:26:02 -04:00
Matthew Chen
863fd27abe Respond to CR.
// FREEBIE
2017-07-26 10:52:15 -04:00
Matthew Chen
8e51b5ade1 Clean up ahead of PR.
// FREEBIE
2017-07-26 10:01:43 -04:00
Matthew Chen
958a8b4c80 Instrument CallService.
// FREEBIE
2017-07-26 10:01:43 -04:00
Matthew Chen
03aacbd682 [SSK] Try applying national prefixes when parsing phone numbers.
// FREEBIE
2017-07-21 15:21:22 -04:00
Matthew Chen
a9ce1cde2f Simplify CallViewController.
// FREEBIE
2017-07-19 09:47:55 -04:00
Matthew Chen
149c64ce49 Refine call service.
// FREEBIE
2017-07-19 09:47:55 -04:00
Michael Kirk
9287b8560c clean up comments per code review
// FREEBIE
2017-07-15 17:11:41 -04:00
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
2017-07-15 17:11:41 -04:00
Michael Kirk
e3faddedbc Disallow bluetooth when user has opted for local receiver
// FREEBIE
2017-07-15 17:11:41 -04:00
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
2017-07-15 17:11:41 -04:00
Michael Kirk
220cd345f6 add comments
// FREEBIE
2017-07-15 17:11:41 -04:00
Michael Kirk
ba97ff3f5f Label tweaks for device listing
// FREEBIE
2017-07-15 17:11:41 -04:00
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
2017-07-14 09:49:48 -04:00
Michael Kirk
b495b23420 more cleanup and commenting
// FREEBIE
2017-07-13 17:08:42 -04:00
Michael Kirk
03f1bbca62 Move state from CallViewController -> Call
I think whenever reasonable we prefer to consodlidate state on the call

// FREEBIE
2017-07-13 17:08:42 -04:00
Michael Kirk
4e11e90ebb cleanup
- remove dead code
- rename vars
- add coments

// FREEBIE
2017-07-13 17:08:41 -04:00
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
2017-07-13 17:08:41 -04:00
Matthew Chen
ac616d6936 Reject the “call connected” promise immediately when clearing a call.
// FREEBIE
2017-07-12 18:12:27 -04:00
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
2017-07-12 16:15:22 -04:00