diff --git a/docs/settings.md b/docs/settings.md
index 6292b39f8b5..2ac4f70fcfb 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -83,7 +83,7 @@ Legend:
| `sip_bridge_dialin_info` | string | | Yes | 🖌️ | Additional information added in the SIP dial-in invitation mail and sidebar |
| `sip_bridge_dialout_anonymous` | bool | `false` | No | | When set to true, all out-going SIP calls will be anonymous calls (CLIR) |
| `sip_bridge_dialout_number` | string | | No | | Fallback phone number that is used as caller for out-going calls when the user has no phone-number configured (has to be E164 `+49123456789` formatted) |
-| `sip_bridge_dialout_prefix` | string | `+` | No | | Prefix that is added before the first configured phone-number of a user to make it a valid E164 number to be used as a caller for out-going calls |
+| `sip_bridge_dialout_prefix` | string | `+` | No | | Deprecated: Only used for direct dial-in from older SIP bridges, which send phone numbers without this prefix |
| `sip_bridge_shared_secret` | string | | Yes | 🖌️ | Shared secret allowing the SIP bridge to authenticate on the Nextcloud server |
| `signaling_ticket_secret` | string | | Yes | | Secret used to secure the signaling tickets for guests (255 character random string) |
| `signaling_token_alg` | string
`ES256`, `ES384`, `RS256`, `RS384`, `RS512` or `EdDSA` | `ES256` | Yes | | Algorithm for the signaling tickets |
diff --git a/lib/Command/PhoneNumber/AddPhoneNumber.php b/lib/Command/PhoneNumber/AddPhoneNumber.php
index 632fd6602a9..4da3893545c 100644
--- a/lib/Command/PhoneNumber/AddPhoneNumber.php
+++ b/lib/Command/PhoneNumber/AddPhoneNumber.php
@@ -66,8 +66,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
$userId = $user->getUID();
+ $phoneNumber = $this->phoneNumberValidation->cleanNumber($phoneNumber);
+
+ if ($phoneNumber === '') {
+ $output->writeln('
- {{ t('spreed', 'Prefix to configured user number for outgoing calls (default is `+`)') }} + {{ t('spreed', 'Deprecated: Only used for direct dial-in from older SIP bridges, which send phone numbers without this prefix (default is `+`)') }}
diff --git a/tests/integration/features/command/phone-number.feature b/tests/integration/features/command/phone-number.feature index 432e1ae2904..a73d24fd8b1 100644 --- a/tests/integration/features/command/phone-number.feature +++ b/tests/integration/features/command/phone-number.feature @@ -6,7 +6,7 @@ Feature: command/phone-number Given user "participant2" exists Given invoking occ with "talk:phone-number:add abc participant1" Then the command failed with exit code 1 - And the command output contains the text "Not a valid phone number abc. The format is invalid." + And the command output contains the text "Phone number is invalid." Given invoking occ with "talk:phone-number:add +49-160-123-12-12 participant3" Then the command failed with exit code 1 @@ -14,19 +14,23 @@ Feature: command/phone-number Given invoking occ with "talk:phone-number:add +49-160-123-12-12 participant1" Then the command failed with exit code 0 - And the command output contains the text "Phone number 491601231212 is now assigned to participant1" + And the command output contains the text "Phone number +491601231212 is now assigned to participant1" - Given invoking occ with "talk:phone-number:find --phone 491601231212" + Given invoking occ with "talk:phone-number:find --phone +491601231212" Then the command failed with exit code 0 - And the command output contains the text "Phone number 491601231212 is assigned to participant1" + And the command output contains the text "Phone number +491601231212 is assigned to participant1" - Given invoking occ with "talk:phone-number:find --phone 49160123121234" + Given invoking occ with "talk:phone-number:find --phone +49-160-123-12-12" + Then the command failed with exit code 0 + And the command output contains the text "Phone number +491601231212 is assigned to participant1" + + Given invoking occ with "talk:phone-number:find --phone +49160123121234" Then the command failed with exit code 1 - And the command output contains the text "Phone number 49160123121234 could not be found" + And the command output contains the text "Phone number +49160123121234 could not be found" Given invoking occ with "talk:phone-number:find --user participant1" Then the command failed with exit code 0 - And the command output contains the text "participant1 has phone number 491601231212 assigned" + And the command output contains the text "participant1 has phone number +491601231212 assigned" Given invoking occ with "talk:phone-number:find --user participant2" Then the command failed with exit code 1 @@ -34,13 +38,13 @@ Feature: command/phone-number Given invoking occ with "talk:phone-number:add +49-160-123-1213 participant1" Then the command failed with exit code 0 - And the command output contains the text "Phone number 491601231213 is now assigned to participant1" + And the command output contains the text "Phone number +491601231213 is now assigned to participant1" Given invoking occ with "talk:phone-number:find --user participant1" Then the command failed with exit code 0 And the command output contains the text "participant1 has the following phone numbers assigned:" - And the command output contains the text "- 491601231212" - And the command output contains the text "- 491601231213" + And the command output contains the text "- +491601231212" + And the command output contains the text "- +491601231213" Given invoking occ with "talk:phone-number:add +49-160-123-1212 participant2" Then the command failed with exit code 1 @@ -48,7 +52,7 @@ Feature: command/phone-number Given invoking occ with "talk:phone-number:add --force '+49-160-123-12-12' participant2" Then the command failed with exit code 0 - And the command output contains the text "Phone number 491601231212 is now assigned to participant2" + And the command output contains the text "Phone number +491601231212 is now assigned to participant2" And the command output contains the text "Was assigned to participant1" Given invoking occ with "talk:phone-number:add 23 participant2" @@ -58,14 +62,14 @@ Feature: command/phone-number Given invoking occ with "talk:phone-number:find --user participant2" Then the command failed with exit code 0 And the command output contains the text "participant2 has the following phone numbers assigned:" - And the command output contains the text "- 491601231212" + And the command output contains the text "- +491601231212" And the command output contains the text "- 23" Given invoking occ with "talk:phone-number:find --user participant1" Then the command failed with exit code 0 - And the command output contains the text "participant1 has phone number 491601231213 assigned" + And the command output contains the text "participant1 has phone number +491601231213 assigned" - Given invoking occ with "talk:phone-number:remove 491601231213" + Given invoking occ with "talk:phone-number:remove +49-160-123-1213" Then the command failed with exit code 0 Given invoking occ with "talk:phone-number:find --user participant1" @@ -89,19 +93,19 @@ Feature: command/phone-number # Valid German number Given invoking occ with "talk:phone-number:add 004971112347 participant1" Then the command failed with exit code 0 - And the command output contains the text "Phone number 4971112347 is now assigned to participant1" + And the command output contains the text "Phone number 004971112347 is now assigned to participant1" Given invoking occ with "talk:phone-number:add +4971112346 participant1" Then the command failed with exit code 0 - And the command output contains the text "Phone number 4971112346 is now assigned to participant1" + And the command output contains the text "Phone number +4971112346 is now assigned to participant1" - Given invoking occ with "talk:phone-number:add 4971112345 participant1" + Given invoking occ with "talk:phone-number:add +4971112345 participant1" Then the command failed with exit code 0 - And the command output contains the text "Phone number 4971112345 is now assigned to participant1" + And the command output contains the text "Phone number +4971112345 is now assigned to participant1" Given invoking occ with "talk:phone-number:add 071112348 participant1" Then the command failed with exit code 0 - And the command output contains the text "Phone number 4971112348 is now assigned to participant1" + And the command output contains the text "Phone number 071112348 is now assigned to participant1" # 01122 is not a valid prefix in Germany Given invoking occ with "talk:phone-number:add 011223344 participant1" @@ -126,4 +130,4 @@ Feature: command/phone-number # Valid US number Given invoking occ with "talk:phone-number:add 00112345678901 participant1" Then the command failed with exit code 0 - And the command output contains the text "Phone number 12345678901 is now assigned to participant1" + And the command output contains the text "Phone number 00112345678901 is now assigned to participant1" diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index d82d5f9fd39..5a96c5e913b 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -36,6 +36,7 @@
+
@@ -60,6 +61,7 @@