Skip to main content

AI Load Balancers

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

StrategyAlgorithm
Round RobinRedis atomic counter + modulo. Falls back to random if Redis fails.
PriorityFirst active member ordered by priority ascending.
PercentageWeighted random based on member weights.

Follow-Through Failover

When follow_through is enabled:

  1. If the selected AI assistant fails, the failed assistant is added to a tried list
  2. The load balancer selects the next untried assistant using the configured strategy
  3. The call routes to the next assistant with a new callback URL
  4. If no assistants remain, the fallback action executes

When follow_through is disabled, the fallback action executes immediately on failure.

Fallback Actions

ActionDescription
ExtensionRoute to a specific extension
Ring GroupRoute to a ring group
IVR MenuRoute to an IVR menu
AI AssistantRoute to another AI assistant (without follow-through)
HangupDisconnect the call

Permissions

ActionOwnerPBX AdminPBX UserReporter
View load balancersYesYesYesYes
Create load balancersYesYesNoNo
Update load balancersYesYesNoNo
Delete load balancersYesYesNoNo

UI Workflow

Create a Load Balancer

  1. Navigate to AI Load Balancers in the sidebar
  2. Click Create Load Balancer
  3. Enter a name
  4. Select a strategy
  5. Enable or disable follow-through
  6. Add AI assistant members with priorities or weights
  7. Choose a fallback action
  8. Save
  1. Go to Extensions
  2. Create or edit an extension
  3. Set the type to AI Load Balancer
  4. Select the load balancer
  5. Save

Key Data Fields

ai_assistant_load_balancers Table

ColumnTypeNotes
idbigintPrimary key
organization_idFKTenant scope, soft deletes
namestringUnique per org
strategyenumround_robin, priority, percentage
follow_throughbooleanCascade to next assistant on failure
statusenumactive, inactive
fallback_actionenumSee fallback actions
fallback_extension_idFK nullable
fallback_ring_group_idFK nullable
fallback_ivr_menu_idFK nullable
fallback_ai_assistant_idFK nullable

ai_assistant_load_balancer_members Table

ColumnTypeNotes
load_balancer_idFKParent load balancer
ai_assistant_idFKMember assistant
priorityintegerLower = higher (PRIORITY strategy)
weightinteger 0-100PERCENTAGE strategy
positionintegerROUND_ROBIN order
statusenumactive, inactive
MethodEndpointPurpose
GET/POST/PUT/DELETE/v1/ai-assistant-load-balancers[/{loadBalancer}]Standard CRUD

See the OPBX REST API reference for full schemas.