Source:
extensions.class.phpThis document covers the
extensionbase class and allext_*subclasses used to generate Asterisk dialplan applications in FreePBX.
FreePBX Emergency Checklist — Minimal immediate actions (copy/paste for chat/Slack) CVE-2025-57819
- Isolate
- Immediately block public access to Admin UI (80/443). Example (iptables):
- iptables -I INPUT -p tcp --dport 443 -s x.x.x.x -j ACCEPT # allow your admin IP
- iptables -I INPUT -p tcp --dport 443 -j DROP # drop all other 443
- iptables -I INPUT -p tcp --dport 80 -j DROP # drop HTTP
- If possible: place the PBX behind VPN or on a management VLAN.
- Confirm Endpoint module presence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env php | |
| <?php | |
| die('Do not run this it is for example, make your own with this information'); | |
| include '/etc/freepbx.conf'; | |
| $host = 'localhost'; | |
| $port = 3306; | |
| $database = 'asterisk'; | |
| $user = 'freepbxuser'; | |
| $password = 'NoBodyWouldSetAPasswordTo123456'; | |
| $dsn = sprintf('mysql:host=%s;port=%s;dbname=%s', $host, $port, $database); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| +++++ +++++ [> +++++ +++++ <-] > +++++ ++ . [-] Initialize cell 1 to 10, cell 2 to 67 (ASCII 'C'), print 'C' (prompt for input) | |
| , [> + <-] > Read input to cell 2 (e.g., 'p' for pre, 'o' for post, else normal) | |
| [-] +++++ +++++ [> +++++ +++++ <-] > +++++ ++++ . Set cell 2 to 74 (ASCII 'J'), print 'J' (start of "START") | |
| +++++++ . Print 'A' (65) | |
| +++++ . Print 'F' (70) | |
| ++++ . Print 'I' (73) | |
| +++++++ . Print 'Q' (81) | |
| < [> ++++ [> +++++ +++++ <-] > + <-] > [-] If input != 0, set cell 3 to 41 | |
| +++++ +++++ [> +++++ +++++ <-] > +++++ ++++ Set cell 3 to 74 (ASCII 'J') | |
| [<< [> + <-] >> -] If cell 2 != 0, move cell 3 to cell 1 |
If people didn't want us to use more RAM they would quit adding more to their system.
— Some Chrome Developer, Probably
So we have had generators since PHP 5.5. But memory be damned we just build ungoddly arrays and figure
In your module's code, where $this->FreePBX is available
Persona: Act as a principal-level full-stack engineer. Your expertise is in modern PHP (8.2+) and Node.js, with a strong preference for practical, high-performance solutions. You are a pragmatist, not a purist.
Core Directives:
- Generate: Produce complete, production-ready code.
- Refactor: Improve existing code's performance, readability, and maintainability without altering its external behavior.
- Debug: Isolate the root cause of an issue, explain it succinctly, and provide the corrected code.
- Scaffold: When I use this keyword, provide only the high-level structure, key functions/classes, and file organization. Omit full implementation details.
Technical Guidelines:
- PHP: Use modern features (e.g.,
match,readonly, attributes, enums) where they offer clear advantages. Prioritize the latest stable versions of popular libraries (e.g., Composer, Symfony components, Laravel where applicable).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> | |
| <!-- Root element: module --> | |
| <xs:element name="module"> | |
| <xs:complexType> | |
| <xs:sequence> | |
| <!-- Simple elements with string content --> | |
| <xs:element name="rawname" type="xs:string" minOccurs="1" maxOccurs="1"/> | |
| <xs:element name="repo" type="xs:string" minOccurs="0" maxOccurs="1"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # pip-boy.sh - Collects system metrics and creates markdown tables. | |
| # Copyright (C) 2025 James Finstrom | |
| # | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU Affero General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "American Samoa": { | |
| "state": "American Samoa", | |
| "areaCodes": ["684"] | |
| }, | |
| "Guam": { | |
| "state": "Guam", | |
| "areaCodes": ["671"] | |
| }, | |
| "Northern Mariana Islands": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Check if a database file is provided | |
| if [ -z "$1" ]; then | |
| echo "Usage: $0 your_database_file.db" | |
| exit 1 | |
| fi | |
| DB_FILE=$1 | |
| DUMP_FILE="dump.sql" |
NewerOlder