Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions resources/classes/call_flow_map.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,13 @@ private function build_call_flow(string $uuid, ?string $parent_id = null, string

$name = $row['call_flow_name'] ?? 'Call Flow';
$ext = !empty($row['call_flow_extension']) ? ' (' . $row['call_flow_extension'] . ')' : '';
$status = !empty($row['call_flow_status']) ? "\nStatus: " . $row['call_flow_status'] : '';
$this->add_node($node_id, "🔄 " . $name . $ext . $status, 'call_flow', 'Call Flow: ' . $name, [], $depth);
// Mirror FusionPBX call_flows list: status true → primary label, false → alternate
$status_text = ($row['call_flow_status'] ?? '') != 'false'
? (!empty($row['call_flow_label']) ? $row['call_flow_label'] : 'Active')
: (!empty($row['call_flow_alternate_label']) ? $row['call_flow_alternate_label'] : 'Alternate');
$status = "\nStatus: " . $status_text;
$dial = !empty($row['call_flow_feature_code']) ? "\nDial Code: " . $row['call_flow_feature_code'] : '';
$this->add_node($node_id, "🔄 " . $name . $ext . $status . $dial, 'call_flow', 'Call Flow: ' . $name, [], $depth);

if ($parent_id !== null) {
$this->add_edge($parent_id, $node_id, $edge_label);
Expand Down Expand Up @@ -773,7 +778,13 @@ private function build_extension_reverse(string $uuid): string {
$n_id = 'cf_' . $cf['call_flow_uuid'];
if (!in_array($n_id, $this->visited)) {
$this->visited[] = $n_id;
$this->add_node($n_id, "🔄 " . $cf['call_flow_name'] . "\n(" . $cf['call_flow_extension'] . ")", 'call_flow', 'Call Flow: ' . $cf['call_flow_name'], [], 0);
$cf_ext = !empty($cf['call_flow_extension']) ? ' (' . $cf['call_flow_extension'] . ')' : '';
$cf_status_text = ($cf['call_flow_status'] ?? '') != 'false'
? (!empty($cf['call_flow_label']) ? $cf['call_flow_label'] : 'Active')
: (!empty($cf['call_flow_alternate_label']) ? $cf['call_flow_alternate_label'] : 'Alternate');
$cf_status = "\nStatus: " . $cf_status_text;
$cf_dial = !empty($cf['call_flow_feature_code']) ? "\nDial Code: " . $cf['call_flow_feature_code'] : '';
$this->add_node($n_id, "🔄 " . $cf['call_flow_name'] . $cf_ext . $cf_status . $cf_dial, 'call_flow', 'Call Flow: ' . $cf['call_flow_name'], [], 0);
}
$this->add_edge($n_id, $ext_node_id, $edge_label);
}
Expand Down