Feature Code Admin Class
The Feature Code class allows modules to add and/or remove feature codes from FreePBX, it also allows users to change these feature codes on the Feature Code Admin page. Adding and Removing feature codes is extremely easy.
First Steps
For every feature code simply add this command, You'll need to know your module's rawname (in module.xml) and then define a unique featurecode name (for internal purposes):
$fcc = new featurecode(<rawmodulename>, <uniquefeaturecodename>); |
Example:
$fcc = new featurecode('parking', 'parkedcall'); |
Defining Settings
Setting Description
Define the Description of the feature code which will be seen in Feature Code Admin (REQUIRED)
$fcc->setDescription('Pickup ParkedCall Prefix'); |
Setting Help Text (Hover Bubble Text)
Define the help text that will be shown when users hover over the icon next to your feature code
Set Default Feature Code Number
Define the default and initial feature code number (REQUIRED)
Description
Define whether this feature code should be a destination in the drop down destination boxes throughout FreePBX(REQUIRED)
Save & Update
To commit your settings to the system make sure you run the update command listed below
Retrieving Settings
Getting the User Defined Feature Code
This will get the User Defined Feature Code for your Feature Code (If the user changed it)
Alternatively you can get the feature code only if it's enabled in module admin
Checking Feature Code Status
This will allow you to tell if the user has disabled or enabled the feature code
You can also enable the setting by running (make sure to run update() after!)