Skip to content

Sync domain resolution logic with upstream fusionpbx#4

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/review-fusionpbx-core
Draft

Sync domain resolution logic with upstream fusionpbx#4
Copilot wants to merge 2 commits intomasterfrom
copilot/review-fusionpbx-core

Conversation

Copy link

Copilot AI commented Feb 3, 2026

Fork was missing automatic domain UUID resolution from HTTP hostname, present in upstream fusionpbx/fusionpbx@40f09dd.

Changes

resources/require.php - Added domain resolution before settings initialization:

  • Extract domain name from $_SERVER["HTTP_HOST"] when session lacks domain_uuid
  • Strip port numbers (:8080 → ``)
  • Query v_domains table for matching domain_uuid
  • Populate session with domain_uuid and domain_name
  • Pass resolved domain_uuid to settings constructor as fallback
//get the domain_name and the domain_uuid
if (empty($_SESSION['domain_uuid'])) {
    $domain_name = $_SERVER["HTTP_HOST"];
    if (!empty($_REQUEST["domain_name"])) {
        $domain_name = $_REQUEST["domain_name"];
    }
    $domain_array = explode(":", $domain_name);
    if (count($domain_array) > 1) {
        $domain_name = $domain_array[0];
    }
    
    $sql = "select domain_uuid from v_domains where domain_name = :domain_name";
    $parameters['domain_name'] = $domain_name;
    $row = $database->select($sql, $parameters, 'row');
    $domain_uuid = '';
    if (is_array($row) && sizeof($row) != 0) {
        $domain_uuid = $row['domain_uuid'];
        if (session_status() === PHP_SESSION_ACTIVE) {
            $_SESSION['domain_uuid'] = $domain_uuid;
            $_SESSION['domain_name'] = $domain_name;
        }
    }
}

Critical for multi-tenant deployments where domains are accessed by hostname. CDR and core configs already match upstream.

Original prompt

i think you should review fusionpbx core https://github.com/fusionpbx/fusionpbx.git- u can adjust any config like cdr following them-


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: mostakinads-design <258886467+mostakinads-design@users.noreply.github.com>
Copilot AI changed the title [WIP] Review and adjust FusionPBX core configurations Sync domain resolution logic with upstream fusionpbx Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants