Commit d01ea8a
authored
fix: allow self-managed calls to numbers Android classifies as emergency (WT-1730) (#349)
* fix: allow self-managed calls to numbers Android classifies as emergency
TelecomManager.placeCall() blocks a self-managed PhoneAccount from ever
placing a call to a number the OS classifies as emergency, based purely
on the tel: address matching the device/SIM-region emergency-number
list - regardless of whether the number is actually reachable as one.
This silently drops calls to legitimate internal PBX extensions that
happen to collide with that list (e.g. an extension literally named
112 or 911).
Building the outgoing Uri as a sip: address instead of tel: sidesteps
the check entirely, since it only matches tel: addresses. The real
number keeps flowing unchanged via CallMetadata into
onCreateOutgoingConnection, which never reads the Uri - so this only
affects what Telecom itself sees for its own emergency classification,
not what actually gets dialed.
* build: use portadialer.internal instead of webtrit.invalid for the decoy sip: host
Same RFC-reserved, never-resolving intent (RFC 9476 .internal instead
of RFC 2606 .invalid), just a more identifiable name for this address
in logs.
* build: remove dead emergency-number exception handling on Android
The sip: scheme change means Android's Telecom never classifies our
outgoing calls as emergency anymore, so the code path that used to
catch and report an emergency-number failure can never run:
- removed EmergencyNumberException and its throw/catch sites
- removed the now-single-case-only OutgoingFailureType.EMERGENCY_NUMBER
- removed the now-unused TelephonyUtils.isEmergencyNumber() helper
The shared PCallRequestErrorEnum.emergencyNumber /
CallkeepCallRequestError.emergencyNumber wire values are left in place
deliberately: the Kotlin side encodes this enum by explicit raw Int
values while the Dart side decodes by list index, so removing an entry
from the middle would require re-aligning every value after it by hand
on both sides to avoid a silent wire-format mismatch. Nothing on the
Android side sets this value anymore either way.
* build: centralize outgoing decoy sip: Uri construction in TelephonyUtils
* build: percent-encode the number in the outgoing sip: Uri1 parent 50cf63a commit d01ea8a
7 files changed
Lines changed: 35 additions & 72 deletions
File tree
- webtrit_callkeep_android
- android/src
- main/kotlin/com/webtrit/callkeep
- common
- models
- services/services
- connection
- foreground
- test/kotlin/com/webtrit/callkeep/models
- docs
Lines changed: 26 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | | - | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| |||
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 19 | | |
33 | 20 | | |
34 | 21 | | |
| |||
103 | 90 | | |
104 | 91 | | |
105 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
106 | 97 | | |
107 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
108 | 121 | | |
109 | 122 | | |
110 | 123 | | |
| |||
Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
Lines changed: 8 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| |||
765 | 762 | | |
766 | 763 | | |
767 | 764 | | |
768 | | - | |
769 | 765 | | |
770 | 766 | | |
771 | | - | |
772 | | - | |
| 767 | + | |
773 | 768 | | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
791 | 774 | | |
| 775 | + | |
| 776 | + | |
792 | 777 | | |
793 | 778 | | |
794 | 779 | | |
| |||
Lines changed: 1 addition & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
375 | 374 | | |
376 | 375 | | |
377 | 376 | | |
378 | | - | |
| 377 | + | |
379 | 378 | | |
380 | 379 | | |
381 | 380 | | |
382 | 381 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | 382 | | |
388 | 383 | | |
389 | 384 | | |
| |||
420 | 415 | | |
421 | 416 | | |
422 | 417 | | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | 418 | | |
428 | 419 | | |
429 | 420 | | |
| |||
Lines changed: 0 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | 21 | | |
33 | 22 | | |
34 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 119 | | |
129 | 120 | | |
130 | 121 | | |
| |||
0 commit comments