Skip to content

Add timeout destination handling in call_flow_map#3

Open
eliweaver732 wants to merge 1 commit into
fusionpbx:mainfrom
eliweaver732:feature/timeout-destination-handling
Open

Add timeout destination handling in call_flow_map#3
eliweaver732 wants to merge 1 commit into
fusionpbx:mainfrom
eliweaver732:feature/timeout-destination-handling

Conversation

@eliweaver732

Copy link
Copy Markdown

What

This PR adds support for ring group timeout destination mapping in the call flow visualization. It enhances the build_ring_group() method in the call_flow_map.php class to detect and render exit actions (timeout handlers) for ring groups, including exit key information when available.

Why

Problem: The call flow map visualization was incomplete for ring groups. When a call failed to connect (timeout/no answer after retries), the system's exit action wasn't being visualized in the call flow diagram. This left operators and developers without visibility into where timeout calls would be routed.

Impact:

  • For operators: Incomplete understanding of call routing logic for ring groups
  • For developers: Harder to debug timeout routing issues or verify call flow configurations
  • For compliance/documentation: Call flow diagrams couldn't accurately represent the full routing path

How It Works

The implementation adds a new code block in the build_ring_group() method that:

  1. Extracts timeout destination data from the ring group record:

    • ring_group_timeout_app — the application/handler for timeout calls
    • ring_group_timeout_data — the destination data (e.g., phone number, extension)
    • ring_group_exit_key — optional key press (if defined) that triggers the exit
  2. Creates a labeled node in the call flow:

    • Label defaults to "Exit"
    • If an exit key exists, appends it: "Exit / Key <key>"
    • This allows differentiation between timeout-triggered and key-press-triggered exits
  3. Resolves the destination recursively using the existing resolve_destination() method, ensuring timeout destinations are fully mapped (e.g., if they route to another ring group, voicemail, or IVR).

Key Details

  • Placement: Added after the "No Answer" forward destination handler, keeping related timeout/exit logic grouped together
  • Null safety: Uses null coalescing operators (??) to safely handle missing fields
  • Labeling: Smart label that includes exit key information for clarity
  • Consistency: Uses the same resolve_destination() mechanism as other routing handlers, ensuring consistency across the call flow

Testing Recommendation

Verify this works with:

  • Ring groups with timeout destinations configured
  • Timeout destinations that chain to other applications (ring groups, IVRs, voicemail)

Implemented logic to resolve timeout destinations for ring groups, enhancing call flow management.
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.

1 participant