AI Load Balancers distribute calls across multiple AI assistants for redundancy and capacity management. They support several distribution strategies and follow-through failover.
Purpose
Use this module to:
- Group multiple AI assistants into a single endpoint
- Choose a distribution strategy
- Enable cascading failover between assistants
- Configure fallback actions when all assistants fail
Distribution Strategies
| Strategy | Algorithm |
|---|
| Round Robin | Redis atomic counter + modulo. Falls back to random if Redis fails. |
| Priority | First active member ordered by priority ascending. |
| Percentage | Weighted random based on member weights. |
Follow-Through Failover
When follow_through is enabled:
- If the selected AI assistant fails, the failed assistant is added to a tried list
- The load balancer selects the next untried assistant using the configured strategy
- The call routes to the next assistant with a new callback URL
- If no assistants remain, the fallback action executes
When follow_through is disabled, the fallback action executes immediately on failure.
Fallback Actions
| Action | Description |
|---|
| Extension | Route to a specific extension |
| Ring Group | Route to a ring group |
| IVR Menu | Route to an IVR menu |
| AI Assistant | Route to another AI assistant (without follow-through) |
| Hangup | Disconnect the call |
Permissions
| Action | Owner | PBX Admin | PBX User | Reporter |
|---|
| View load balancers | Yes | Yes | Yes | Yes |
| Create load balancers | Yes | Yes | No | No |
| Update load balancers | Yes | Yes | No | No |
| Delete load balancers | Yes | Yes | No | No |
UI Workflow
Create a Load Balancer
- Navigate to AI Load Balancers in the sidebar
- Click Create Load Balancer
- Enter a name
- Select a strategy
- Enable or disable follow-through
- Add AI assistant members with priorities or weights
- Choose a fallback action
- Save
Link to an Extension
- Go to Extensions
- Create or edit an extension
- Set the type to AI Load Balancer
- Select the load balancer
- Save
Key Data Fields
ai_assistant_load_balancers Table
| Column | Type | Notes |
|---|
id | bigint | Primary key |
organization_id | FK | Tenant scope, soft deletes |
name | string | Unique per org |
strategy | enum | round_robin, priority, percentage |
follow_through | boolean | Cascade to next assistant on failure |
status | enum | active, inactive |
fallback_action | enum | See fallback actions |
fallback_extension_id | FK nullable | |
fallback_ring_group_id | FK nullable | |
fallback_ivr_menu_id | FK nullable | |
fallback_ai_assistant_id | FK nullable | |
ai_assistant_load_balancer_members Table
| Column | Type | Notes |
|---|
load_balancer_id | FK | Parent load balancer |
ai_assistant_id | FK | Member assistant |
priority | integer | Lower = higher (PRIORITY strategy) |
weight | integer 0-100 | PERCENTAGE strategy |
position | integer | ROUND_ROBIN order |
status | enum | active, inactive |
| Method | Endpoint | Purpose |
|---|
| GET/POST/PUT/DELETE | /v1/ai-assistant-load-balancers[/{loadBalancer}] | Standard CRUD |
See the OPBX REST API reference for full schemas.