Skip to navigation

Trigger Conditions

View as Markdown

Optional. By default the server delivers inbound calls and inbound WhatsApp messages to the connector.

Configure trigger conditions to change routing - for example, deliver only missed calls, stop inbound calls, or stop inbound messages while retaining outbound capability.

Setup

Build with TriggerConditionsBuilder and send once after connecting:

from agentduet import InboundCallMode, TriggerConditionsBuilder
trigger_config = (
TriggerConditionsBuilder()
.inbound_call(InboundCallMode.ALL) # all incoming calls
.inbound_message(True) # inbound WhatsApp
.build()
)
await sm.setup_trigger_conditions(trigger_config)

InboundCallMode

ModeEffect
ALLEvery incoming call
MISSED_ONLYOnly calls no other destination answered
NOStop inbound call delivery

inbound_message

True delivers incoming WhatsApp to @on_incoming_message. False stops delivery. Call and message routing are independent: calls only, messages only, or both.

Rules of thumb

  1. Routing only. Trigger conditions never gate what the SDK can do. Outbound make_call / dial / send_message work regardless.
  2. Absolute replace. The config you send fully replaces server-side routing. Set every flow you want; defaults are inbound calls ALL and inbound messages on.
  3. Send once. Applied across automatic reconnects; you do not need to re-send.

Note: Builder toggles for outbound_call / outbound_message belong to an upcoming “notify me when the subscriber places a call or sends a message” feature and have no effect yet.

VoiceAgent(..., inbound=...) also sends an absolute trigger config on startup and resets message-flow toggles to defaults. Pass inbound=None to leave the connector configuration untouched.

Next Step