https://retellai.com/?utm_source=discord&utm_medium=seo logo
# Retell AI Support Request (Short Version)## Subj...
# ❓・ai-evy-support
g
# Retell AI Support Request (Short Version) ## Subject Web Call
error_user_not_joined
- Need Implementation Guidance ## Issue We're implementing Web Call but getting
error_user_not_joined
. WebSocket connects and we send audio data (16-bit PCM, 24kHz), but connection closes in 100ms with code 1005. ## Current Implementation 1. Create call:
retellClient.call.createWebCall({ agent_id })
✅ Works 2. Connect WebSocket:
wss://api.retellai.com/audio-websocket/{call_id}?sample_rate=24000&access_token={token}
✅ Connects 3. Send audio: 16-bit PCM, 24kHz, 480 samples/packet, every 20ms ✅ Sending 4. Problem: Connection closes immediately, Retell shows
error_user_not_joined
❌ ## Questions 1. What is the correct WebSocket URL format and authentication method? 2. What is the exact audio format required (bit depth, endianness, sample rate)? 3. Do we need to send any initialization/protocol messages after connection? 4. Is there an official Web SDK for browser-based web calls? 5. Where can we find detailed Web Call WebSocket documentation or examples? ## Technical Details - SDK:
retell-sdk@4.66.0
- Framework: Next.js 16 - Audio: Web Audio API, 16-bit PCM, 24kHz - Error:
error_user_not_joined
, WebSocket code 1005 Thank you! @AI Evy
a
Thanks for tagging me @giotto. I'll look through relevant sources and get back to you shortly.
### Answer The
error_user_not_joined
disconnection reason means the user did not join the web call within 30 seconds after calling
startWebCall
. [(1) ]() ## Key Issue Based on the documentation, you should not be manually connecting to a WebSocket and sending raw audio. For web calls, you need to use the Web SDK on the frontend with the
access_token
returned from
createWebCall
. [(2) ]() ## Correct Flow 1. **Backend**: Create the web call using the SDK:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const webCallResponse = await client.call.createWebCall({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(webCallResponse.agent_id) ;
2. **Frontend**: Use the returned
access_token
with the official Retell Web SDK to join the call. The
access_token
is specifically described as: "Access token to enter the web call room. This needs to be passed to your frontend to join the call." ## What You're Missing You're attempting to manually handle the audio WebSocket, but the documentation indicates you should use the official Web SDK which handles: - WebSocket connection management - Audio capture and streaming - The
startWebCall
function that must be called within 30 seconds ## Where to Find Web SDK Documentation The available sources don't contain the detailed Web SDK implementation documentation. I'd recommend checking: - [Retell AI GitHub]() - [Contact Sales]() for additional support Would you like me to provide a general answer about typical Web SDK patterns, or would you prefer to consult the official Web SDK documentation directly?
​ To learn more, see the sources I considered: [[1] Debug call disconnection](https://docs.retellai.com/reliability/debug-call-disconnect) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.