Skip to content

Implement module dependency checking for system components (AJAM, AMI, Firewall) #884

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
jorikfon opened this issue Apr 29, 2025 · 0 comments

Comments

@jorikfon
Copy link
Collaborator

Issue Description

We need to implement a dependency checking mechanism that verifies if required system components (such as AJAM and AMI) are enabled when a module is activated. This mechanism should display appropriate warnings when dependencies are missing.

Current Behavior

When activating modules that depend on specific system components like AJAM (Asynchronous Javascript Asterisk Manager) or AMI (Asterisk Manager Interface), the system does not automatically check if these dependencies are enabled. This can lead to modules not functioning properly without clear indication of the root cause.

Expected Behavior

  • When a module is activated, the system should automatically check if all required dependencies are enabled
  • If dependencies are disabled, a clear warning message should be displayed to the user
  • The warning should specify which components need to be enabled for proper module functionality
  • Potentially offer a one-click solution to enable the required dependencies

Technical Details

We need to implement a general dependency checking mechanism that:

  1. Allows modules to declare their dependencies (AJAM, AMI, Firewall settings, etc.)
  2. Checks the status of these dependencies when the module is activated
  3. Provides a standardized way to display warnings and resolve dependency issues
  4. Potentially prevents module activation until dependencies are resolved

This mechanism could be implemented as a core service that modules can leverage through a simple API.

Modules Affected

  • CTI Client (requires AMI and AJAM)
  • Potentially other modules with similar system dependencies

Implementation Proposal

  1. Create a new DependencyChecker service in the core
  2. Define a standard format for modules to declare dependencies
  3. Implement verification methods for common dependencies:
    • AMI status check
    • AJAM status check
    • Firewall rules check
    • Other system component checks
  4. Create a standard warning display mechanism
  5. Document the API for module developers

Example Module Dependency Declaration

// Example of how a module might declare dependencies
public static $dependencies = [
    'ami' => [
        'required' => true,
        'message' => 'The CTI Client requires AMI to be enabled.'
    ],
    'ajam' => [
        'required' => true,
        'message' => 'The CTI Client requires AJAM to be enabled.'
    ],
    'firewall' => [
        'required' => false,
        'ports' => [8088, 8089],
        'message' => 'The CTI Client requires ports 8088 and 8089 to be open.'
    ]
];

Additional Context

This enhancement would significantly improve the user experience by providing clear guidance when modules aren't working due to missing dependencies, rather than leaving users to troubleshoot complex issues on their own.

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

No branches or pull requests

1 participant