Skip to content

feat: Add SIP Request Ping and Registration Options Feature#7073

Draft
robertcoroianu wants to merge 24 commits intolouislam:masterfrom
robertcoroianu:feature-sip-integration-requested-mod
Draft

feat: Add SIP Request Ping and Registration Options Feature#7073
robertcoroianu wants to merge 24 commits intolouislam:masterfrom
robertcoroianu:feature-sip-integration-requested-mod

Conversation

@robertcoroianu
Copy link
Copy Markdown
Contributor

@robertcoroianu robertcoroianu commented Mar 1, 2026

Summary

This is a PR based on a previous one: #5382

Changes

  • Relates to 5382
Please follow this checklist to avoid unnecessary back and forth (click to expand)
  • ⚠️ If there are Breaking change (a fix or feature that alters existing functionality in a way that could cause issues) I have called them out
  • 🧠 I have disclosed any use of LLMs/AI in this contribution and reviewed all generated content.
    I understand that I am responsible for and able to explain every line of code I submit.
  • 🔍 Any UI changes adhere to visual style of this project.
  • 🛠️ I have self-reviewed and self-tested my code to ensure it works as expected.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • 🤖 I added or updated automated tests where appropriate.
  • 📄 Documentation updates are included (if applicable).
  • 🧰 Dependency updates are listed and explained.
  • ⚠️ CI passes and is green.

Screenshots for Visual Changes

Copilot AI review requested due to automatic review settings March 1, 2026 16:14
Comment thread server/util-server.js Fixed
Comment thread server/util-server.js Fixed
Comment thread server/util-server.js Fixed
@robertcoroianu robertcoroianu changed the title Added nc and cnonce for SIP registration New - Add SIP Request Ping and Registration Options Feature Mar 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new SIP monitor type with UI/configuration fields and server-side SIP OPTIONS/REGISTER logic (including digest auth nc/cnonce handling).

Changes:

  • Adds sip as a selectable monitor type and introduces SIP-specific configuration fields in the edit UI.
  • Implements SIP OPTIONS/REGISTER requests (including digest auth) in the server utilities and adds a new SIP monitor-type handler.
  • Persists SIP monitor settings via new DB columns and adds required dependencies.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/pages/EditMonitor.vue Adds SIP monitor option and SIP-specific form sections/defaults.
src/lang/en.json Introduces new i18n strings for SIP UI.
server/util-server.js Adds SIP request helpers and digest auth construction (nc/cnonce).
server/uptime-kuma-server.js Registers the new SIP monitor type key and import.
server/server.js Persists SIP fields from incoming monitor config.
server/monitor-types/sip.js New monitor type implementation for SIP checks and status handling.
server/model/monitor.js Exposes SIP fields in monitor JSON + helper boolean parsing.
package.json Adds sip and uuid dependencies.
db/knex_migrations/2026-03-01-0000-add-sip-fields.js Adds SIP-related monitor columns.
db/knex_migrations/2026-03-01-0001-sip-auth.js Adds SIP basic-auth credential columns.

Comment thread server/uptime-kuma-server.js
Comment thread server/uptime-kuma-server.js
Comment thread db/knex_migrations/2026-03-01-0000-add-sip-fields.js Outdated
Comment thread server/server.js Outdated
Comment thread server/model/monitor.js Outdated
Comment on lines +207 to +212
sipUrl: this.sipUrl,
sipPort: this.sipPort,
sipProtocol: this.sipProtocol,
sipMethod: this.sipMethod,
sipMaintainence: this.isSipMaintainence(),
sipAuthMethod: this.sipAuthMethod,
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

The model is exposing SIP fields from this.sipUrl/sipPort/sipProtocol/..., but the migration defines sip_url/sip_port/sip_protocol/.... If the underlying BeanModel stores DB fields under their column names, these will likely be undefined on reads. Update these getters to reference the actual stored fields (or rename columns to match).

Suggested change
sipUrl: this.sipUrl,
sipPort: this.sipPort,
sipProtocol: this.sipProtocol,
sipMethod: this.sipMethod,
sipMaintainence: this.isSipMaintainence(),
sipAuthMethod: this.sipAuthMethod,
sipUrl: this.sip_url,
sipPort: this.sip_port,
sipProtocol: this.sip_protocol,
sipMethod: this.sip_method,
sipMaintainence: this.isSipMaintainence(),
sipAuthMethod: this.sip_auth_method,

Copilot uses AI. Check for mistakes.
Comment thread src/pages/EditMonitor.vue Outdated
Comment thread server/util-server.js Outdated
Comment thread server/util-server.js Outdated
Comment thread server/util-server.js Outdated
Comment thread src/lang/en.json Outdated
@robertcoroianu robertcoroianu changed the title New - Add SIP Request Ping and Registration Options Feature feat: Add SIP Request Ping and Registration Options Feature Mar 1, 2026
@robertcoroianu robertcoroianu force-pushed the feature-sip-integration-requested-mod branch from 409f04b to 230c919 Compare March 1, 2026 16:58
Copy link
Copy Markdown
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

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

I have a few code comments below and copilot also has some.
Also, CI is not green 😉

Comment on lines +3 to +4
table.text("sip_basic_auth_user").defaultTo(null);
table.text("sip_basic_auth_pass").defaultTo(null);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we already have a username and password collum. Please reuse those

Comment thread server/util-server.js Outdated
Comment thread src/pages/EditMonitor.vue Outdated
Comment thread src/pages/EditMonitor.vue Outdated
Comment thread src/pages/EditMonitor.vue Outdated
Comment thread src/pages/EditMonitor.vue Outdated
Comment thread src/pages/EditMonitor.vue
Comment thread src/pages/EditMonitor.vue Outdated
@robertcoroianu robertcoroianu force-pushed the feature-sip-integration-requested-mod branch from 0d3f783 to fb94ce6 Compare March 1, 2026 17:07
@robertcoroianu robertcoroianu marked this pull request as draft March 1, 2026 17:09
@robertcoroianu robertcoroianu marked this pull request as ready for review March 1, 2026 17:09
@github-actions github-actions Bot added the pr:needs review this PR needs a review by maintainers or other community members label Mar 1, 2026
Robert Coroianu added 2 commits March 1, 2026 19:12
Fix package-lock
Replace hostname and port fields with defaults
Move sip methods from util-server
Remove commented code
Remove process-503-as-maintenance
@robertcoroianu robertcoroianu force-pushed the feature-sip-integration-requested-mod branch from c7b0920 to a2d772e Compare March 1, 2026 18:30
Comment thread server/sip.js Fixed
Comment thread server/sip.js Fixed
Comment thread server/sip.js Fixed
@CommanderStorm
Copy link
Copy Markdown
Collaborator

I think you forgot to push some changes since you resolved #7073 (comment) but I don't think it is.

@robertcoroianu
Copy link
Copy Markdown
Contributor Author

I think you forgot to push some changes since you resolved #7073 (comment) but I don't think it is.

Hi, sorry I forgot to delete the migration. Other have exam me I have kids 😅. I will fix it tonight

@louislam
Copy link
Copy Markdown
Owner

louislam commented Mar 2, 2026

I think ./server/sip.js could be merged to ./server/monitor-types/sip.js

Both files called sip.js which could be a bit confusing in the future.

@robertcoroianu robertcoroianu force-pushed the feature-sip-integration-requested-mod branch from 769f727 to d520e70 Compare March 2, 2026 19:16
@robertcoroianu robertcoroianu force-pushed the feature-sip-integration-requested-mod branch from 7a29427 to f3ab240 Compare March 2, 2026 19:23
// Determine hash function based on server's algorithm
let hashFn;
if (algorithm.toLowerCase() === "sha-256" || algorithm.toLowerCase() === "sha256") {
hashFn = (data) => crypto.createHash("sha256").update(data).digest("hex");

Check failure

Code scanning / CodeQL

Use of password hash with insufficient computational effort High

Password from
an access to userPassword
is hashed insecurely.
Password from
an access to userPassword
is hashed insecurely.
Password from
an access to password
is hashed insecurely.
hashFn = (data) => crypto.createHash("sha256").update(data).digest("hex");
} else {
// Default to MD5 (standard SIP digest auth per RFC 2617/3261)
hashFn = (data) => crypto.createHash("md5").update(data).digest("hex");

Check failure

Code scanning / CodeQL

Use of password hash with insufficient computational effort High

Password from
an access to userPassword
is hashed insecurely.
Password from
an access to userPassword
is hashed insecurely.
Password from
an access to password
is hashed insecurely.
hashFn = (data) => crypto.createHash("sha256").update(data).digest("hex");
} else {
// Default to MD5 (standard SIP digest auth per RFC 2617/3261)
hashFn = (data) => crypto.createHash("md5").update(data).digest("hex");

Check failure

Code scanning / CodeQL

Use of a broken or weak cryptographic algorithm High

A broken or weak cryptographic algorithm
depends on
sensitive data from an access to username
.
A broken or weak cryptographic algorithm
depends on
sensitive data from an access to username
.
A broken or weak cryptographic algorithm
depends on
sensitive data from an access to username
.
@robertcoroianu robertcoroianu force-pushed the feature-sip-integration-requested-mod branch from 53b9bb6 to 8622006 Compare March 2, 2026 19:34
@robertcoroianu
Copy link
Copy Markdown
Contributor Author

is

Can you review again? Thank you

@robertcoroianu
Copy link
Copy Markdown
Contributor Author

I think ./server/sip.js could be merged to ./server/monitor-types/sip.js

Both files called sip.js which could be a bit confusing in the future.

I've made the change, and I refactored a bit

@CommanderStorm
Copy link
Copy Markdown
Collaborator

Why are there sip options and a sip monitor?
What are their differences?

@louislam
Copy link
Copy Markdown
Owner

louislam commented Mar 3, 2026

I think ./server/sip.js could be merged to ./server/monitor-types/sip.js
Both files called sip.js which could be a bit confusing in the future.

I've made the change, and I refactored a bit

I guess you forget to remove ./server/sip.js after merged.

@robertcoroianu robertcoroianu force-pushed the feature-sip-integration-requested-mod branch from 6c5f532 to 81c469f Compare March 3, 2026 07:11
@robertcoroianu
Copy link
Copy Markdown
Contributor Author

Why are there sip options and a sip monitor? What are their differences?

Hi,

The SIP Options feature is a separate implementation that periodically sends PING (OPTIONS) requests to the server to verify its availability.

As mentioned in the description:

"In order to use the SIP Options Ping monitor, you need to install Uptime Kuma without Docker and also install the Sipsak client on your server."

Additionally, this implementation can also use the REGISTER method. This allows you to verify that a user can successfully authenticate with the SIP server using a username and password, not just confirm that the server is responding.

I know it's a bit confusing, but "REGISTER" in SIP is a bit simillar with "Authentication" process. https://pgkrishna.medium.com/sip-understanding-register-method-and-authentication-process-a008f884ff18

@robertcoroianu
Copy link
Copy Markdown
Contributor Author

robertcoroianu commented Mar 3, 2026

I think ./server/sip.js could be merged to ./server/monitor-types/sip.js
Both files called sip.js which could be a bit confusing in the future.

I've made the change, and I refactored a bit

I guess you forget to remove ./server/sip.js after merged.

Yes, I will try to pay more attention to my commits

@CommanderStorm
Copy link
Copy Markdown
Collaborator

Additionally, this implementation can also

So can we migrate the existing sip-options users into this system if this is a pure superset?

@robertcoroianu
Copy link
Copy Markdown
Contributor Author

Additionally, this implementation can also

So can we migrate the existing sip-options users into this system if this is a pure superset?

I think for a period of time, at least, to go with both because maybe some people use it

@CommanderStorm
Copy link
Copy Markdown
Collaborator

If this is a superset, please migrate the existing monitor.
I don't want to have two monitors doing the same thing, that is too messy.

@robertcoroianu
Copy link
Copy Markdown
Contributor Author

If this is a superset, please migrate the existing monitor. I don't want to have two monitors doing the same thing, that is too messy.

Understood, I will take a look at how to do it, but this week I'm quite busy. I will return when it is ready.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:resolve-merge-conflict pr:needs review this PR needs a review by maintainers or other community members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants