This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Luka(오정묵). I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Let's work together to resolve the issue with the SIP inbound call where the agent session closes unexpectedly. Here’s a step-by-step guide to help you through it: 1. Validate Agent Dispatch Configuration: Please double-check that the
agent_name
in
WorkerOptions
exactly matches the
RoomAgentDispatch
rule. Sometimes, even a small mismatch can cause the agent dispatch to not work properly. 2. Monitor for Unrecoverable Agent Errors: It’s helpful to set up an
error
event listener on
AgentSession
to catch and log any errors. Using the
CloseEvent.error
property can give you insights into what’s going wrong, such as issues with TTS or LLM. 3. Handle Session Closure: When the session closes, you can use the
on_close
handler to smoothly transfer the SIP participant to a fallback number, like a human agent line, with
ctx.transfer_sip_participant()
. This keeps the experience seamless. 4. Ensure High Agent Availability: Running multiple agent workers with the same
agent_name
is a great way to add redundancy and reduce disruptions. It really helps keep things running smoothly. 5. Review SIP Server Logs: Take a look at the SIP server logs for any protocol-level hiccups like invalid trunk IDs, missing ACKs, or media timeouts. Specific log messages can point you toward authentication or connectivity issues. 6. Leverage Error Recovery: For errors that can be recovered from, mark them as recoverable within the
error
event handler to avoid closing the session. If problems persist, resetting the agent session might be the best next step. Also, enabling detailed logging in both the LiveKit SIP server and agent services will really help you diagnose and fix the issue more effectively. If you need any more guidance along the way, I’m here to help! Sources: examples/warm-transfer/warm_transfer.py | SIP Integration & Telephony | livekit/livekit_composite | DeepWiki | pkg/sip/inbound.go | SIP troubleshooting guide | LiveKit Docs | Events and error handling | LiveKit Docs
I understand how frustrating it can be to see the log entry "not dispatching agent job since no worker is available." This means that, at the moment, no worker was available to handle the SIP inbound call. Let’s walk through some helpful steps together to get this sorted out: 1. Verify Worker Availability: First, please check that your agent workers are up and running and properly registered with the LiveKit server. Sometimes workers might be unavailable due to high load or if they are intentionally draining. 2. Check Agent Name Configuration: It’s important to confirm that the
agent_name
is correctly set both in your worker configuration (
WorkerOptions
) and in the SIP dispatch rule (
RoomAgentDispatch
). 3. Scale Agent Workers: To improve availability, try running multiple agent instances with the same
agent_name
. If possible, setting up auto-scaling can really help keep things running smoothly. 4. Monitor Worker Load: Keep an eye on whether your workers are hitting the load threshold (which is 70% by default). If they are, you might want to add more resources or scale up your workers. 5. Avoid Resource Contention: Make sure there aren’t any other CPU-intensive applications running on the same server as your agent workers, as this can impact their performance. 6. Use Diagnostic Tools: Don’t hesitate to use CLI commands like
lk agent status --id <agent-id>
and
lk agent logs --id <agent-id> --log-type=deploy
. These tools can give you valuable insights into the agent status and logs, which can help with troubleshooting. Following these steps should guide you toward identifying and resolving the issue with unavailable workers for your SIP inbound calls. If you need any more help or have questions along the way, I’m here for you! Sources: SIP troubleshooting guide | LiveKit Docs | Troubleshooting & Common Issues | livekit/livekit_composite | DeepWiki | SIP Integration & Telephony | livekit/livekit_composite | DeepWiki | Community & Support | livekit/livekit_composite | DeepWiki | pkg/agent/client.go
Thank you for sharing the dispatch list! Let’s walk through some important points together to help identify any potential misconfigurations: 1. Trunk Association: Please double-check that the trunk ID
ST_XCn2KbcwxsFB
is set up correctly and matches the SIP trunk used for your inbound calls. If the trunk isn’t configured properly or isn’t active, the rule might not work as expected. 2. Room Name Format: The room name pattern To help narrow things down further, it’s a good idea to confirm that your SIP trunk is active and correctly authenticated. Then, try testing the dispatch rule by making a call to see if it routes to the right room and agent. I’m here if you need any more guidance along the way! a. _ should fit the expected format for inbound calls. It’s a good idea to verify that the caller ID and the random string are being generated just right. b. Agent Name: Make sure the agent name
inbound-demo-test
matches exactly with the
agent_name
set in your worker settings. Even a small mismatch here can stop the agent from being dispatched. c. Rule Type: The rule type is currently set to
Individual (Caller)
. Think about whether this fits your intended setup for routing calls to individual participants, just to be sure everything aligns. d. Attributes: The attributes field is empty (
map[]
). If your routing depends on specific attributes, please check that they’re properly defined. Sources: livekit-protocol/livekit/protocol/sip.pyi | livekit/livekit_sip.pb.go | SIP dispatch rule | LiveKit Docs | SIP APIs | LiveKit Docs | Accepting inbound calls | LiveKit Docs