8000 Implement module dependency checking for system components (AJAM, AMI, Firewall) · Issue #884 · mikopbx/Core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Implement module dependency checking for system components (AJAM, AMI, Firewall) #884
Open
@jorikfon

Description

@jorikfon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0