chore!: rename user freeSwitchExtension attribute to sipExtension
Merged
KE
2mo ago+150+150+012345678901234567890123456789-131-131-012345678901234567890123456789
Proposed changes (including videos or screenshots)
The freeSwitchExtension user attribute dates from the first VoIP version, which was tied to FreeSWITCH. The new VoIP architecture reuses it but works with any SIP router, so this renames it to sipExtension. The Apps-Engine already uses that name.
- Renames the field across
IUser, the Users model and its unique sparse index, the model method (findOneBySipExtension), REST typings, server code, the admin and room UI,ui-voipandmedia-calls. - Adds migration
v349, which renames the field with$renamein batches of 1000 users and drops the oldfreeSwitchExtension_1index. The model creates thesipExtension_1index on startup; existing values are already unique, so renamed values can't conflict.
Breaking: REST clients must use sipExtension in the users.create and users.update body, as the users.info lookup parameter, and when reading user objects.
Issue(s)
https://rocketchat.atlassian.net/browse/CORE-2748
Steps to test or reproduce
- On a workspace running the previous version, assign a VoIP extension to a few users (Administration > Users > Edit).
- Upgrade to this branch and let migrations run.
- Users keep their extension, now stored as
sipExtension, andfreeSwitchExtensionis gone from every user document. GET /api/v1/users.info?sipExtension=<ext>returns the user, and voice calls by extension still work.
Further comments
I checked the migration logic against MongoDB 7 with 2,503 users, 1,252 of them with an extension. All were renamed across several batches, and only the new index remained.
Summary by CodeRabbit
- New Features
- SIP integrations can use
sipExtensionto create and update users, look up users through the REST API, and receive the extension in user details. - Admin screens display and support sorting by SIP extension, and existing user extensions are migrated automatically.
- SIP integrations can use
- Bug Fixes
- User search, voice-call routing, and extension availability checks now use SIP extensions.