Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes the user agent field is out of date #2453

Open
MartinJPaterson opened this issue May 2, 2024 · 0 comments
Open

Sometimes the user agent field is out of date #2453

MartinJPaterson opened this issue May 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MartinJPaterson
Copy link
Contributor

Describe the bug
For some phone types a forceful reboot of a phone followed by a firmware update causes the user agent (which for many phones contains the phone's firmware version) in the sip_registrations table (and in the command sofia status profile xxx reg) to be out of date.

To Reproduce
Steps to reproduce the behavior:

  1. Register a Yealink phone
  2. Reboot the phone by powering it off - pull out the power cable (or the LAN cable if it's POE). Rebooting "properly" through the phone's UI or holding the x button doesn't trigger this bug.
  3. The phone contacts a provisioning server which updates its firmware. That causes the phone's user agent to change.
  4. When the phone registers again on the new firmware, FreeSWITCH doesn't update its user agent field.

Expected behavior
FreeSWITCH should update the user agent field on every registration

Package version or git hash

  • Version 1.10.11

Explanation
The function sofia_reg_handle_register_token either inserts or updates the registration entry in the sip_registrations table. When it updates, it doesn't change the user_agent field. When you reboot a phone properly, it sends a deregister to FreeSWITCH before rebooting, deleting the sip_registrations table entry. When the phone starts again after the firmware upgrade FS inserts a new row with the new firmware. If you reboot a by just killing the power, then it doesn't deregister, so after the firmware update FS will still be updating the registration in the sip_registrations table, therefore not updating the user agent.
I specified a Yealink phone to reproduce this - Snoms don't have this problem because the new registration after reboot has a different callID, so is treated as a different registration by FS. However Yealinks keep the same CallID in this situation.

Fix
The fix is simply to include the user_agent field in the database update.

@MartinJPaterson MartinJPaterson added the bug Something isn't working label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant