Skip to content

fix: use sipExtension instead of freeSwitchExtension on servers >= 9.0.0 - #7796

Merged
Rohit3523 merged 3 commits into
developfrom
fix/voip-sip-extension-field-rename
Oct 13, 2026
Merged

Rohit3523 merged 3 commits into
developfrom
fix/voip-sip-extension-field-rename

Conversation

@Rohit3523

@Rohit3523 Rohit3523 commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Proposed changes

Server 9.0.0 renamed the user field freeSwitchExtension to sipExtension (Rocket.Chat#42568, migration v350, users.autocomplete now projects sipExtension).

The New Call peer search still sent conditions on freeSwitchExtension. users.autocomplete validates conditions against a field allow-list that no longer contains the old name, so on 9.0 the whole request fails with 400 error-invalid-query and the picker shows no users. This happened whenever VoIP_TeamCollab_SIP_Integration_For_Internal_Calls was on, or when a peer with an extension was already selected (the $ne branch). callerId was also read from the old field, so it was always empty.

getPeerAutocompleteOptions now picks the field name from the server version: sipExtension on >= 9.0.0, freeSwitchExtension on older servers. The one extensionField value drives the $exists condition, the $ne condition and the callerId mapping. The response item type gained sipExtension.

Issue(s)

https://rocketchat.atlassian.net/browse/NATIVE-1754

How to test or reproduce

Against a server on 9.0.0 or newer:

  1. Enable VoIP_TeamCollab_SIP_Integration_For_Internal_Calls.
  2. Open New Call and type in the peer search.
  3. Before this change: no users are listed (the request returns 400 error-invalid-query). After: users with a SIP extension are listed and the selected peer's callerId is populated.

Against a server older than 9.0.0 the request is unchanged (freeSwitchExtension).

Automated: pnpm test app/lib/services/voip/getPeerAutocompleteOptions.test.ts covers both sides of the 9.0.0 gate, the SIP-enabled and $ne conditions, and the callerId mapping. I haven't run this against a live 9.0 server yet; the server behaviour was verified by reading release-9.0.0.

Screenshots

N/A

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

The gate lives in getPeerAutocompleteOptions rather than in restApi.usersAutoComplete because that wrapper is a generic pass-through; only this helper knows the field name and the callerId mapping. An unknown or empty server version falls back to freeSwitchExtension, matching the other compareServerVersion gates in the app.

Summary by CodeRabbit

  • Bug Fixes
    • Peer autocomplete now uses SIP extensions for servers running version 9.0.0 or later, while retaining FreeSWITCH extensions for older or unavailable versions.
    • Peer filtering and caller ID values now reflect the extension field appropriate to the server version.

….0.0

Server 9.0.0 renamed the user field freeSwitchExtension to sipExtension (RocketChat/Rocket.Chat#42568). users.autocomplete now rejects conditions on the old field with error-invalid-query, which emptied the New Call peer picker whenever SIP was enabled or a peer with an extension was selected, and left callerId empty. Gate the field name at 9.0.0; older servers keep freeSwitchExtension.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 488818ac-4581-43ef-bbb6-ba9c329d418b
📥 Commits

Reviewing files that changed from the base of the PR and between 7f96e6d and 18a8e32.

📒 Files selected for processing (2)
  • app/lib/services/voip/getPeerAutocompleteOptions.test.ts
  • app/lib/services/voip/getPeerAutocompleteOptions.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: E2E Hold
  • GitHub Check: ESLint and Test / run-eslint-and-test
🔇 Additional comments (2)
app/lib/services/voip/getPeerAutocompleteOptions.ts (1)

2-2: LGTM!

Also applies to: 17-17, 43-46, 52-53, 78-78

app/lib/services/voip/getPeerAutocompleteOptions.test.ts (1)

6-6: LGTM!

Also applies to: 25-25, 28-29, 42-42, 287-353, 355-366

Walkthrough

Peer autocomplete now selects an extension field based on server version. It uses the selected field for extension filtering, peer exclusion, and the returned callerId. Tests cover server versions before and from 9.0.0.

Changes

VoIP peer autocomplete

Layer / File(s) Summary
Versioned extension selection
app/lib/services/voip/getPeerAutocompleteOptions.ts, app/lib/services/voip/getPeerAutocompleteOptions.test.ts
The autocomplete uses sipExtension on servers at version 9.0.0 or later. Earlier or unavailable versions use freeSwitchExtension. Tests cover filtering, selected-peer exclusion, and callerId mapping for both version paths.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: type: bug

Suggested reviewers: diegolmello

Merge Risk: ⚪ Minimal · up to 18a8e

The version-aware autocomplete change is ready to merge after normal checks.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: using sipExtension instead of freeSwitchExtension for servers running version 9.0.0 or newer.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OtavioStasiak OtavioStasiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Rohit3523
Rohit3523 requested a deployment to approve_e2e_testing October 13, 2026 18:10 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 changed the title fix: read sipExtension instead of freeSwitchExtension on servers >= 9.0.0 fix: use sipExtension instead of freeSwitchExtension on servers >= 9.0.0 Oct 13, 2026
@Rohit3523
Rohit3523 merged commit 127b24e into develop Oct 13, 2026
8 of 11 checks passed
@Rohit3523
Rohit3523 deleted the fix/voip-sip-extension-field-rename branch October 13, 2026 18:21

This branch is waiting to be deployed

3 waiting deployments
ios_build — 0fcd6533 Waiting Oct 13, 2026 by Rohit3523 via Build iOS / Hold #7242
android_build — 0fcd6533 Waiting Oct 13, 2026 by Rohit3523 via Build Android / Hold #7242
approve_e2e_testing — 0fcd6533 Waiting Oct 13, 2026 by Rohit3523 via E2E Hold #7242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants