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:

 

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

Return to Documentation Home I Return to Sangoma Support