Inbound Dispatch Rules
Inbound Dispatch Rules
Inbound calls reach your agent through a SIP dispatch rule. SIPHON wraps this with Dispatch.
Provider-specific SIP examples (Twilio, Telnyx, Plivo, Wavix): Provider-specific quickstarts
What Dispatch creates
When you run Dispatch(...).agent() SIPHON:
- Ensures you have an inbound SIP trunk ID (existing or created).
- Creates a SIP dispatch rule that routes calls to a room/session prefix (for example
inbound-call-). - Optionally attaches agent configuration as metadata so the worker can use your LLM/STT/TTS + instructions.
Create a dispatch rule
There are two common patterns:
- A routing-only dispatch rule (agent runs with its own defaults)
- A dispatch rule that also carries agent configuration (LLM/STT/TTS + instructions)
Routing-only dispatch (no agent config)
Use this when your worker is already configured with defaults and you only need routing.
import os
from siphon.telephony.inbound import Dispatch
from dotenv import load_dotenv
load_dotenv()
dispatch = Dispatch(
dispatch_name="customer-support",
agent_name="CustomerSupport",
sip_trunk_id=os.getenv("SIP_TRUNK_ID"),
# Or: sip_number=os.getenv("SIP_NUMBER"),
)
dispatch.agent()
Dispatch with agent configuration
Use this when you want the dispatch rule to define (or override) the agent configuration for calls routed through it.
import os
from siphon.telephony.inbound import Dispatch
from siphon.plugins import openai, cartesia, deepgram
from dotenv import load_dotenv
load_dotenv()
llm = openai.LLM()
tts = cartesia.TTS()
stt = deepgram.STT()
dispatch = Dispatch(
dispatch_name="customer-support",
agent_name="CustomerSupport",
sip_trunk_id=os.getenv("SIP_TRUNK_ID"),
# Alternatively, omit sip_trunk_id and provide sip_number
# sip_number=os.getenv("SIP_NUMBER"),
llm=llm,
stt=stt,
tts=tts,
system_instructions="You are a helpful customer support agent.",
greeting_instructions="Thanks for calling. How can I help?",
)
result = dispatch.agent()
print(result)
Required inputs
dispatch_name- A stable identifier for the rule (required).
- One of:
sip_trunk_id(use an existing inbound trunk)sip_number(let SIPHON look up or create a trunk for that number)