-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding a SIP Gateway Functionality #4
base: master
Are you sure you want to change the base?
Conversation
A new file, SipUserAgentPlugin.java, has been added to the project, which implements the UserAgentListener interface. Additionally, a new dependency, mjsip-ua, has been added to the project's pom.xml file. Add SipUserAgentPlugin and update pom.xml A new Java class, SipUserAgentPlugin, has been added in the ripple.plugins package to manage incoming and outgoing SIP calls with various types of media. Its introduction enhances the functionality of the application. In addition to that, mjsip-ua dependency has been added to the pom.xml file to support the functioning of the newly added class. Add SipUserAgent Plugin and required dependency Added a new Java class, SipUserAgentPlugin, which improves handling of SIP calls by implementing the UserAgentListener interface. Additionally, a new dependency - mjsip-ua, has been added to the pom.xml file to support the new class.
…dler methods This commit separates the functional logic in the WebsocketEndpoint by extracting the event handling methods such as resume, decreaseVolume, increaseVolume, and pause into their own dedicated methods in the new WebRTCGStreamerPlugInEventsHandler class. The event handling now verifies if the feature equals "G_STREAM_BROADCAST". This results in a cleaner code structure, promotes method reusability and improves the readability of the code. It also simplifies the process of maintaining and enhancing the event handling functionality in the future.
This commit adds several event handling features to our WebRTC plugin. These updates streamline the response to client requests, such as creating a new thread, broadcasting, answering, and handling ice candidate requests. For better clarity and structure, part of the logic was moved from the 'WebSocketEndpoint' class to the 'WebRTCGStreamerPlugInEventsHandler' class. This should improve maintainability and make it easier to understand and update the code in the future.
Whitespace and indentation have been standardized to improve readability and consistency. This refactor doesn't change any functionality of the code. The update helps to keep the code clean and maintainable, ensuring better collaboration among team members.
A significant codebase refactoring has been performed to improve the quality of the code. Mainly, duplicate code has been reduced, leading to easier future maintenance. Conciseness and readability were prioritized, achieved by utilizing Java's built-in functional programming capabilities, taking advantage of lambdas, and using the ternary operator. The logic in various methods, including error response, message sending, field checking, and timeout handling, was also simplified, maintaining the same functionality.
Several console messages have been added both in the RegistrationClient and SipUserAgentPlugin classes for debugging. These messages provide information about the status of SIP registration, information regarding any incoming or outgoing calls, and details about media sessions. This will assist in the identification and resolution of any potential call or registration failures.
This update introduces the SIP User Agent Plugin and expands the definitions in FeatureTypes.java. Main.java now imports more libraries for sophisticated handling, especially connected with SIP functionalities. There are also changes in the file rippleApp.js client to accommodate these changes. The WebRTCGstreamer plugin now includes support for the G_STREAM_BROADCAST feature.
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
9962826 | Triggered | Generic Password | a55160a | src/main/java/africa/jopen/ripple/app/Main.java | View secret |
10009998 | Triggered | Generic Password | 914d704 | src/main/java/africa/jopen/ripple/plugins/SipUserAgentPlugin.java | View secret |
10009998 | Triggered | Generic Password | 218dec2 | src/main/java/africa/jopen/ripple/plugins/SipUserAgentPlugin.java | View secret |
10009998 | Triggered | Generic Password | 080fc87 | src/main/java/africa/jopen/ripple/plugins/SipUserAgentPlugin.java | View secret |
10009998 | Triggered | Generic Password | 080fc87 | src/main/java/africa/jopen/ripple/plugins/SipUserAgentPlugin.java | View secret |
10009998 | Triggered | Generic Password | 218dec2 | src/main/java/africa/jopen/ripple/plugins/SipUserAgentPlugin.java | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Our GitHub checks need improvements? Share your feedbacks!
Added SIP Gateway interface example in PHP and refactored Java code by removing unused configurations, comments, and organizing imports for better readability and maintainability. The SipUserAgentPlugin class has been updated with appropriate constructor parameters and method clean-up.
Extended the offer handling for SIP_GATEWAY feature by adding specific logs and call initiation processes. Also ensured that the offer creation in `rippleApp.js` respects the feature flag by altering SDP for SIP_GATEWAY and added `getSipUserAgentPluginMap` method to the `Client` model.
Enabled debug logging for SIP components in `tinylog.properties`. In `SipUserAgentPlugin`, refined call handling by removing Opus codec from SDP and improved registration response handling. Updated UI feedback on SIP registration status in `sipgateway-example.php`.
Enabled debug logging for SIP components in `tinylog.properties`. In `SipUserAgentPlugin`, refined call handling by removing Opus codec from SDP and improved registration response handling. Updated UI feedback on SIP registration status in `sipgateway-example.php`.
Updated Main and SipUserAgentPlugin classes to fix IP address assignment during server startup and SIP SDP adjustments. Simplified code and corrected IP retrieval to dynamically obtain the server's outbound IP, replaced hardcoded IP values in the SIP plugin, and guarded main method with UnknownHostException.
Centralized SDP parsing and construction into SDPUtils, simplifying the SipUserAgentPlugin code. Removed obsolete SDP building method and replaced inline parsing with utility calls to new SDPUtils methods for cleaner and more maintainable code.
Removed unused imports and cleaned up code in SipUserAgentPlugin. Added new SIP call event constants to the Events interface. Adjusted spacing and fixed minor formatting issues across the plugin for better readability and maintenance.
Refactored the SipUserAgentPlugin and changed the Media handling mechanism through a new MediaAgent class. The StreamerFactory reference is now created using the createStreamerFactory function within the init method. Renamed _streamerFactory to streamerFactory for better naming consistency.
This PR is for adding a feature where, based on this server and using the MJSIP library, WebRTC peers can connect to a SIP server like Asterisk and initiate calls via the Ripple Server.
For the clients or WebRTC clients, initiation can occur by passing the address of the SIP server and their username, secret/password. The plugin implementation approach seeks to integrate the functionality into this box to allow registration and act as a virtual SIP user/Client.
The additional function we are aiming for is to allow outgoing calls and incoming calls. An API will be provided to enable as much functionality as possible.
[To be expanded]