Vladimir
03/12/2025, 5:18 PMVapi Support Bot
03/12/2025, 5:19 PMAuthorization
header, which is required by Vapi for SIP authentication.
Here's how to resolve this:
1. **Understanding the authentication flow**:
- When you send an initial INVITE without credentials, Vapi responds with a 401 Unauthorized
- This response includes a WWW-Authenticate
header with a nonce
value
- You need to resend your INVITE with a proper Authorization
header that includes this nonce [source](https://discord.com/channels/1211482211119796234/1211483291191083018/1334238882660618250)
2. Add the Authorization header to your second INVITE request:
Authorization: Digest username="YourUsername",
realm="sip.vapi.ai",
nonce="received_nonce_value",
uri="sip:+98765432111@sip.vapi.ai",
response="calculated_md5_hash"
3. Ensure your SIP trunk credentials are correctly configured in Vapi. Check that the username and password in your configuration match what you're using in the Authorization header [source](https://discord.com/channels/1211482211119796234/1211483291191083018/1333747605628391434).
4. **Verify network configuration**: Make sure your firewall allows SIP traffic and there are no NAT issues disrupting SIP messages [source](https://discord.com/channels/1211482211119796234/1211483291191083018/1334919245468799007).
Let me know if you need more specific guidance on calculating the MD5 hash for the response value or if you continue to experience issues after implementing these changes!
Sources:
- [SIP 401 Unauthorized Error Discussion](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1334238882660618250)Vapi Support Bot
03/12/2025, 5:19 PMShubham Bajaj
03/15/2025, 2:46 PM