twirp error unknown: unexpected status from INVITE...
# ask-ai
h
twirp error unknown: unexpected status from INVITE response: sip status: 403 (FORBIDDEN), SIP status: 403 SIP_STATUS_FORBIDDEN
t
Thanks for reaching out, Krish. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The error message indicates that the SIP INVITE request received a 403 FORBIDDEN response, which typically occurs due to permission issues. This could happen if: • The SIP trunk doesn't have permission to call the specified number. • The number might be invalid or restricted. • There are authentication issues with the SIP trunk. To diagnose and resolve this issue, you can check the following: • Verify that the SIP trunk has the necessary permissions to call the number. • Ensure the number being dialed is valid and not restricted. • Check the authentication credentials and configuration of the SIP trunk. If you are handling outbound calls programmatically, you can catch and log these errors to gather more details. For example:
Copy code
try:
    await ctx.api.sip.create_sip_participant(api.CreateSIPParticipantRequest(
        # parameters...
    ))
    print("call picked up successfully")
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')}")
    ctx.shutdown()
This will provide additional SIP-specific information like the status code (403) and status message (FORBIDDEN) to help with troubleshooting. Sources: Agents telephony integration | LiveKit Docs | livekit.api API documentation