Which error codes signify bad number during add si...
# ask-ai
s
Which error codes signify bad number during add sip participant?
t
Thanks for reaching out, Saurabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Unfortunately, I couldn't find specific error codes that signify a bad number when adding a SIP participant. However, when creating a SIP participant for outbound calls, errors can be caught using a try/except block with
api.TwirpError
. This provides error information, including SIP status codes. Here's an example:
Copy code
try:
    await ctx.api.sip.create_sip_participant(...)
except api.TwirpError as e:
    print(f"error creating SIP participant: {e.message}, "
          f"SIP status: {e.metadata.get('sip_status_code')} "
          f"{e.metadata.get('sip_status')}")
If you need further assistance or have additional details, feel free to share! Sources: Agents telephony integration | LiveKit Docs