im getting 500 errors from create_sip_participant ...
# ask-ai
i
im getting 500 errors from create_sip_participant but listening to the calls it looks like theyre just going to voicemail, whats going on?
t
Thanks for reaching out, Ed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The 500 errors you're encountering with
create_sip_participant
could be related to voicemail detection or internal server issues. Here are some steps to help troubleshoot: • Error Handling: Implement detailed error handling to capture SIP status codes and messages. For example, use the
TwirpError
exception to log SIP-specific metadata like status codes and messages. • Voicemail Detection: If calls are going to voicemail, you can use answering machine detection patterns to identify and handle these scenarios. For instance, after detecting a voicemail greeting, you can programmatically hang up the call. • Timeout Configuration: Ensure your
create_sip_participant
requests have appropriate timeout settings. The default timeout is 30 seconds, but you can extend it to 80 seconds using
wait_until_answered=True
. • Call Status Monitoring: Use participant attributes to monitor call states. This can help you identify if the call is active, dialing, or has reached voicemail. If the issue persists or you need further assistance, please provide additional details such as specific error messages, configurations, or logs. Sources: livekit/livekit_sip.twirp.go | ivr-nagivator/flask_livekit/extension.py | agent.py | pkg/service/sip.go | telephony/make_call/make_call.py
i
What im saying is that the call goes to voicemail but we get a 500 error, so the agent never gets a chance to even hear the audio and determine its a voicemail
t
Hey there! I totally understand how frustrating voicemail and error issues can be. Let me walk you through some friendly troubleshooting steps that might help solve this pesky problem. • Error Details: Think of this like detective work - grab those detailed error messages by catching the
TwirpError
exception. It's like getting the full story behind what's going wrong. • Audio Configuration: Make sure you've got the
play_dialtone
option turned on when creating your SIP participant. This is like leaving a little breadcrumb for your agents to follow when a call might be heading to voicemail. • Voicemail Detection: We want to be smart about handling voicemail scenarios. While automatic answering machine detection can be tricky, it's worth exploring ways to catch these calls before they slip away. • Logs and SIP Status: Time to put on your investigator hat! Dive into those server logs and SIP status codes. They're like secret clues that can help us understand what's really happening behind the scenes. If these steps feel like they're not quite hitting the mark, don't worry - we'll keep working together to get to the bottom of this. Sometimes these technical puzzles just need a bit of extra love and attention! Sources: protobufs/livekit_sip.proto | agent.py | Make outbound calls | LiveKit Docs