Outbound Testing

Outbound Testing

Use this checklist to validate end-to-end outbound calling.

0) Prerequisites

  • LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET
  • An outbound trunk configured (or SIP credentials available)

Provider-specific SIP examples (Twilio, Telnyx, Plivo, Wavix): Provider-specific quickstarts

Related:

1) Run your agent worker

from dotenv import load_dotenv
from siphon.agent import Agent
from siphon.plugins import openai, cartesia, deepgram

load_dotenv()

agent = Agent(
    agent_name="Receptionist",
    llm=openai.LLM(),
    tts=cartesia.TTS(),
    stt=deepgram.STT(),
    system_instructions="You are a helpful receptionist.",
)

if __name__ == "__main__":
    agent.dev()

2) Configure an outbound trunk

You can either:

  • Use an existing sip_trunk_id, or
  • Provide sip_trunk_setup credentials

See: Outbound Trunks

3) Place the outbound call

import os
from dotenv import load_dotenv
from siphon.agent import Agent
from siphon.telephony.outbound import Call

load_dotenv()

call = Call(
    agent_name="Receptionist",
    sip_trunk_id=os.getenv("SIP_TRUNK_ID"),
    number_to_call_from=os.getenv("FROM_NUMBER"),
    number_to_call=os.getenv("TO_NUMBER"),
    system_instructions="You are a helpful receptionist.",
    greeting_instructions="Hello! How can I help?",
    wait_until_answered=True,
)

result = call.start()
print(result)

Expected behavior:

  • The call dials out from your trunk to number_to_call.
  • The call is routed to your running worker (matching agent_name).

Result fields

Call.start() returns a dict including:

  • dispatch_id
  • sip_participant_id
  • sip_call_id
  • error

Troubleshooting

  • Verify LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET are set.
  • Ensure agent_name matches between:
    • the worker (Agent(agent_name=...))
    • the call (Call(agent_name=...))
  • If error starts with dispatch_error:, the agent dispatch failed.
  • If error starts with sip_error:, the SIP dial-out failed.