SIP Direct to sip.vapi.ai returns 401 — where to s...
# support
v
To set SIP authentication credentials for
sip.vapi.ai
, you need to create a SIP phone number via the Vapi API and include an
authentication
object with your desired username and password. Here’s an example request:
Copy code
json
{
  "provider": "vapi",
  "sipUri": "sip:your_username@sip.vapi.ai",
  "assistantId": "your_assistant_id",
  "authentication": {
    "realm": "sip.vapi.ai",
    "username": "your_username",
    "password": "your_password"
  }
}
Use these credentials in your Asterisk PJSIP configuration to authenticate successfully. For more details, see the [Vapi changelog](https://docs.vapi.ai/changelog/2024/10/7). Source: - [Vapi Changelog October 7, 2024](https://docs.vapi.ai/changelog/2024/10/7)
m
That 401 is actually expected Vapi AI platform doesn’t expose SIP Direct credentials in the dashboard yet, so Asterisk has nothing to authenticate with. You’ll need their team to enable SIP auth for your org and provide the username/password. Your PJSIP setup looks fine, the issue isn’t on your side. Are you planning to just send outbound calls, or also receive inbound SIP into the assistant? @Hani Emoss
h
@Matt how do i contact their team i need this done sooner rather than later
@User @User please help i need this for my campeign my sales agents are sitting here doing nothing
m
Okay
h
any one from @User available ?
@Matt sorry im freaking out trying to get this fixed and didnt get to read your full meesage
i am planning to do inbound and out bound but for this just inbound kinda
its a tech stack for outbound
due to vapi's actual outbound connections costing us too much as an org so instead of the options vapi was natively offering i set up our telephony system to make the call using asterisk to bridge the call to vapi and vapi to live agent @Matt
@Vapi Support Bot how do i escallate this ?
v
To escalate your urgent SIP authentication issue, email
support@vapi.ai
with a clear subject like "URGENT: SIP Auth Provisioning Needed for Campaign" and include all relevant details (org name, campaign urgency, technical setup). This is the fastest way to reach the Vapi team directly for urgent provisioning requests. For real-time updates, you can also join the [Vapi Discord #support channel](https://discord.com/invite/pUFNcf2WmH), but email is the official escalation path. (Source: [Vapi Support Page](https://docs.vapi.ai/support))
e
Hey! I've flagged this for our team.
s
Hey @Hani Emoss Can you try {phoneNumber}@.sip.vapi.ai ?
phoneNumber should be the one linked to your assistant, and credential ID should be linked to your phoneNumber for it to work.
just checked you are using free vapi number, credential format won't work, I'll have to check, will get back to you.
h
please lmk asap @Sarthak ( Vapi )
s
Can you try it with any dummy username and password?
type = auth auth_type = digest username = dummy password = dummy
h
on it
just finished
@Sarthak ( Vapi ), I ran the dummy auth test you requested. Details: * Dial target:
sip:cloudtalk-tax-ai-2@sip.vapi.ai
* We are calling from Asterisk through our CloudTalk SIP leg * The INVITE reaches Vapi successfully * Vapi responds with
401 Unauthorized
* The challenge header is:
WWW-Authenticate: Digest realm="sip.vapi.ai", algorithm=MD5, qop="auth"
What I observed on our side: * Asterisk then fails with:
Auth object 'vapi-auth' could not be found
and
There were no auth ids available
So the call is still being challenged by the Free Vapi SIP URI, but our side never completes a second authenticated INVITE because the loaded auth object was not actually available at runtime. Can you please confirm: 1. Whether Free Vapi SIP is expected to challenge with digest auth in this scenario 2. If yes, what the correct username format should be for
sip:cloudtalk-tax-ai-2@sip.vapi.ai
3. Whether the username should be the SIP URI user part (
cloudtalk-tax-ai-2
) or something else 4. Whether there is any Vapi-side requirement for enabling/storing SIP auth for a Free Vapi SIP URI If helpful, I can send the full SIP trace, but the key response from Vapi is: *
SIP/2.0 401 Unauthorized
*
WWW-Authenticate: Digest realm="sip.vapi.ai", algorithm=MD5, qop="auth"
s
Yes, it's expected to get 401 first, and then the second invite with digest authentication should be done for proper connection. So yes, free number does challenge with digest auth.
I can share PCAP for a working call in your assistant
h
please do
s
DMed you
h
fixed
s
Great! Can you also brief me on which changes fixed it exactly? It might be helpful for others as well.
h
i can DM you the code if you'd like!
also i have discoverd a bug o-o
@Sarthak ( Vapi )
s
Yeah sure, will help.
h
cool sending now @Sarthak ( Vapi )