-
-
Notifications
You must be signed in to change notification settings - Fork 498
feat: Add JJSIP based phone option to chat #561
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
Open
adriavidal
wants to merge
8
commits into
advanced-chat:main
Choose a base branch
from
adriavidal:feat/jjsip-phone-option
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Integrates JJSIP.js to enable voice call functionality within chat rooms. Key changes: - Added `jjsipService.js` to manage JJSIP User Agent, call session lifecycle (make, answer, hangup), and event handling. - Modified `Room.vue` to: - Initialize and use `jjsipService`. - Manage call states (incoming, active, errors). - Render UI for incoming call notifications (with Answer/Decline) and active call display (with Hang Up). - Include an `<audio>` element for remote audio playback, connected via `jjsipService`. - Updated `RoomHeader.vue` to include a "Call" button that initiates calls. - Made JJSIP credentials (SIP URI, password, server) configurable via props from your demo application (`App.vue` -> `ChatContainer.vue` -> `ChatWindow.vue` -> `Room.vue`). - Added a placeholder `vendor/jjsip.min.js` as the JJSIP library was not found on standard package managers/CDNs during development. - Implemented unit tests for `jjsipService.js`, `Room.vue`, and `RoomHeader.vue` to cover the new functionality, including mocking of the JJSIP library and service interactions.
Adds a Dockerfile and instructions to build and run the demo application in a Docker container. - Creates a multi-stage `demo/Dockerfile` using Node.js for the build stage and Nginx for the serve stage. - Adds `demo/.dockerignore` to exclude unnecessary files from the image. - Creates `demo/README.md` with instructions on how to build and run the Docker container.
Addresses issues related to `package-lock.json` in the demo's Docker build. - Modifies `demo/Dockerfile` to remove the `COPY package-lock.json ./` line. The `npm install` command during the Docker build will handle lockfile generation internally if one is not present. This prevents build failures if `package-lock.json` is missing from the `demo/` directory. - Updates `demo/README.md` to provide clearer Docker build instructions, emphasizing that the build must be run from within the `demo/` directory and removing previous advice about manually generating `package-lock.json` in `demo/` before building the image.
Installs python3, make, and g++ in the Docker build stage to allow node-sass to compile from source if needed. This resolves build failures encountered due to incompatible pre-compiled node-sass binaries or missing native compilation tools, particularly on ARM64 architectures or with Alpine Linux.
Adds py3-setuptools to the apk dependencies in the Docker build stage. This provides the 'distutils' Python module, which is required by node-gyp when compiling native addons like node-sass. This resolves the 'ModuleNotFoundError: No module named distutils' error encountered during the build.
Addresses two issues that caused the Vite build to fail: 1. Corrects the handling of `jjsip.min.js`: - Moves `vendor/jjsip.min.js` to `demo/public/jjsip.min.js`. - Updates the script tag in `demo/index.html` to `src="/jjsip.min.js"` so Vite handles it as a static asset. This resolves the error "can't be bundled without type='module' attribute". 2. Removes unexpected characters from `demo/src/ChatContainer.vue`: - Deletes stray Unicode characters ('ްް') found in an import statement that caused a SyntaxError during parsing.
Modifies `demo/vite.config.js` to set `base: '/'` unconditionally. This ensures that asset paths generated during the Vite build are absolute from the server root, aligning with the Nginx configuration in the Docker image which serves the demo application from the root. This resolves 404 errors for assets (e.g., JavaScript, CSS files) when running the demo application in the Docker container, where previously assets were being requested with a `/vue-advanced-chat/` prefix due to a conditional production base path.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Integrates JJSIP.js to enable voice call functionality within chat rooms.
Key changes:
jjsipService.js
to manage JJSIP User Agent, call session lifecycle (make, answer, hangup), and event handling.Room.vue
to:jjsipService
.<audio>
element for remote audio playback, connected viajjsipService
.RoomHeader.vue
to include a "Call" button that initiates calls.App.vue
->ChatContainer.vue
->ChatWindow.vue
->Room.vue
).vendor/jjsip.min.js
as the JJSIP library was not found on standard package managers/CDNs during development.jjsipService.js
,Room.vue
, andRoomHeader.vue
to cover the new functionality, including mocking of the JJSIP library and service interactions.What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information: