i have configured an inbound third-party sip. when...
# ask-ai
n
i have configured an inbound third-party sip. when i call the number, it gets picked up and i can see from livekit logs that a room is created with an agent and the call, however i hear nothing from the agent and neither can i see any logs about the room receiving any input from the call. how to troubleshoot this? what may be the problem?
t
Thanks for reaching out, Karl. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your issue where an inbound SIP call creates a room and participant but there’s no audio and no logs of incoming media. Check these items in order — the most common cause is the agent not actually being dispatched into the room: 1. Dispatch rule / agent assignment • Confirm the dispatch rule’s
roomConfig.agents
explicitly contains the agentName used by your agent. If the agent isn’t listed, it won’t be properly connected to receive/send media. 1. Agent runtime behavior • After the agent session starts, ensure your agent code calls
generate_reply
(or otherwise sends audio) so the agent produces outbound audio into the room. • Verify the agent’s audio pipeline is initialized and not muted. 1. SIP trunk / network reachability • Confirm your SIP provider is sending media to the correct LiveKit SIP endpoint and any required IP whitelisting is configured on the provider side. 1. Token / SIP grants • Ensure the token used for the agent/dispatcher has required SIP grants (e.g.,
call
and
admin
) if your flow requires them to manage participants or trunks. 1. Logs & media diagnostics to collect • Attach/livekit server logs around room creation and participant join for timestamps when the call connects. • Check for any RTP/RTCP errors or port/ICE failures in logs (look for ICE candidate failures, DTLS, or codec negotiation errors). • Confirm the call’s codec matches what your agent/LiveKit expects (mismatch can result in no audible media). If you’d like, provide: • a snippet of your dispatch rule (redact secrets), • the agent start sequence showing
generate_reply
(or indicate it’s missing), • timestamps from the LiveKit logs for the call connect, and I’ll point to the precise field or log lines to inspect next. Sources: SIP dispatch rule | LiveKit docs | Agents telephony integration | LiveKit docs | Using Wavix to accept and make calls | LiveKit docs | server-sdk-ruby | livekit/livekit_composite | DeepWiki
a
Copy code
{
  "sipDispatchRuleId": "SDR_hidden",
  "rule": {
    "dispatchRuleIndividual": {
      "roomPrefix": "incoming-call"
    }
  },
  "trunkIds": [
    "ST_hidden"
  ],
  "name": "inbound",
  "roomConfig": {
    "agents": [
      {
        "agentName": "my-telephony-agent"
      }
    ]
  }
}
...
Copy code
await ctx.connect()

    await session.start(
        room=ctx.room,
        agent=Assistant(),
    )

    await session.generate_reply(
        instructions="Greet the caller and ask how you can help."
    )
and
Copy code
15:28:45.422 DEBUG  livekit.agents     http_session(): closing the httpclient ctx {"pid": 62104, "job_id": "hidden", "room_id": "hidden"}
                 DEBUG  livekit.agents     http_session(): creating a new httpclient ctx {"pid": 62104, "job_id": "hidden", "room_id": "hidden"}
    15:28:51.390 DEBUG  asyncio            Using selector: KqueueSelector  
    15:28:51.395 INFO   livekit.agents     starting worker {"version": "1.3.6", "rtc-version": "1.0.20"}
    15:28:51.396 INFO   livekit.agents     HTTP server listening on :63051  
    15:28:51.397 DEV    livekit.agents     reloading job {"job_id": "hidden", "agent_name": "my-telephony-agent"}
    15:28:51.406 INFO   livekit.agents     initializing process {"pid": 62125}
    15:28:51.676 INFO   livekit.agents     registered worker  
                                         {"agent_name": "my-telephony-agent", "id": "hidden", "url": "wss://hidden.livekit.cloud", "region": "hidden", 
"protocol": 16}
    15:28:52.514 INFO   livekit.agents     process initialized {"pid": 62125, "elapsed_time": 1.11}
                 DEBUG  asyncio            Using selector: KqueueSelector {"pid": 62125}
Entering the assistant agent
    15:28:53.130 DEBUG  livekit.agents     input stream attached  
                                         {"participant": null, "source": "SOURCE_UNKNOWN", "accepted_sources": ["SOURCE_MICROPHONE"], "room": 
"incoming-call_+372hidden", "pid": 62125, "job_id": "hidden", "room_id": "hidden"}
    15:28:53.135 DEBUG  livekit.agents     using audio io: `RoomIO` -> `AgentSession` -> `TranscriptSynchronizer` -> `RoomIO`  
                                         {"room": "incoming-call_+372hidden", "pid": 62125, "job_id": "hidden", "room_id": "hidden"}
                 DEBUG  livekit.agents     using transcript io: `AgentSession` -> `TranscriptSynchronizer` -> `RoomIO`  
                                         {"room": "incoming-call_+372hidden", "pid": 62125, "job_id": "hidden", "room_id": "hidden"}
t
Thanks — I’m responding to your config, code, and logs where the room and agent are created but no audio is seen or heard. What’s already good: • Your dispatch rule includes
"agentName": "my-telephony-agent"
and the room name shows the incoming-call prefix — the agent is being dispatched. • Your agent calls
session.start(...)
and
session.generate_reply(...)
— TTS should be produced. Key problem shown in your logs: • The agent’s input stream line shows
"participant": null
and
"source": "SOURCE_UNKNOWN"
. That indicates RoomIO is not recognizing the SIP participant’s published audio track as a valid input source, so the agent never receives the call audio (and you won’t see STT/transcription logs). Please check these items next (in order): 1) Confirm SIP participant kind on connect • Add a participant-connected log to print
participant.identity
,
participant.kind
, and
participant.attributes
. Share that output. • If
participant.kind
is not
SIP
, the agent will ignore the track by default. 2) Explicitly allow SIP (and unknown sources if needed) • Start the session with RoomOptions that accept SIP participants. Example pattern:
Copy code
await session.start(
  room=ctx.room,
  agent=Assistant(),
  room_options=room_io.RoomOptions(
    participant_kinds=[rtc.ParticipantKind.PARTICIPANT_KIND_SIP]
  )
)
• If your trunk reports an unexpected
source
, you can widen acceptance to include STANDARD or otherwise permissive settings temporarily. 3) Verify track source/timing • Confirm the SIP participant publishes an audio track after the agent has initialized. If the track is published before RoomIO subscribes, it may show as
participant: null
. • Inspect logs for track publish events and ICE/DTLS negotiation errors. 4) Trunk/provider checks • Ensure the SIP provider is sending media to the correct LiveKit SIP endpoint and codecs are compatible (G.711/Opus). • Verify any IP whitelisting required by the provider is configured. 5) Quick diagnostics to enable • Enable
record=True
on
session.start
to capture session events. • Temporarily enable verbose agent logs and log STT frames to confirm whether audio frames arrive. What I need from you to continue: • The participant-connected log showing identity, kind, and attributes. • Any track-published or ICE/DTLS error lines around the call connect time. Send those and I’ll point to the exact field to change or next config to try. Sources: Agent session | LiveKit docs | SIP APIs | LiveKit docs | SIP inbound trunk | LiveKit docs | Agents (Node.js) | livekit/livekit_composite | DeepWiki | SIP participant | LiveKit docs