Global Functions in 12 and Higher

Global Functions

These functions can be used throughout FreePBX to obtain relevant data. Click below to see more about each function:

 

 

Check if a BMO module class has a callable method

Check if a BMO module class has a callable method, will check status of said module first before checking on it

/**  * Check to see if said module has method and is publicly callable  * @param {string} $module The raw module name  * @param {string} $method The method name  */ FreePBX::Modules()->moduleHasMethod($module, $method);

Get all modules that have method

Get an array of all BMO modules that have said method

/**  * Get all modules that have said method  * @param {string} $method The method name to look for  */ FreePBX::Modules()->getModulesByMethod($method);

Check status

Check the status of said module to see if it is said state.

The 5 states are as follows:

  • MODULE_STATUS_NOTINSTALLED

  • MODULE_STATUS_DISABLED

  • MODULE_STATUS_ENABLED

  • MODULE_STATUS_NEEDUPGRADE

  • MODULE_STATUS_BROKEN

/**  * Boolean return for checking a module's status  * @param {string} $modname Module Raw Name  * @param {constant} $status  Integer/Constant, status to compare to  */ FreePBX::Modules()->checkStatus($modname,$status=MODULE_STATUS_ENABLED);

Get signature of Module

Get the signature status of Module

Parse Module XML

Get the module XML of module as a simpleXML object

Return to Documentation Home I Return to Sangoma Support