Skip to content

Feat/sipjs upgrade#147

Open
Dagg-h wants to merge 16 commits intomainfrom
feat/sipjs-upgrade
Open

Feat/sipjs upgrade#147
Dagg-h wants to merge 16 commits intomainfrom
feat/sipjs-upgrade

Conversation

@Dagg-h
Copy link
Collaborator

@Dagg-h Dagg-h commented Nov 13, 2025

Expected behaviour

Exactly the same as before, but with new updates.

Description of fix

Upgraded gradually sipJS.

How to test

You can use the demo test page to check if calling still works! If you need config, contact me.
For within the webphone you need a change. I can provide this change as well :)

Breaking

Server is being set differently. In the demo it is demonstrated how to set it.
Like so:

export function setTransport(websocketUrl) { transport = { server: websocketUrl, iceServers: [], delegate: { onBeforeInvite } }; }

It used to be:

const transport = {
wsServers: '',
iceServers: []
};

@Dagg-h Dagg-h self-assigned this Nov 13, 2025
@Dagg-h Dagg-h force-pushed the feat/sipjs-upgrade branch from 7a7f37f to 936ba91 Compare December 3, 2025 09:34
Copy link

@marnix-manuel marnix-manuel 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 too little knowledge about the webphone lib to be able to give this a very constructive review.

src/transport.ts Outdated
Comment on lines 75 to 76
// Force close by calling the protected _disconnect method via any cast
// This ensures we don't hang if the websocket doesn't close properly

Choose a reason for hiding this comment

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

issue: Shouldn't this happen somewhere? Or wait, maybe I'm not understanding correctly.

the pTimeout calls the super.disconnect() after a second. If that fails the fallback will be the fake-closing one. And if there is an error we ghet a disconnect error.

But what is being meant with "via any cast"

@Dagg-h Dagg-h force-pushed the feat/sipjs-upgrade branch from 72a4eec to e06923a Compare January 20, 2026 09:44
Dagg-h and others added 16 commits January 20, 2026 15:42
Major breaking changes addressed:

- Updated SessionDescriptionHandler factory to use new API with custom mediaStreamFactory
- Replaced EventEmitter patterns with delegate-based event handling
- Migrated from .on()/.once() to stateChange.addListener() for state changes
- Fixed Subscriber to use stateChange emitter and promise-based error handling
- Updated Session to track startTime/endTime manually (no longer provided by SipJS)
- Replaced session.once('bye') with delegate.onBye pattern
- Fixed Transport event handling to use stateChange emitter
- Updated Referrer API to use session.refer() directly
- Fixed holdModifier import (now standalone function, not SDH property)
- Updated health checker to use transport.disconnect() instead of emit()
- Fixed import paths for renamed/relocated exports

All TypeScript compilation errors resolved.
No breaking changes affecting the codebase:
- hackWssInTransport was not used
- New optional parameters (contactName, contactParams) not required
- All existing APIs remain compatible

TypeScript compilation: ✓ Passed
Changes in 0.19.0:
- RFC 8829 compliant hold implementation (doesn't affect our code)
- Added sendInitialProvisionalResponse parameter (optional)
- Our holdModifier usage remains compatible

TypeScript compilation: ✓ Passed
Changes in 0.20.x:
- Added refreshFrequency for configurable re-REGISTER interval
- Added onAck delegation for Session
- Added extraHeaders support on Invitation.accept
- All changes are backwards compatible

TypeScript compilation: ✓ Passed
- Update sip.js dependency from 0.20.1 to 0.21.2
- Remove deprecated autoStart and autoStop options from UserAgentOptions
- All TypeScript compilation checks pass
- Document all breaking changes from 0.15.6 to 0.21.2
- Include code examples and migration patterns
- Document test infrastructure status
- Add references to migration guides
…21.2

- Upgrade AVA from 2.4.0 to 5.3.1 for better ESM support
- Upgrade TypeScript from 3.6.3 to 5.9.3 for modern features
- Add tsx for running TypeScript tests
- Create separate tsconfig.build.json for build process
- Update tsconfig.json with bundler moduleResolution and ESM support
- Fix TypeScript 5 strictness issues:
  - Add type assertion in freeze.ts
  - Fix parameter destructuring syntax in session.ts
  - Add Promise<void> type annotation in health-checker.ts
- Tests now run successfully (utils tests pass, some test logic needs updating)
- Build process works correctly
- Library output remains ESM format
The web service needs time to run npm ci (which includes lint and build
in the prepare hook) before it's ready. CI logs show this takes ~18
seconds. Increasing the delay from 10 to 30 seconds ensures the demo
server is fully ready before tests start.

This fixes the timeout issues in CI where tests were starting before
the demo page was available.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Added two flags to ensure microphone/camera permissions don't block
page initialization in headless Chrome:
- --auto-accept-camera-and-microphone-capture: Auto-accepts permission prompts
- --disable-features=AudioServiceOutOfProcess: Prevents audio service issues

This fixes test failures where the page wouldn't load because it was
waiting for user interaction to grant media permissions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Dagg-h Dagg-h force-pushed the feat/sipjs-upgrade branch from 7e809ff to 04250e8 Compare January 20, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants