Global Functions in 2.10 and Higher
Global Functions
These functions can be used throughout FreePBX to obtain relevant data. Click below to see more about each function:
- 1 Global Functions
- 1.1 Get the Asterisk Version
- 1.2 Get the FreePBX Version
- 1.3 Get the FreePBX Framework Version (Depreciated in favor of FreePBX Version)
- 1.4 Compare Two 'Version' Strings (2.11.0 vs 2.11.1)
- 1.5 Send Message to Log
- 1.6 Generate Debug Message
- 1.7 Generate FreePBX Die Message
- 1.8 Show "Apply Changes" (Need Reload) Button
- 1.9 Check if "Apply Changes" (Need Reload) flag is set
- 1.10 Locate System Application
- 1.11 Recursively Remove a Directory
Get the Asterisk Version
Used to get the Version of Asterisk
engine_getinfo(); |
Example:
$ast_info = engine_getinfo();
$version = $ast_info["version"]; |
Get the FreePBX Version
Used to get the Version of FreePBX (Which is the Framework Version)
/**
* Get the FreePBX/Framework Version
* @param bool $cached Whether to pull from the DB or not
* @return string The FreePBX version number
*/
getversion($cached=true); |
Get the FreePBX Framework Version (Depreciated in favor of FreePBX Version)
Used to get the Framework Version of FreePBX
Compare Two 'Version' Strings (2.11.0 vs 2.11.1)
Compare two versions of software, with special FreePBX nomenclature assumed.
Example:
Send Message to Log
FreePBX Logging facility to FILE or syslog
this is not the same as the dbug() function!
Generate Debug Message
FreePBX Debugging function, you can view the messages output by this function by running (On the CLI): amportal a dbug
Generate FreePBX Die Message
Throws a PHP DIE message from FreePBX
Show "Apply Changes" (Need Reload) Button
Tell the user we need to apply changes and reload Asterisk
Check if "Apply Changes" (Need Reload) flag is set
Check to see if Apply Changes/Need Reload flag has been set
Locate System Application
returns the absolute path to a system application
Recursively Remove a Directory
Recursively remove a directory