FreePBX uses PHP for their web interface, allowing us to make some custom scripts that run special tasks. These scripts are not included in the backup because FreePBX doesn't really know of their existence.
Below is each of the scripts and what they are for. The scripts themselves are attached.
ab.php - Address Book
Location: /var/www/html/
The purpose of this file is to read all the Contact Manager entries from the FreePBX database, narrow down the list if a group is specified, and output the results in a Yealink Remote Address Book formatted XML syntax. Yealink Phones will request an address book using the following URL syntax: https://pbx.hopatcongschools.org/ab.php?cgroup=SomeName. The "SomeName" will be a group name found in FreePBX > Admin > Contact Manager (look at the tabs).
eb.php - Export Address Book
Location: /var/www/html/
This file will export a list of voicemail extensions and corresponding email addresses. The script essentially parses the voicemail configuration file in FreePBX and outputs it's results in a JSON format, which can be read by our web server every so often and update the Staff pages with the correct voicemail extensions and phone number extensions - using the email address as they key to search on.
lockdown.php - School Lockdown Script
Location: /var/lib/asterisk/agi-bin/
This script is called by FreePBX when a lockdown number is dialed. It looks at the second digit to determine what school is calling the lockdown, and will then:
- Call the police and play a prerecorded message that the specific school has entered a lockdown.
- Make a PA announcement at just that school announcing the lockdown.
- Notify the administrators of the school lockdown.
- Activate the strobe lights at that school.
lockdown-district.php - District Lockdown Script
Location: /var/lib/asterisk/agi-bin/
Same as the lockdown script, except it performs the actions at all 4 schools and the district offices. It will also check the status of strobe lights and, if already activated, skip the PA notification at that specific school since it's already on lockdown.
lockdown-strobesoff.php - Deactivate the Strobe Lights
Location: /var/lib/asterisk/agi-bin/
This script is called by FreePBX when a lockdown is over number is dialed. It looks at the second digit to determine what school is calling off the lockdown, and will then deactivate the strobe lights at that school.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article